Package org.elasticsearch.common
Interface Rounding.Prepared
- Enclosing class:
- Rounding
public static interface Rounding.Prepared
A strategy for rounding milliseconds since epoch.
-
Method Summary
Modifier and TypeMethodDescriptionlong[]
If this rounding mechanism precalculates rounding points then this array stores dates such that each date between each entry.long
nextRoundingValue
(long utcMillis) Given the rounded value (which was potentially generated byround(long)
, returns the next rounding value.long
round
(long utcMillis) Rounds the given value.double
roundingSize
(long utcMillis, Rounding.DateTimeUnit timeUnit) Given the rounded value, returns the size between this value and the next rounded value in specified units if possible.double
roundingSize
(Rounding.DateTimeUnit timeUnit) Returns the size of each rounding bucket in timeUnits.
-
Method Details
-
round
long round(long utcMillis) Rounds the given value. -
nextRoundingValue
long nextRoundingValue(long utcMillis) Given the rounded value (which was potentially generated byround(long)
, returns the next rounding value. For example, with interval based rounding, if the interval is 3,nextRoundValue(6) = 9
. -
roundingSize
Given the rounded value, returns the size between this value and the next rounded value in specified units if possible. -
roundingSize
Returns the size of each rounding bucket in timeUnits. -
fixedRoundingPoints
long[] fixedRoundingPoints()If this rounding mechanism precalculates rounding points then this array stores dates such that each date between each entry. if the rounding mechanism doesn't precalculate points then this isnull
.
-