use of org.knime.core.node.streamable.simple.SimpleStreamableOperatorInternals in project knime-core by knime.
the class OldToNewTimeNodeModel method createInitialStreamableOperatorInternals.
@Override
public StreamableOperatorInternals createInitialStreamableOperatorInternals() {
SimpleStreamableOperatorInternals simpleStreamableOperatorInternals = new SimpleStreamableOperatorInternals();
simpleStreamableOperatorInternals.getConfig().addBoolean("hasIterated", true);
simpleStreamableOperatorInternals.getConfig().addInt("sizeRow", 0);
return simpleStreamableOperatorInternals;
}
use of org.knime.core.node.streamable.simple.SimpleStreamableOperatorInternals in project knime-core by knime.
the class OldToNewTimeNodeModel method computeFinalOutputSpecs.
@Override
public PortObjectSpec[] computeFinalOutputSpecs(final StreamableOperatorInternals internals, final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
if (m_autoType.getBooleanValue()) {
final SimpleStreamableOperatorInternals simpleInternals = (SimpleStreamableOperatorInternals) internals;
final Config config = simpleInternals.getConfig();
final DataColumnSpec[] colSpecs = new DataColumnSpec[config.getInt("sizeRow")];
for (int i = 0; i < colSpecs.length; i++) {
final DataColumnSpecCreator dataColumnSpecCreator = new DataColumnSpecCreator(config.getString("colname" + i), config.getDataType("type" + i));
colSpecs[i] = dataColumnSpecCreator.createSpec();
}
return new DataTableSpec[] { new DataTableSpec(colSpecs) };
} else {
return configure(new DataTableSpec[] { (DataTableSpec) inSpecs[0] });
}
}
use of org.knime.core.node.streamable.simple.SimpleStreamableOperatorInternals in project knime-core by knime.
the class StringToNumberNodeModel method execute.
/**
* {@inheritDoc}
*/
@Override
protected BufferedDataTable[] execute(final BufferedDataTable[] inData, final ExecutionContext exec) throws Exception {
DataTableSpec inspec = inData[0].getDataTableSpec();
List<String> inclcols = m_inclCols.getIncludeList();
if (inclcols.size() == 0) {
// nothing to convert, let's return the input table.
setWarningMessage("No columns selected," + " returning input DataTable.");
return new BufferedDataTable[] { inData[0] };
}
SimpleStreamableOperatorInternals internals = createStreamingOperatorInternals();
ColumnRearranger colre = createColumnRearranger(inspec, internals);
BufferedDataTable resultTable = exec.createColumnRearrangeTable(inData[0], colre, exec);
warningMessage(internals);
return new BufferedDataTable[] { resultTable };
}
use of org.knime.core.node.streamable.simple.SimpleStreamableOperatorInternals in project knime-core by knime.
the class ReferenceColumnResorterNodeModel method createStreamableOperatorInternalsFromOrder.
private SimpleStreamableOperatorInternals createStreamableOperatorInternalsFromOrder(final String[] order) {
SimpleStreamableOperatorInternals i = new SimpleStreamableOperatorInternals();
i.getConfig().addStringArray("order", order);
return i;
}
use of org.knime.core.node.streamable.simple.SimpleStreamableOperatorInternals in project knime-core by knime.
the class DoubleToIntNodeModel method mergeStreamingOperatorInternals.
/**
* {@inheritDoc}
*
* @since 3.1
*/
@Override
protected SimpleStreamableOperatorInternals mergeStreamingOperatorInternals(final SimpleStreamableOperatorInternals[] operatorInternals) {
// merge warning messages from potentially different partitions -> essentially concatenate the messages
StringBuilder sb = new StringBuilder();
for (SimpleStreamableOperatorInternals oi : operatorInternals) {
WarningMessage wm = (WarningMessage) oi;
if (wm.get() != null) {
sb.append(wm.get());
sb.append("\n");
}
}
WarningMessage res = new WarningMessage();
res.set(sb.toString());
return res;
}
Aggregations