Interface Aggregator<R,T>
- All Superinterfaces:
AutoCloseable, Closeable
Interface which processes groups of rows into aggregate results.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceIs used to generate a newAggregatorinstance for every query against the target table. -
Method Summary
Modifier and TypeMethodDescriptionaccumulate(R source) Is called for each source row in the group, other than the first one.Is called for the first source row in the group.default voidclose()Is called when thisAggregatorinstance is no longer needed.Is called to produce an aggregate result for the current group.
-
Method Details
-
begin
Is called for the first source row in the group.- Parameters:
source- never null- Returns:
- the next source row instance to use, or null if it was kept by the aggregator
- Throws:
IOException
-
accumulate
Is called for each source row in the group, other than the first one.- Parameters:
source- never null- Returns:
- the next source row instance to use, or null if it was kept by the aggregator
- Throws:
IOException
-
finish
Is called to produce an aggregate result for the current group. This method is expected to assign the appropriate target column values, except for the primary key. The primary key columns are assigned automatically by the caller.- Parameters:
target- never null; all columns are initially unset- Returns:
- null if filtered out
- Throws:
IOException
-
close
Is called when thisAggregatorinstance is no longer needed.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-