public final class ExternalRecordSink extends ExecutableOperator implements RecordSinkOperator
LogicalGraphInstance#start(). For example:
//create the graph
LogicalGraph graph= LogicalGraphFactory.newLogicalGraph();
//add some operators to the graph
op= graph.add(...);
//add the external sink to the graph
ExternalRecordSink sink= graph.add(new ExternalRecordSink());
//connect the input to the sink
graph.connect(op.getOutput(), sink.getInput());
//compile the graph
LogicalGraphInstance instance= graph.compile();
//*always* call start to start in background, not run since run will deadlock!!
instance.start();
//process the sink results in this thread
RecordInput rec= sink.getOutput();
while ( rec.stepNext() ) {
...
}
//after processing all results, join on the graph
//don't join before since it will deadlock!
instance.join();
NOTE: this operator is non-parallel
| Constructor and Description |
|---|
ExternalRecordSink()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected ExecutableOperator |
cloneForExecution()
Performs a deep copy of the operator for execution.
|
protected void |
computeMetadata(StreamingMetadataContext ctx)
Implementations must adhere to the following contracts
|
protected void |
execute(ExecutionContext ctx)
Executes the operator.
|
RecordPort |
getInput()
Gets the record port providing the input data to the sink.
|
RecordInput |
getOutput()
Returns the external port that an external application can use to receive
data from this sink.
|
boolean |
isIgnoreSortOrder()
If set to true, the sink will return records in any order.
|
protected void |
notifyError(Throwable e)
Called to notify the operator that the graph terminated abnormally
either before the operator had a chance to run or while the operator
is running.
|
void |
setIgnoreSortOrder(boolean ignoreSortOrder)
If set to true, the sink will return records in any order.
|
getNumInputCopies, getPortSettings, handleInactiveOutputdisableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutputclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdisableParallelism, getInputPorts, getOutputPortspublic ExternalRecordSink()
public RecordPort getInput()
RecordSinkOperatorgetInput in interface RecordSinkOperatorgetInput in interface SinkOperator<RecordPort>public boolean isIgnoreSortOrder()
public void setIgnoreSortOrder(boolean ignoreSortOrder)
ignoreSortOrder - whether to ignore sort order.public RecordInput getOutput()
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#setOutputDataOrderingRecordPort#setOutputDataDistributionAbstractModelPort#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 StreamingOperatorctx - the contextprotected void notifyError(Throwable e)
AbstractLogicalOperatorCompositeOperator, this method will
be invoked if any of the componentsnotifyError in class AbstractLogicalOperatore - the error that occuredprotected ExecutableOperator cloneForExecution()
ExecutableOperatorcloneForExecution in class ExecutableOperatorprotected void execute(ExecutionContext ctx)
ExecutableOperatorexecute in class ExecutableOperatorctx - context in which to lookup physical ports bound to logical portsCopyright © 2024 Actian Corporation. All rights reserved.