Class SortedGroupHandler

All Implemented Interfaces:
LogicalOperator, PipelineOperator<RecordPort>, RecordPipelineOperator

public abstract class SortedGroupHandler extends ExecutableOperator implements RecordPipelineOperator
Common base class for all processes that need to detect group boundaries
  • Field Details

    • inputPort

      protected final RecordPort inputPort
    • outputPort

      protected final RecordPort outputPort
  • Constructor Details

    • SortedGroupHandler

      public SortedGroupHandler()
      Default constructor.
  • Method Details

    • getKeys

      public final String[] getKeys()
      Returns the keys to be used for detecting group boundaries
      Returns:
      the key fields on which data is grouped
    • setKeys

      public final void setKeys(String[] keys)
      Sets the keys to be used for detecting group boundaries
      Parameters:
      keys - key fields on which data is grouped
    • getInput

      public final RecordPort getInput()
      Description copied from interface: PipelineOperator
      Returns the input port
      Specified by:
      getInput in interface PipelineOperator<RecordPort>
      Returns:
      the input port
    • getOutput

      public final RecordPort getOutput()
      Description copied from interface: PipelineOperator
      Returns the output port
      Specified by:
      getOutput in interface PipelineOperator<RecordPort>
      Returns:
      the output port
    • execute

      protected final void execute(ExecutionContext ctx)
      Final execute method, subclasses should override the various abstract methods of this class to receive events.
      Specified by:
      execute in class ExecutableOperator
      Parameters:
      ctx - the execution context
    • getNumInputCopies

      protected int getNumInputCopies(LogicalPort port)
      Overridden to declare that we require 2 copies of input
      Overrides:
      getNumInputCopies in class ExecutableOperator
      Parameters:
      port - the port
      Returns:
      the number of input copies for the port
    • current

      protected final RecordInput current(ExecutionContext ctx)
      Returns the current copy of the input port
      Parameters:
      ctx - the execution context
      Returns:
      the current copy of the input port
    • lookahead

      protected final RecordInput lookahead(ExecutionContext ctx)
      Returns the lookahead copy of the input port
      Parameters:
      ctx - the execution context
      Returns:
      the current copy of the input port