Module org.elasticsearch.compute
Class MergePositionsOperator
java.lang.Object
org.elasticsearch.compute.operator.lookup.MergePositionsOperator
- All Implemented Interfaces:
Closeable,AutoCloseable,Operator,org.elasticsearch.core.Releasable
Combines values at the given blocks with the same positions into a single position
for the blocks at the given channels.
Example, input pages consisting of three blocks:
| positions | field-1 | field-2 |
------------------------------------
Page 1:
| 1 | a,b | 2020 |
| 1 | c | 2021 |
Page 2:
| 2 | a,e | 2021 |
Page 3:
| 4 | d | null |
Output:
| field-1 | field-2 |
---------------------------
| null | null |
| a,b,c | 2020,2021 |
| a,e | 2021 |
| null | null |
| d | 2023 |
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.compute.operator.Operator
Operator.OperatorFactory, Operator.Status -
Field Summary
Fields inherited from interface org.elasticsearch.compute.operator.Operator
MIN_TARGET_PAGE_SIZE, NOT_BLOCKED, TARGET_PAGE_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionMergePositionsOperator(int positionChannel, int[] mergingChannels, ElementType[] mergingTypes, IntBlock selectedPositions, BlockFactory blockFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidadds an input page to the operator.voidclose()notifies the operator that it won't be used anymore (i.e.voidfinish()notifies the operator that it won't receive any more input pagesreturns non-null if output page available.booleanwhether the operator has finished processing all input pages and made the corresponding output pages availablebooleanwhether the given operator can accept more input pages
-
Constructor Details
-
MergePositionsOperator
public MergePositionsOperator(int positionChannel, int[] mergingChannels, ElementType[] mergingTypes, IntBlock selectedPositions, BlockFactory blockFactory)
-
-
Method Details
-
needsInput
public boolean needsInput()Description copied from interface:Operatorwhether the given operator can accept more input pages- Specified by:
needsInputin interfaceOperator
-
addInput
Description copied from interface:Operatoradds an input page to the operator. only called when needsInput() == true and isFinished() == false -
finish
public void finish()Description copied from interface:Operatornotifies the operator that it won't receive any more input pages -
isFinished
public boolean isFinished()Description copied from interface:Operatorwhether the operator has finished processing all input pages and made the corresponding output pages available- Specified by:
isFinishedin interfaceOperator
-
getOutput
Description copied from interface:Operatorreturns non-null if output page available. Only called when isFinished() == false -
close
public void close()Description copied from interface:Operatornotifies the operator that it won't be used anymore (i.e. none of the other methods called), and its resources can be cleaned up
-