Package org.elasticsearch.common.rounding

Examples of org.elasticsearch.common.rounding.DateTimeUnit


    private Long evaluate(BytesRef interval, Long value) {
        if (value == null) {
            return null;
        }
        DateTimeUnit fieldParser = DATE_FIELD_PARSERS.get(interval);
        assert fieldParser != null;
        return truncate(fieldParser, value, DEFAULT_TZ);
    }
View Full Code Here


    private Long evaluate(BytesRef interval, BytesRef timezone, Long value) {
        assert interval != null && timezone != null;
        if (value == null) {
            return null;
        }
        DateTimeUnit fieldParser = DATE_FIELD_PARSERS.get(interval);
        assert fieldParser != null;
        DateTimeZone tz = parseZone(timezone);
        assert tz != null;
        return truncate(fieldParser, value, tz);
    }
View Full Code Here

        if (interval == null) {
            throw new SearchParseException(context, "Missing required field [interval] for histogram aggregation [" + aggregationName + "]");
        }

        TimeZoneRounding.Builder tzRoundingBuilder;
        DateTimeUnit dateTimeUnit = dateFieldUnits.get(interval);
        if (dateTimeUnit != null) {
            tzRoundingBuilder = TimeZoneRounding.builder(dateTimeUnit);
        } else {
            // the interval is a time value?
            tzRoundingBuilder = TimeZoneRounding.builder(TimeValue.parseTimeValue(interval, null));
View Full Code Here

TOP

Related Classes of org.elasticsearch.common.rounding.DateTimeUnit

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.