Class AssertRowCount

All Implemented Interfaces:
LogicalOperator, RecordSinkOperator, SinkOperator<RecordPort>

public class AssertRowCount extends CompositeOperator implements RecordSinkOperator
Verifies that the input flow contains the specified row count. This is a distributed operation if the input is distributed: it counts rows in each partition then sums to a final count at which point the assertion is applied.
  • Constructor Details

    • AssertRowCount

      public AssertRowCount()
      Default constructor
    • AssertRowCount

      public AssertRowCount(long rowCount)
      Create an AssertRowCountPlan with all the required parameters.
      Parameters:
      rowCount - the expected row count
  • Method Details

    • getLogFrequency

      public int getLogFrequency()
      Returns the frequency with which to log row count. A value of zero means log only the total count.
      Returns:
      the frequency with which to log row count.
    • setLogFrequency

      public void setLogFrequency(int logFrequency)
      Sets the frequency with which to log row count
      Parameters:
      logFrequency - the frequency with which to log row count.
    • getRowCount

      public long getRowCount()
      Returns the expected number of rows
      Returns:
      the expected number of rows
    • setRowCount

      public void setRowCount(long rowCount)
      Sets the expected number of rows
      Parameters:
      rowCount - the expected number of rows
    • getInput

      public RecordPort getInput()
      Description copied from interface: RecordSinkOperator
      Gets the record port providing the input data to the sink.
      Specified by:
      getInput in interface RecordSinkOperator
      Specified by:
      getInput in interface SinkOperator<RecordPort>
      Returns:
      the input port for the sink
    • compose

      protected void compose(CompositionContext ctx)
      Description copied from class: CompositeOperator
      Compose the body of this operator. Implementations should do the following:
      1. Perform any validation of configuration, input types, etc
      2. Instantiate and configure sub-operators, adding them to the provided context via the method OperatorComposable.add(O)
      3. Create necessary connections via the method OperatorComposable.connect(P, P). This includes connections from the composite's input ports to sub-operators, connections between sub-operators, and connections from sub-operators output ports to the composite's output ports
      Specified by:
      compose in class CompositeOperator
      Parameters:
      ctx - the context