Search in sources :

Example 21 with StreamsContext

use of com.ibm.streamsx.topology.context.StreamsContext in project streamsx.topology by IBMStreams.

the class StatefulApp method main.

public static void main(String[] args) throws InterruptedException, ExecutionException, Exception {
    String contextType = Type.DISTRIBUTED.name();
    if (args.length == 1)
        contextType = args[0];
    Topology topology = new Topology();
    createApp(topology, false, true);
    Map<String, Object> config = new HashMap<>();
    @SuppressWarnings("unchecked") StreamsContext<BigInteger> context = (StreamsContext<BigInteger>) StreamsContextFactory.getStreamsContext(contextType);
    BigInteger jobId = context.submit(topology, config).get();
    System.out.println("Submitted job with jobId=" + jobId);
}
Also used : HashMap(java.util.HashMap) StreamsContext(com.ibm.streamsx.topology.context.StreamsContext) BigInteger(java.math.BigInteger) Topology(com.ibm.streamsx.topology.Topology)

Example 22 with StreamsContext

use of com.ibm.streamsx.topology.context.StreamsContext in project streamsx.topology by IBMStreams.

the class StatefulAppCR method main.

public static void main(String[] args) throws InterruptedException, ExecutionException, Exception {
    String contextType = Type.DISTRIBUTED.name();
    if (args.length == 1)
        contextType = args[0];
    Topology topology = new Topology();
    createApp(topology, true);
    Map<String, Object> config = new HashMap<>();
    @SuppressWarnings("unchecked") StreamsContext<BigInteger> context = (StreamsContext<BigInteger>) StreamsContextFactory.getStreamsContext(contextType);
    BigInteger jobId = context.submit(topology, config).get();
    System.out.println("Submitted job with jobId=" + jobId);
}
Also used : HashMap(java.util.HashMap) StreamsContext(com.ibm.streamsx.topology.context.StreamsContext) BigInteger(java.math.BigInteger) Topology(com.ibm.streamsx.topology.Topology)

Aggregations

StreamsContext (com.ibm.streamsx.topology.context.StreamsContext)22 Topology (com.ibm.streamsx.topology.Topology)18 HashMap (java.util.HashMap)18 Test (org.junit.Test)17 Constants (com.ibm.streamsx.kafka.test.utils.Constants)13 TStream (com.ibm.streamsx.topology.TStream)13 Type (com.ibm.streamsx.topology.context.StreamsContext.Type)13 StreamsContextFactory (com.ibm.streamsx.topology.context.StreamsContextFactory)13 SPL (com.ibm.streamsx.topology.spl.SPL)13 SPLStream (com.ibm.streamsx.topology.spl.SPLStream)13 SPLStreams (com.ibm.streamsx.topology.spl.SPLStreams)13 Condition (com.ibm.streamsx.topology.tester.Condition)13 Tester (com.ibm.streamsx.topology.tester.Tester)13 List (java.util.List)13 Map (java.util.Map)13 TimeUnit (java.util.concurrent.TimeUnit)13 Assert (org.junit.Assert)13 Delay (com.ibm.streamsx.kafka.test.utils.Delay)12 KafkaSPLStreamsUtils (com.ibm.streamsx.kafka.test.utils.KafkaSPLStreamsUtils)12 BigInteger (java.math.BigInteger)7