- java.lang.Object
-
- com.pervasive.datarush.operators.AbstractLogicalOperator
-
- com.pervasive.datarush.operators.CompositeOperator
-
- com.pervasive.datarush.operators.assertion.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 Summary
Constructors Constructor Description AssertRowCount()
Default constructorAssertRowCount(long rowCount)
Create anAssertRowCountPlan
with all the required parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
compose(CompositionContext ctx)
Compose the body of this operator.RecordPort
getInput()
Gets the record port providing the input data to the sink.int
getLogFrequency()
Returns the frequency with which to log row count.long
getRowCount()
Returns the expected number of rowsvoid
setLogFrequency(int logFrequency)
Sets the frequency with which to log row countvoid
setRowCount(long rowCount)
Sets the expected number of rows-
Methods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.pervasive.datarush.operators.LogicalOperator
disableParallelism, getInputPorts, getOutputPorts
-
-
-
-
Method Detail
-
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 interfaceRecordSinkOperator
- Specified by:
getInput
in interfaceSinkOperator<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:- Perform any validation of configuration, input types, etc
- Instantiate and configure sub-operators, adding them to the provided context via
the method
OperatorComposable.add(O)
- 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 classCompositeOperator
- Parameters:
ctx
- the context
-
-