Package com.illumon.iris.db.v2.by
Class MinMaxByStateFactoryImpl
java.lang.Object
com.illumon.iris.db.v2.by.ReaggregatableStatefactory
com.illumon.iris.db.v2.by.MinMaxByStateFactoryImpl
- All Implemented Interfaces:
BasicDeflatable<MinMaxByStateFactoryImpl>
,AggregationStateFactory
- Direct Known Subclasses:
AppendMinMaxByStateFactoryImpl
public class MinMaxByStateFactoryImpl extends ReaggregatableStatefactory implements BasicDeflatable<MinMaxByStateFactoryImpl>
Minimum and Maximum aggregation factory.
Operates in two modes, for non-refreshing tables it requires very little state (just the current minimum or maximum).
For refreshing tables, it requires maintaining a TreeMap of values to counts; so that if the min/max value is removed
we are able to identify the next lowest/highest value.
You can use
AppendMinMaxByStateFactoryImpl
if you want to force append-only behavior.-
Constructor Summary
Constructors Constructor Description MinMaxByStateFactoryImpl(boolean minimum)
Create a minBy or maxBy factory. -
Method Summary
Modifier and Type Method Description BasicInflatable<MinMaxByStateFactoryImpl>
deflate()
AggregationMemoKey
getMemoKey()
Produces a MemoKey for this aggregation state factory.boolean
isMinimum()
String
toString()
-
Constructor Details
-
MinMaxByStateFactoryImpl
public MinMaxByStateFactoryImpl(boolean minimum)Create a minBy or maxBy factory.- Parameters:
minimum
- true if selecting the minimum value, false if selecting the maximum value.
-
-
Method Details
-
isMinimum
public boolean isMinimum() -
getMemoKey
Description copied from interface:AggregationStateFactory
Produces a MemoKey for this aggregation state factory.If two AggregationStateFactories have equal memoKeys, then
Table.by(com.illumon.iris.db.v2.by.AggregationStateFactory, com.illumon.iris.db.v2.select.SelectColumn...)
operations that have the same group by columns may be memoized. In that case instead of recomputing the result; the original result will be used.If null is returned, the operation will not be memoized.
- Specified by:
getMemoKey
in interfaceAggregationStateFactory
- Returns:
- an AggregationMemoKey, null if this operation can not be memoized.
-
deflate
- Specified by:
deflate
in interfaceBasicDeflatable<MinMaxByStateFactoryImpl>
-
toString
-