use of org.knime.core.node.streamable.StreamableOperator in project knime-core by knime.
the class AutoBinnerApplyNodeModel method createStreamableOperator.
/**
* {@inheritDoc}
*/
@Override
public StreamableOperator createStreamableOperator(final PartitionInfo partitionInfo, final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
return new StreamableOperator() {
@Override
public void runFinal(final PortInput[] inputs, final PortOutput[] outputs, final ExecutionContext exec) throws Exception {
PMMLPreprocPortObject pmmlPort = (PMMLPreprocPortObject) ((PortObjectInput) inputs[0]).getPortObject();
validatePMMLPort(pmmlPort);
PMMLPreprocDiscretize op = (PMMLPreprocDiscretize) pmmlPort.getOperations().get(0);
AutoBinnerApply applier = new AutoBinnerApply();
ColumnRearranger core = applier.getRearranger(op, (DataTableSpec) inSpecs[1]);
StreamableFunction func = core.createStreamableFunction(1, 0);
func.runFinal(inputs, outputs, exec);
}
};
}
use of org.knime.core.node.streamable.StreamableOperator in project knime-core by knime.
the class BasisFunctionPredictor2NodeModel method createStreamableOperator.
/**
* {@inheritDoc}
*/
@Override
public StreamableOperator createStreamableOperator(final PartitionInfo partitionInfo, final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
return new StreamableOperator() {
@Override
public void runFinal(final PortInput[] inputs, final PortOutput[] outputs, final ExecutionContext exec) throws Exception {
BasisFunctionPortObject pred = (BasisFunctionPortObject) ((PortObjectInput) inputs[0]).getPortObject();
ColumnRearranger colre = createColumnRearranger(pred, (DataTableSpec) inSpecs[1]);
colre.createStreamableFunction(1, 0).runFinal(inputs, outputs, exec);
}
};
}
use of org.knime.core.node.streamable.StreamableOperator in project knime-core by knime.
the class ClusterAssignerNodeModel method createStreamableOperator.
/**
* {@inheritDoc}
*/
@Override
public StreamableOperator createStreamableOperator(final PartitionInfo partitionInfo, final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
return new StreamableOperator() {
@Override
public void runFinal(final PortInput[] inputs, final PortOutput[] outputs, final ExecutionContext exec) throws Exception {
PMMLPortObject portObj = (PMMLPortObject) ((PortObjectInput) inputs[0]).getPortObject();
ColumnRearranger colre = createColumnRearranger(portObj, (DataTableSpec) inSpecs[1]);
StreamableFunction func = colre.createStreamableFunction(1, 0);
func.runFinal(inputs, outputs, exec);
}
};
}
use of org.knime.core.node.streamable.StreamableOperator in project knime-core by knime.
the class KnnNodeModel method createStreamableOperator.
/**
* {@inheritDoc}
*/
@Override
public StreamableOperator createStreamableOperator(final PartitionInfo partitionInfo, final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
return new StreamableOperator() {
@Override
public void runFinal(final PortInput[] inputs, final PortOutput[] outputs, final ExecutionContext exec) throws Exception {
BufferedDataTable trainData = (BufferedDataTable) ((PortObjectInput) inputs[0]).getPortObject();
ColumnRearranger c = createRearranger(trainData, (DataTableSpec) inSpecs[1], exec, -1);
StreamableFunction func = c.createStreamableFunction(1, 0);
func.runFinal(inputs, outputs, exec);
}
};
}
use of org.knime.core.node.streamable.StreamableOperator in project knime-core by knime.
the class BinByDictionaryNodeModel method createStreamableOperator.
/**
* {@inheritDoc}
*/
@Override
public StreamableOperator createStreamableOperator(final PartitionInfo partitionInfo, final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
return new StreamableOperator() {
@Override
public void runFinal(final PortInput[] inputs, final PortOutput[] outputs, final ExecutionContext exec) throws Exception {
DataTableSpec[] specs = new DataTableSpec[2];
specs[0] = (DataTableSpec) inSpecs[0];
specs[1] = (DataTableSpec) inSpecs[1];
BufferedDataTable dict = (BufferedDataTable) ((PortObjectInput) inputs[1]).getPortObject();
ColumnRearranger core = createColumnRearranger(specs, dict, exec);
core.createStreamableFunction(0, 0).runFinal(inputs, outputs, exec);
}
};
}
Aggregations