public interface Granularity
This is key to the notion of how bard describes time keyed data
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(Collection<org.joda.time.Interval> intervals)
Determine if all intervals align with a granularity.
|
String |
getAlignmentDescription()
Get description of correct alignment of a granularity, e.g.
|
String |
getName()
Get the name of the granularity.
|
default Iterable<org.joda.time.Interval> |
intervalsIterable(Collection<org.joda.time.Interval> intervals)
Wrap the granularity iterator in an iterable predicate for use in streaming.
|
default Iterator<org.joda.time.Interval> |
intervalsIterator(Collection<org.joda.time.Interval> intervals)
Build an iterator that will iterate over a set of intervals, collecting them into a single stream, and slicing
or not slicing them according to the granularity given.
|
Iterator<org.joda.time.Interval> |
intervalsIterator(SimplifiedIntervalList intervals)
Build an iterator from a pre-simplified list of intervals.
|
boolean |
satisfiedBy(Granularity that)
Determine if this granularity can be fulfilled by an aggregate of another granularity.
|
default boolean |
satisfies(Granularity that)
Determine the reciprocal relationship to satisfiedBy, that this granularity fulfils an aggregate of another
granularity.
|
String getName()
default Iterator<org.joda.time.Interval> intervalsIterator(Collection<org.joda.time.Interval> intervals)
IMPORTANT WARNING: The results of this iterator will not always align with the bucketing of query results!
Period based granularities will return a single interval per result time bucket from the query. For the 'all' time grain, multiple intervals are possible, but in query result data they will all map to a single result time bucket.
intervals
- The intervals being iterated acrossIterator<org.joda.time.Interval> intervalsIterator(SimplifiedIntervalList intervals)
intervals
- The intervals as a simplified interval listintervalsIterator(Collection)
default Iterable<org.joda.time.Interval> intervalsIterable(Collection<org.joda.time.Interval> intervals)
intervals
- The intervals being iterated across(Granularity, Collection)
boolean satisfiedBy(Granularity that)
that
- The granularity to be compared againstdefault boolean satisfies(Granularity that)
that
- The granularity to be compared against.boolean accepts(Collection<org.joda.time.Interval> intervals)
intervals
- The collection of intervals that should be checkedString getAlignmentDescription()
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.