public class JavaPrimitive
extends java.lang.Object
In addition to the usual Java types used for operator parameter values,
a Supplier<T>
parameter value may be specified.
Submission time parameters are passed in this manner.
See Topology.createSubmissionParameter(String, Class)
.
For example:
Map<String,Object> params = ...
params.put("aLong", topology.createSubmissionParameter(..., Long.class);
params.put("aShort", topology.createSubmissionParameter(..., (short)13);
... = JavaPrimitive.invokeJavaPrimitive(..., params);
Constructor and Description |
---|
JavaPrimitive() |
Modifier and Type | Method and Description |
---|---|
static SPLStream |
invokeJavaPrimitive(java.lang.Class<? extends com.ibm.streams.operator.Operator> opClass,
SPLInput input,
com.ibm.streams.operator.StreamSchema outputSchema,
java.util.Map<java.lang.String,? extends java.lang.Object> params)
Create an SPLStream from the invocation of an SPL Java primitive
operator with a single input port & output port.
|
static java.util.List<SPLStream> |
invokeJavaPrimitive(TopologyElement te,
java.lang.Class<? extends com.ibm.streams.operator.Operator> opClass,
java.util.List<? extends SPLInput> inputs,
java.util.List<com.ibm.streams.operator.StreamSchema> outputSchemas,
java.util.Map<java.lang.String,? extends java.lang.Object> params)
Invoke an SPL Java primitive operator with an arbitrary number
of input and output ports.
|
static TSink |
invokeJavaPrimitiveSink(java.lang.Class<? extends com.ibm.streams.operator.Operator> opClass,
SPLInput input,
java.util.Map<java.lang.String,? extends java.lang.Object> params)
Invocation of a Java primitive operator that consumes a Stream.
|
static SPLStream |
invokeJavaPrimitiveSource(TopologyElement te,
java.lang.Class<? extends com.ibm.streams.operator.Operator> opClass,
com.ibm.streams.operator.StreamSchema schema,
java.util.Map<java.lang.String,? extends java.lang.Object> params)
Invocation of a Java primitive source operator to produce a SPL Stream.
|
public static SPLStream invokeJavaPrimitive(java.lang.Class<? extends com.ibm.streams.operator.Operator> opClass, SPLInput input, com.ibm.streams.operator.StreamSchema outputSchema, java.util.Map<java.lang.String,? extends java.lang.Object> params)
opClass
must be annotated with PrimitiveOperator
.opClass
- Class of the operator to be invoked.input
- Stream that will be connected to the only input port of the
operatoroutputSchema
- SPL schema of the operator's only output port.params
- Parameters for the SPL Java Primitive operator, ignored if null
.public static java.util.List<SPLStream> invokeJavaPrimitive(TopologyElement te, java.lang.Class<? extends com.ibm.streams.operator.Operator> opClass, java.util.List<? extends SPLInput> inputs, java.util.List<com.ibm.streams.operator.StreamSchema> outputSchemas, java.util.Map<java.lang.String,? extends java.lang.Object> params)
inputs
results in
a input port for the operator with the input port index
matching the position of the input in inputs
.
If inputs
is null
or empty then the operator will not
have any input ports.
outputSchemas
an output port
for the operator with the output port index
matching the position of the schema in outputSchemas
.
If outputSchemas
is null
or empty then the operator will not
have any output ports.te
- Reference to Topology the operator will be in.opClass
- Class of the operator to be invoked.inputs
- Input streams to be connected to the operator. May be null
if no input streams are required.outputSchemas
- Schemas of the output streams. May be null
if no output streams are required.params
- Parameters for the SPL Java Primitive operator, ignored if null
.SPLStream
instances that represent the outputs of the operator.public static TSink invokeJavaPrimitiveSink(java.lang.Class<? extends com.ibm.streams.operator.Operator> opClass, SPLInput input, java.util.Map<java.lang.String,? extends java.lang.Object> params)
opClass
- Class of the operator to be invokedinput
- Stream that will be connected to the only input port of the
operatorparams
- Parameters for the SPL Java Primitive operator, ignored if null
.public static SPLStream invokeJavaPrimitiveSource(TopologyElement te, java.lang.Class<? extends com.ibm.streams.operator.Operator> opClass, com.ibm.streams.operator.StreamSchema schema, java.util.Map<java.lang.String,? extends java.lang.Object> params)
te
- Reference to Topology the operator will be in.opClass
- Class of the operator to be invoked.schema
- Schema of the output port.params
- Parameters for the SPL Java Primitive operator, ignored if null
.