Interface GranularitySpec
-
- All Known Implementing Classes:
ArbitraryGranularitySpec,BaseGranularitySpec,UniformGranularitySpec
public interface GranularitySpecTells the indexer how to group events based on timestamp. The events may then be further partitioned based on anything, using a ShardSpec.
-
-
Method Summary
All Methods Instance Methods Abstract 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.org.apache.druid.java.util.common.granularity.GranularitygetQueryGranularity()org.apache.druid.java.util.common.granularity.GranularitygetSegmentGranularity()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 intervalsIterable<org.joda.time.Interval>sortedBucketIntervals()Iterable all time groups, broken up on segment boundaries.GranularitySpecwithIntervals(List<org.joda.time.Interval> inputIntervals)
-
-
-
Method Detail
-
sortedBucketIntervals
Iterable<org.joda.time.Interval> sortedBucketIntervals()
Iterable all time groups, broken up on segment boundaries. Should be sorted by interval start and non-overlapping.- Returns:
- Iterable of all time groups
-
inputIntervals
List<org.joda.time.Interval> inputIntervals()
Returns user provided intervals as-is state. used for configuring granular path spec- Returns:
-
bucketInterval
com.google.common.base.Optional<org.joda.time.Interval> bucketInterval(org.joda.time.DateTime dt)
Time-grouping interval corresponding to some instant, if any.- Parameters:
dt- instant to return time interval for- Returns:
- optional time interval
-
materializedBucketIntervals
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- Returns:
- A fast lookup, ordered set, of the materialized bucket interval
-
getSegmentGranularity
org.apache.druid.java.util.common.granularity.Granularity getSegmentGranularity()
-
isRollup
boolean isRollup()
-
getQueryGranularity
org.apache.druid.java.util.common.granularity.Granularity getQueryGranularity()
-
withIntervals
GranularitySpec withIntervals(List<org.joda.time.Interval> inputIntervals)
-
-