Class BaseGranularitySpec.LookupIntervalBuckets
java.lang.Object
org.apache.druid.indexer.granularity.BaseGranularitySpec.LookupIntervalBuckets
- Enclosing class:
- BaseGranularitySpec
This is a helper class to facilitate sharing the code for sortedBucketIntervals among
the various GranularitySpec implementations. In particular, the UniformGranularitySpec
needs to avoid materializing the intervals when the need to traverse them arises.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.base.Optional<org.joda.time.Interval>bucketInterval(org.joda.time.DateTime dt) Returns a bucket interval using a fast lookup into an efficient data structure where all the intervals have been materializedIterator<org.joda.time.Interval>iterator()TreeSet<org.joda.time.Interval>Helper method to avoid collecting the intervals from the iterator
-
Constructor Details
-
LookupIntervalBuckets
- Parameters:
intervalIterable- The intervals to materialize
-
-
Method Details
-
bucketInterval
public com.google.common.base.Optional<org.joda.time.Interval> bucketInterval(org.joda.time.DateTime dt) Returns a bucket interval using a fast lookup into an efficient data structure where all the intervals have been materialized- Parameters:
dt- The date time to lookup- Returns:
- An Optional containing the interval for the given DateTime if it exists
-
iterator
- Returns:
- An iterator to traverse the materialized intervals. The traversal will be done in order as dictated by Comparators.intervalsByStartThenEnd()
-
materializedIntervals
Helper method to avoid collecting the intervals from the iterator- Returns:
- The TreeSet of materialized intervals
-