public class LargeGroupDetector extends ExecutableOperator
Modifier and Type | Field and Description |
---|---|
protected RecordPort |
input
The input control port.
|
protected String[] |
keys |
Constructor and Description |
---|
LargeGroupDetector()
Detect large groupings of key values.
|
Modifier and Type | Method and Description |
---|---|
protected void |
computeMetadata(StreamingMetadataContext ctx)
Implementations must adhere to the following contracts
|
protected void |
endOfData(boolean emptyInput)
Called once at the end of run.
|
protected void |
execute(ExecutionContext ctx)
Executes the operator.
|
RecordPort |
getInput() |
String[] |
getKeys() |
protected int |
getNumInputCopies(LogicalPort inputPort)
May be overridden to specify that multiple input copies are needed for a given
input port.
|
protected void |
handleRow(boolean endOfGroup)
Called once per input row.
|
protected RecordInput |
nextKey(ExecutionContext ctx) |
protected RecordInput |
recordsIn(ExecutionContext ctx) |
void |
setKeys(String[] keys) |
void |
setWarningThreshold(long threshold)
Set the threshold for issuing a warning about group size.
|
cloneForExecution, getPortSettings, handleInactiveOutput
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
protected final RecordPort input
protected String[] keys
public LargeGroupDetector()
setKeys(String[])
public void setWarningThreshold(long threshold)
threshold
- the minimum group size required to issue a warningprotected void execute(ExecutionContext ctx)
ExecutableOperator
ctx
- context in which to lookup physical ports bound to logical portsprotected void handleRow(boolean endOfGroup)
endOfGroup
- true iff the input row is the last in the key groupprotected void endOfData(boolean emptyInput)
emptyInput
- true iff handleRow was called zero times (no input rows to aggregate)public RecordPort getInput()
public String[] getKeys()
public void setKeys(String[] keys)
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 final RecordInput recordsIn(ExecutionContext ctx)
protected final RecordInput nextKey(ExecutionContext ctx)
protected int getNumInputCopies(LogicalPort inputPort)
ExecutableOperator
getNumInputCopies
in class ExecutableOperator
inputPort
- the portCopyright © 2016 Actian Corporation. All rights reserved.