Search in sources :

Example 76 with TopologyBuilder

use of backtype.storm.topology.TopologyBuilder in project jstorm by alibaba.

the class BatchMetaTopology method SetRemoteTopology.

public static void SetRemoteTopology() throws AlreadyAliveException, InvalidTopologyException, TopologyAssignException {
    TopologyBuilder builder = SetBuilder();
    StormSubmitter.submitTopology(topologyName, conf, builder.createTopology());
}
Also used : TopologyBuilder(backtype.storm.topology.TopologyBuilder) BatchTopologyBuilder(com.alibaba.jstorm.batch.BatchTopologyBuilder)

Example 77 with TopologyBuilder

use of backtype.storm.topology.TopologyBuilder in project jstorm by alibaba.

the class BatchMetaTopology method SetLocalTopology.

public static void SetLocalTopology() throws Exception {
    TopologyBuilder builder = SetBuilder();
    LocalCluster cluster = new LocalCluster();
    cluster.submitTopology(topologyName, conf, builder.createTopology());
    Thread.sleep(600000);
    cluster.shutdown();
}
Also used : LocalCluster(backtype.storm.LocalCluster) TopologyBuilder(backtype.storm.topology.TopologyBuilder) BatchTopologyBuilder(com.alibaba.jstorm.batch.BatchTopologyBuilder)

Example 78 with TopologyBuilder

use of backtype.storm.topology.TopologyBuilder in project jstorm by alibaba.

the class TestTopology method main.

public static void main(String[] args) throws Exception {
    if (args.length == 0) {
        System.err.println("Please input configuration file");
        System.exit(-1);
    }
    LoadConf(args[0]);
    TopologyBuilder builder = setupBuilder();
    submitTopology(builder);
}
Also used : TopologyBuilder(backtype.storm.topology.TopologyBuilder)

Example 79 with TopologyBuilder

use of backtype.storm.topology.TopologyBuilder in project jstorm by alibaba.

the class TestTopology method setupBuilder.

private static TopologyBuilder setupBuilder() throws Exception {
    TopologyBuilder builder = new TopologyBuilder();
    int writerParallel = JStormUtils.parseInt(conf.get("topology.writer.parallel"), 1);
    int spoutParallel = JStormUtils.parseInt(conf.get("topology.spout.parallel"), 1);
    builder.setSpout("MetaSpout", new MetaSpout(), spoutParallel);
    builder.setBolt(WRITER_COMPONENT, new WriterBolt(), writerParallel).shuffleGrouping("MetaSpout");
    return builder;
}
Also used : TopologyBuilder(backtype.storm.topology.TopologyBuilder) MetaSpout(com.alibaba.aloha.meta.MetaSpout)

Example 80 with TopologyBuilder

use of backtype.storm.topology.TopologyBuilder in project jstorm by alibaba.

the class TestTopology method main.

public static void main(String[] args) throws Exception {
    if (args.length == 0) {
        System.err.println("Please input configuration file");
        System.exit(-1);
    }
    conf = LoadConfig.LoadConf(args[0]);
    TopologyBuilder builder = setupBuilder();
    submitTopology(builder);
}
Also used : TopologyBuilder(backtype.storm.topology.TopologyBuilder)

Aggregations

TopologyBuilder (backtype.storm.topology.TopologyBuilder)92 Config (backtype.storm.Config)47 Fields (backtype.storm.tuple.Fields)41 LocalCluster (backtype.storm.LocalCluster)23 JStormHelper (com.alibaba.starter.utils.JStormHelper)16 Map (java.util.Map)15 Test (org.junit.Test)15 HashMap (java.util.HashMap)12 LocalDRPC (backtype.storm.LocalDRPC)7 BoltDeclarer (backtype.storm.topology.BoltDeclarer)6 JStormUnitTestMetricValidator (com.jstorm.example.unittests.utils.JStormUnitTestMetricValidator)5 ArrayList (java.util.ArrayList)5 CoordinatedBolt (backtype.storm.coordination.CoordinatedBolt)4 IdStreamSpec (backtype.storm.coordination.CoordinatedBolt.IdStreamSpec)4 SourceArgs (backtype.storm.coordination.CoordinatedBolt.SourceArgs)4 TestWordSpout (backtype.storm.testing.TestWordSpout)4 HashSet (java.util.HashSet)4 StormTopology (backtype.storm.generated.StormTopology)3 BaseWindowedBolt (backtype.storm.topology.base.BaseWindowedBolt)3 JStormUnitTestValidator (com.jstorm.example.unittests.utils.JStormUnitTestValidator)3