InputType - public class LazyAggregateStore<InputType> extends java.lang.Object implements AggregationStore<InputType>
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<Slice<InputType,?>> |
slices |
| Constructor and Description |
|---|
LazyAggregateStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
addSlice(int index,
Slice newSlice)
Add a new Slice at a specific index
|
void |
aggregate(WindowManager.AggregationWindowCollector aggregateWindows,
long minTs,
long maxTs)
Generates the window aggregates.
|
void |
appendSlice(Slice<InputType,?> newSlice)
Appends a new slice as new current slice
|
int |
findSliceByEnd(long start) |
int |
findSliceIndexByTimestamp(long ts)
Lookup for a slice which contains this timestamp.
|
Slice<InputType,?> |
getCurrentSlice() |
Slice<InputType,?> |
getSlice(int index)
Returns slice for a given index or @
IndexOutOfBoundsException |
void |
insertValueToCurrentSlice(InputType element,
long ts)
Insert the element to the current slice.
|
void |
insertValueToSlice(int index,
InputType element,
long ts) |
boolean |
isEmpty() |
void |
mergeSlice(int sliceIndex)
Merging two slices A and B happens in three steps:
1.
|
int |
size() |
public Slice<InputType,?> getCurrentSlice()
getCurrentSlice in interface AggregationStore<InputType>public int findSliceIndexByTimestamp(long ts)
AggregationStorefindSliceIndexByTimestamp in interface AggregationStore<InputType>ts - element timestamppublic Slice<InputType,?> getSlice(int index)
AggregationStoreIndexOutOfBoundsExceptiongetSlice in interface AggregationStore<InputType>index - >= 0 < sizepublic void insertValueToCurrentSlice(InputType element, long ts)
AggregationStoreinsertValueToCurrentSlice in interface AggregationStore<InputType>element - the elementts - timestamp of recordpublic void insertValueToSlice(int index,
InputType element,
long ts)
insertValueToSlice in interface AggregationStore<InputType>public void appendSlice(Slice<InputType,?> newSlice)
AggregationStoreappendSlice in interface AggregationStore<InputType>public int size()
size in interface AggregationStore<InputType>public boolean isEmpty()
isEmpty in interface AggregationStore<InputType>public void aggregate(WindowManager.AggregationWindowCollector aggregateWindows, long minTs, long maxTs)
AggregationStoreAggregateWindowState the aggregated value is set.aggregate in interface AggregationStore<InputType>aggregateWindows - definition of the requested windowminTs - startTimestamp of the earliest window.maxTs - endTimestamp of the latest windowpublic void addSlice(int index,
Slice newSlice)
AggregationStoreaddSlice in interface AggregationStore<InputType>public void mergeSlice(int sliceIndex)
AggregationStoremergeSlice in interface AggregationStore<InputType>sliceIndex - index of slice Apublic int findSliceByEnd(long start)
findSliceByEnd in interface AggregationStore<InputType>