Class DurationGranularity
- java.lang.Object
-
- org.apache.druid.java.util.common.granularity.Granularity
-
- org.apache.druid.java.util.common.granularity.DurationGranularity
-
- All Implemented Interfaces:
Cacheable
public class DurationGranularity extends Granularity
DurationGranularity buckets data based on the length of a duration
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.druid.java.util.common.granularity.Granularity
Granularity.Formatter
-
-
Field Summary
-
Fields inherited from class org.apache.druid.java.util.common.granularity.Granularity
IS_FINER_THAN
-
-
Constructor Summary
Constructors Constructor Description DurationGranularity(long duration, long origin)DurationGranularity(long duration, org.joda.time.DateTime origin)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longbucketStart(long t)org.joda.time.DateTimebucketStart(org.joda.time.DateTime time)booleanequals(Object o)byte[]getCacheKey()Get a byte array used as a cache key.longgetDuration()longgetDurationMillis()org.joda.time.format.DateTimeFormattergetFormatter(Granularity.Formatter type)org.joda.time.DateTimegetOrigin()inthashCode()longincrement(long time)org.joda.time.DateTimeincrement(org.joda.time.DateTime time)booleanisAligned(org.joda.time.Interval interval)Return true only if the time chunks populated by this granularity includes the given interval time chunk.org.joda.time.DateTimetoDate(String filePath, Granularity.Formatter formatter)StringtoString()-
Methods inherited from class org.apache.druid.java.util.common.granularity.Granularity
bucket, bucketEnd, fromString, getIterable, getTimeZone, granularitiesFinerThan, isFinerThan, mergeGranularities, toDate, toDateTime, toPath
-
-
-
-
Method Detail
-
getDuration
public long getDuration()
-
getOrigin
public org.joda.time.DateTime getOrigin()
-
getFormatter
public org.joda.time.format.DateTimeFormatter getFormatter(Granularity.Formatter type)
- Specified by:
getFormatterin classGranularity
-
increment
public long increment(long time)
- Specified by:
incrementin classGranularity
-
increment
public org.joda.time.DateTime increment(org.joda.time.DateTime time)
- Specified by:
incrementin classGranularity
-
bucketStart
public long bucketStart(long t)
- Specified by:
bucketStartin classGranularity
-
bucketStart
public org.joda.time.DateTime bucketStart(org.joda.time.DateTime time)
- Specified by:
bucketStartin classGranularity
-
toDate
public org.joda.time.DateTime toDate(String filePath, Granularity.Formatter formatter)
- Specified by:
toDatein classGranularity
-
isAligned
public boolean isAligned(org.joda.time.Interval interval)
Description copied from class:GranularityReturn true only if the time chunks populated by this granularity includes the given interval time chunk. The interval must fit exactly into the scheme of the granularity for this to return true- Specified by:
isAlignedin classGranularity
-
getCacheKey
public byte[] getCacheKey()
Description copied from interface:CacheableGet a byte array used as a cache key.- Returns:
- a cache key
-
getDurationMillis
public long getDurationMillis()
-
-