public final class AssertSorted extends ExecutableOperator implements RecordPipelineOperator
Constructor and Description |
---|
AssertSorted()
Construct the operator with default settings.
|
AssertSorted(SortKey... ordering)
Construct the assertion operator with the given key ordering.
|
Modifier and Type | Method and Description |
---|---|
protected void |
computeMetadata(StreamingMetadataContext ctx)
Implementations must adhere to the following contracts
|
protected void |
execute(ExecutionContext context)
Executes the operator.
|
RecordPort |
getInput()
Get the input data port.
|
int |
getLogFrequency()
Get the log frequency.
|
SortKey[] |
getOrdering()
Get the expected sort ordering.
|
RecordPort |
getOutput()
Output port containing the input data verified to be sorted correctly.
|
void |
setLogFrequency(int logFrequency)
Sets the frequency with with to log.
|
void |
setOrdering(SortKey... ordering)
Set the expected ordering of the input keys.
|
void |
setOrdering(String... ordering)
Set the expected ordering of the input keys.
|
cloneForExecution, getNumInputCopies, getPortSettings, handleInactiveOutput
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
disableParallelism, getInputPorts, getOutputPorts
public AssertSorted()
public AssertSorted(SortKey... ordering)
ordering
- expected sort order for the inputpublic RecordPort getInput()
getInput
in interface PipelineOperator<RecordPort>
public RecordPort getOutput()
getOutput
in interface PipelineOperator<RecordPort>
public SortKey[] getOrdering()
public void setOrdering(SortKey... ordering)
ordering
- expected sort order for the inputpublic void setOrdering(String... ordering)
asc
or desc
. For
example, to sort descending by the shipdate
field, "shipdate desc"
.ordering
- expected sort order for the inputpublic int getLogFrequency()
public void setLogFrequency(int logFrequency)
logFrequency <= 0
means log only the total number of comparisons.logFrequency
- the frequency with which to log.protected void computeMetadata(StreamingMetadataContext ctx)
StreamingOperator
StreamingMetadataContext.parallelize(ParallelismStrategy)
.
RecordPort#setRequiredDataOrdering
, otherwise data may arrive in any order.
RecordPort#setRequiredDataDistribution
, otherwise data will arrive in an unspecified partial distribution
.
RecordPort#getSourceDataDistribution
and RecordPort#getSourceDataOrdering
. These should be
viewed as a hints to help chose a more efficient algorithm. In such cases, though, operators must
still declare data ordering and data distribution requirements; otherwise there is no guarantee that
data will arrive sorted/distributed as required.
RecordPort#setType
.RecordPort#setOutputDataOrdering
RecordPort#setOutputDataDistribution
AbstractModelPort#setMergeHandler
.MergeModel
is a convenient, re-usable model reducer, parameterized with
a merge-handler.
SimpleModelPort
's have no associated metadata and therefore there is
never any output metadata to declare. PMMLPort
's, on the other hand,
do have associated metadata. For all PMMLPorts, implementations must declare
the following:
PMMLPort.setPMMLModelSpec
.
computeMetadata
in class StreamingOperator
ctx
- the contextprotected void execute(ExecutionContext context)
ExecutableOperator
execute
in class ExecutableOperator
context
- context in which to lookup physical ports bound to logical portsCopyright © 2024 Actian Corporation. All rights reserved.