Package org.elasticsearch.common.joda

Examples of org.elasticsearch.common.joda.TimeZoneRounding


        final int reps = 2000;
        final long[] input = new long[reps];
        final long[] expected = new long[reps];
        final long[] actual = new long[reps];
        final Chronology chronology = ISOChronology.getInstanceUTC();
        final TimeZoneRounding tzRounding = new TimeZoneRounding.Builder(chronology.secondOfMinute())
                .preZone(DateTimeZone.forID("Australia/Sydney"))
                .build();
        final TimeZoneRoundingCache cache = new TimeZoneRoundingCache(tzRounding, cacheSize);

        for(int i = 0; i < reps; i++) {
            input[i] = System.currentTimeMillis() / 1000;
            Thread.sleep(1);
        }

        final long start1 = System.currentTimeMillis();
        for(int i = 0; i < reps; i++) {
            expected[i] = tzRounding.calc(input[i]);
        }
        final long time1 = System.currentTimeMillis() - start1;

        final long start2 = System.currentTimeMillis();
        for(int i = 0; i < reps; i++) {
View Full Code Here


        } else {
            // the interval is a time value?
            tzRoundingBuilder = TimeZoneRounding.builder(TimeValue.parseTimeValue(interval, null));
        }

        final TimeZoneRounding tzRounding = tzRoundingBuilder
                .preZone(preZone).postZone(postZone)
                .preZoneAdjustLargeInterval(preZoneAdjustLargeInterval)
                .preOffset(preOffset).postOffset(postOffset)
                .factor(factor)
                .build();
View Full Code Here

        } else {
            // the interval is a time value?
            tzRoundingBuilder = TimeZoneRounding.builder(TimeValue.parseTimeValue(interval, null));
        }

        TimeZoneRounding tzRounding = tzRoundingBuilder
                .preZone(preZone)
                .postZone(postZone)
                .preZoneAdjustLargeInterval(preZoneAdjustLargeInterval)
                .preOffset(preOffset).postOffset(postOffset)
                .factor(factor)
View Full Code Here

        } else {
            // the interval is a time value?
            tzRoundingBuilder = TimeZoneRounding.builder(TimeValue.parseTimeValue(interval, null));
        }

        final TimeZoneRounding tzRounding = tzRoundingBuilder
                .preZone(preZone).postZone(postZone)
                .preZoneAdjustLargeInterval(preZoneAdjustLargeInterval)
                .preOffset(preOffset).postOffset(postOffset)
                .factor(factor)
                .build();
View Full Code Here

TOP

Related Classes of org.elasticsearch.common.joda.TimeZoneRounding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.