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>
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
ConstructorsConstructorDescriptionDefault constructorAssertRowCount(long rowCount) Create anAssertRowCountPlanwith all the required parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCompose the body of this operator.getInput()Gets the record port providing the input data to the sink.intReturns the frequency with which to log row count.longReturns the expected number of rowsvoidsetLogFrequency(int logFrequency) Sets the frequency with which to log row countvoidsetRowCount(long rowCount) Sets the expected number of rowsMethods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyErrorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.pervasive.datarush.operators.LogicalOperator
disableParallelism, getInputPorts, getOutputPorts
-
Constructor Details
-
AssertRowCount
public AssertRowCount()Default constructor -
AssertRowCount
public AssertRowCount(long rowCount) Create anAssertRowCountPlanwith 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
Description copied from interface:RecordSinkOperatorGets the record port providing the input data to the sink.- Specified by:
getInputin interfaceRecordSinkOperator- Specified by:
getInputin interfaceSinkOperator<RecordPort>- Returns:
- the input port for the sink
-
compose
Description copied from class:CompositeOperatorCompose 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:
composein classCompositeOperator- Parameters:
ctx- the context
-