public static enum StreamsContext.Type extends java.lang.Enum<StreamsContext.Type>
IBM Streams context
that a
Topology
can be executed against.Enum Constant and Description |
---|
ANALYTICS_SERVICE
Deprecated.
|
BUILD_ARCHIVE
Execution of the topology produces the application a
Streams build archive.
|
BUNDLE
Submission of the topology produces an Streams application bundle.
|
DISTRIBUTED
The topology is submitted to an IBM Streams instance.
|
DISTRIBUTED_TESTER
Testing variant of
DISTRIBUTED_TESTER . |
EDGE
Submission of the topology produces an Streams Docker image on the build service for Edge.
|
EDGE_BUNDLE
Submission of the topology produces a bundle for a Streams Docker image for debug purpose.
|
EMBEDDED
Topology is executed within the Java virtual machine that declared
it.
|
EMBEDDED_TESTER
Testing variant of
EMBEDDED . |
STANDALONE
The topology is executed directly as an Streams standalone application.
|
STANDALONE_BUNDLE
Deprecated.
Use
BUNDLE - A single bundle now works for both
distributed and standalone. |
STANDALONE_TESTER
Testing variant of
STANDALONE . |
STREAMING_ANALYTICS_SERVICE
The topology is submitted to a Streams instance running
in Streaming Analytics service on
IBM Cloud
cloud platform.
|
STREAMING_ANALYTICS_SERVICE_TESTER
Testing variant of
STREAMING_ANALYTICS_SERVICE . |
TOOLKIT
Execution of the topology produces the application as a Streams
toolkit.
|
Modifier and Type | Method and Description |
---|---|
static StreamsContext.Type |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static StreamsContext.Type[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final StreamsContext.Type EDGE
public static final StreamsContext.Type EDGE_BUNDLE
public static final StreamsContext.Type EMBEDDED
public static final StreamsContext.Type TOOLKIT
The returned type for the submit
calls is
a Future<File>
where the value is
the location of the toolkit.
The Future
returned from submit()
will
always be complete when the submit()
returns.
public static final StreamsContext.Type BUILD_ARCHIVE
The returned type for the submit
calls is
a Future<File>
where the value is
the location of the build archive.
The Future
returned from submit()
will
always be complete when the submit()
returns.
public static final StreamsContext.Type BUNDLE
A bundle (.sab
file) can be submitted to a Streaming Analytics
service running on IBM Cloud using:
STREAMING_ANALYTICS_SERVICE
context submits a topology directly to a
Streaming Analytics service.
A bundle (.sab
file) can be submitted to an IBM Streams
instance using:
streamtool submitjob
from the command lineDISTRIBUTED
context submits a topology directly to a Streams instance.
The returned type for the submit
calls is
a Future<File>
where the value is
the location of the bundle.
If running with IBM Streams 4.2 or later then additionally a
job configuration overlays
file is produced. This file provides the correct job deployment instructions
to enforce any constraints declared in the Topology
. The file is located
in the same directory as the application bundle with a suffix of json
and
the name of the application bundle file (without the sab
suffix} with _JobConfig
appended. For example for the application bundle simple.HelloWorld.sab
its job configuration overlays file would be simple.HelloWorld_JobConfig.json
.
Example of using job configuration overlays file at submit job time withThestreamtool
:streamtool submitjob --jobConfig simple.HelloWorld_JobConfig.json simple.HelloWorld.sab
Future
returned from submit()
will
always be complete when the submit()
returns.
public static final StreamsContext.Type STANDALONE_BUNDLE
BUNDLE
- A single bundle now works for both
distributed and standalone..sab
file that can be executed as an IBM Streams
standalone application.
The returned type for the submit
calls is
a Future<File>
where the value is
the location of the bundle.
The Future
returned from submit()
will
always be complete when the submit()
returns.
public static final StreamsContext.Type STANDALONE
The returned type for the submit
calls is
a Future<Integer>
where the value is
return code from the standalone execution.
The Future
returned from submit()
will be complete,
when the standalone executable terminates. This will only occur
if all the streams in the topology finalize, so that all the operators
complete. Thus some topologies, for example those polling external
data sources, will run until cancelled.
Calling Future.cancel(true)
will terminate the standalone executable.
public static final StreamsContext.Type DISTRIBUTED
The returned type for the submit
calls is
a Future<BigInteger>
where the value is
the job identifier.
When submit
returns the Future
will be complete,
but the Streams job will still be running, as typically distributed
jobs are long running, consuming continuous streams of data.
The Streams instance the topology is submitted to is defined by
the required environment variables STREAMS_DOMAIN_ID
and
STREAMS_INSTANCE_ID
. STREAMS_ZKCONNECT
must also be set for
a non-basic instance, one not using embedded ZooKeeper.
The user is set by the optional environment variable STREAMS_USERNAME
defaulting to the current operator system user name.
streamtool
is used to submit the job
and requires that streamtool
does not prompt for authentication.
This is achieved by using streamtool genkey
.
public static final StreamsContext.Type EMBEDDED_TESTER
public static final StreamsContext.Type STANDALONE_TESTER
STANDALONE
.
This allows testing frameworks
to capture the output of unconnected streams
in the topology using the facilities of Tester
.
This allows JUnit
testing of topologies, including individual functional
streams, sub-topologies, and, SPL primitive operators and composites.public static final StreamsContext.Type DISTRIBUTED_TESTER
DISTRIBUTED_TESTER
.
This allows testing frameworks
to capture the output of unconnected streams
in the topology using the facilities of Tester
.
This allows JUnit
testing of topologies, including individual functional
streams, sub-topologies, and, SPL primitive operators and composites.public static final StreamsContext.Type ANALYTICS_SERVICE
STREAMING_ANALYTICS_SERVICE
This is a synonym for STREAMING_ANALYTICS_SERVICE
.
public static final StreamsContext.Type STREAMING_ANALYTICS_SERVICE
The returned type for the submit
calls is
a Future<BigInteger>
where the value is
the job identifier.
When submit
returns the Future
will be complete,
but the Streams job will still be running, as typically distributed
jobs are long running, consuming continuous streams of data.
The name of the Streaming Analytics Service must be set as a
configuration property for a submit, using AnalyticsServiceProperties.SERVICE_NAME
.
The definition for the service is defined one of two ways:
AnalyticsServiceProperties.VCAP_SERVICES
.
This takes precedence over the environment variable.VCAP_SERVICES
If the environment variable STREAMS_INSTALL
is set to a non-empty value
then a Streams Application bundle (sab
file) is created locally using
the IBM Streams install and submitted to the service. This may be overridden
by setting the context property FORCE_REMOTE_BUILD
to true
.
public static final StreamsContext.Type STREAMING_ANALYTICS_SERVICE_TESTER
STREAMING_ANALYTICS_SERVICE
.
This context ignores any local IBM Streams install defined by the
environment variable STREAMS_INSTALL
, thus
the Streams Application bundle (sab
file) is created using
the build service.
public static StreamsContext.Type[] values()
for (StreamsContext.Type c : StreamsContext.Type.values()) System.out.println(c);
public static StreamsContext.Type valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null