Search in sources :

Example 6 with BOutputPort

use of com.ibm.streamsx.topology.builder.BOutputPort in project streamsx.topology by IBMStreams.

the class SPL method invokeOperator.

/**
     * Create an SPLStream from the invocation of an SPL operator
     * that consumes a stream and produces a stream.
     * 
     * @param name Name for the operator invocation.
     * @param kind
     *            SPL kind of the operator to be invoked.
     * @param input
     *            Stream that will be connected to the only input port of the
     *            operator
     * @param outputSchema
     *            SPL schema of the operator's only output port.
     * @param params
     *            Parameters for the SPL operator, ignored if it is null.
     * @return SPLStream the represents the output of the operator.
     */
public static SPLStream invokeOperator(String name, String kind, SPLInput input, StreamSchema outputSchema, Map<String, ? extends Object> params) {
    BOperatorInvocation op = input.builder().addSPLOperator(name, kind, params);
    SourceInfo.setSourceInfo(op, SPL.class);
    SPL.connectInputToOperator(input, op);
    BOutputPort stream = op.addOutput(outputSchema);
    return new SPLStreamImpl(input, stream);
}
Also used : BOperatorInvocation(com.ibm.streamsx.topology.builder.BOperatorInvocation) BOutputPort(com.ibm.streamsx.topology.builder.BOutputPort)

Aggregations

BOutputPort (com.ibm.streamsx.topology.builder.BOutputPort)6 BOperatorInvocation (com.ibm.streamsx.topology.builder.BOperatorInvocation)4 StreamHandler (com.ibm.streams.flow.handlers.StreamHandler)1 OutputTuple (com.ibm.streams.operator.OutputTuple)1 StreamSchema (com.ibm.streams.operator.StreamSchema)1 Tuple (com.ibm.streams.operator.Tuple)1 BInputPort (com.ibm.streamsx.topology.builder.BInputPort)1 BOutput (com.ibm.streamsx.topology.builder.BOutput)1