Class BaseGranularitySpec
- java.lang.Object
-
- org.apache.druid.segment.indexing.granularity.BaseGranularitySpec
-
- All Implemented Interfaces:
GranularitySpec
- Direct Known Subclasses:
ArbitraryGranularitySpec,UniformGranularitySpec
public abstract class BaseGranularitySpec extends Object implements GranularitySpec
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classBaseGranularitySpec.LookupIntervalBucketsThis is a helper class to facilitate sharing the code for sortedBucketIntervals among the various GranularitySpec implementations.
-
Field Summary
Fields Modifier and Type Field Description static org.apache.druid.java.util.common.granularity.GranularityDEFAULT_QUERY_GRANULARITYstatic BooleanDEFAULT_ROLLUPstatic org.apache.druid.java.util.common.granularity.GranularityDEFAULT_SEGMENT_GRANULARITYprotected List<org.joda.time.Interval>inputIntervalsprotected Booleanrollup
-
Constructor Summary
Constructors Constructor Description BaseGranularitySpec(List<org.joda.time.Interval> inputIntervals, Boolean rollup)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Map<String,Object>asMap(com.fasterxml.jackson.databind.ObjectMapper objectMapper)com.google.common.base.Optional<org.joda.time.Interval>bucketInterval(org.joda.time.DateTime dt)Time-grouping interval corresponding to some instant, if any.protected abstract BaseGranularitySpec.LookupIntervalBucketsgetLookupTableBuckets()List<org.joda.time.Interval>inputIntervals()Returns user provided intervals as-is state.booleanisRollup()TreeSet<org.joda.time.Interval>materializedBucketIntervals()This is a helper method for areas of the code, not in the overlord, were for performance reasons might need the materialized set of bucket intervals-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.segment.indexing.granularity.GranularitySpec
getQueryGranularity, getSegmentGranularity, sortedBucketIntervals, withIntervals
-
-
-
-
Field Detail
-
DEFAULT_ROLLUP
public static final Boolean DEFAULT_ROLLUP
-
DEFAULT_SEGMENT_GRANULARITY
public static final org.apache.druid.java.util.common.granularity.Granularity DEFAULT_SEGMENT_GRANULARITY
-
DEFAULT_QUERY_GRANULARITY
public static final org.apache.druid.java.util.common.granularity.Granularity DEFAULT_QUERY_GRANULARITY
-
inputIntervals
protected final List<org.joda.time.Interval> inputIntervals
-
rollup
protected final Boolean rollup
-
-
Method Detail
-
inputIntervals
public List<org.joda.time.Interval> inputIntervals()
Description copied from interface:GranularitySpecReturns user provided intervals as-is state. used for configuring granular path spec- Specified by:
inputIntervalsin interfaceGranularitySpec- Returns:
-
isRollup
public boolean isRollup()
- Specified by:
isRollupin interfaceGranularitySpec
-
bucketInterval
public com.google.common.base.Optional<org.joda.time.Interval> bucketInterval(org.joda.time.DateTime dt)
Description copied from interface:GranularitySpecTime-grouping interval corresponding to some instant, if any.- Specified by:
bucketIntervalin interfaceGranularitySpec- Parameters:
dt- instant to return time interval for- Returns:
- optional time interval
-
materializedBucketIntervals
public TreeSet<org.joda.time.Interval> materializedBucketIntervals()
Description copied from interface:GranularitySpecThis is a helper method for areas of the code, not in the overlord, were for performance reasons might need the materialized set of bucket intervals- Specified by:
materializedBucketIntervalsin interfaceGranularitySpec- Returns:
- A fast lookup, ordered set, of the materialized bucket interval
-
getLookupTableBuckets
protected abstract BaseGranularitySpec.LookupIntervalBuckets getLookupTableBuckets()
-
asMap
public Map<String,Object> asMap(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
- Specified by:
asMapin interfaceGranularitySpec
-
-