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 long
bucketStart(long t)
org.joda.time.DateTime
bucketStart(org.joda.time.DateTime time)
boolean
equals(Object o)
byte[]
getCacheKey()
Get a byte array used as a cache key.long
getDuration()
long
getDurationMillis()
org.joda.time.format.DateTimeFormatter
getFormatter(Granularity.Formatter type)
org.joda.time.DateTime
getOrigin()
int
hashCode()
long
increment(long time)
org.joda.time.DateTime
increment(org.joda.time.DateTime time)
boolean
isAligned(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.DateTime
toDate(String filePath, Granularity.Formatter formatter)
String
toString()
-
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:
getFormatter
in classGranularity
-
increment
public long increment(long time)
- Specified by:
increment
in classGranularity
-
increment
public org.joda.time.DateTime increment(org.joda.time.DateTime time)
- Specified by:
increment
in classGranularity
-
bucketStart
public long bucketStart(long t)
- Specified by:
bucketStart
in classGranularity
-
bucketStart
public org.joda.time.DateTime bucketStart(org.joda.time.DateTime time)
- Specified by:
bucketStart
in classGranularity
-
toDate
public org.joda.time.DateTime toDate(String filePath, Granularity.Formatter formatter)
- Specified by:
toDate
in classGranularity
-
isAligned
public boolean isAligned(org.joda.time.Interval interval)
Description copied from class:Granularity
Return 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:
isAligned
in classGranularity
-
getCacheKey
public byte[] getCacheKey()
Description copied from interface:Cacheable
Get a byte array used as a cache key.- Returns:
- a cache key
-
getDurationMillis
public long getDurationMillis()
-
-