Search in sources :

Example 1 with InOrderSpout

use of org.apache.storm.starter.InOrderDeliveryTest.InOrderSpout in project jstorm by alibaba.

the class TridentReach method test.

public static void test() {
    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("spout", new InOrderSpout(), 8);
    builder.setBolt("count", new Check(), 8).fieldsGrouping("spout", new Fields("c1"));
    conf.setMaxSpoutPending(20);
    String[] className = Thread.currentThread().getStackTrace()[1].getClassName().split("\\.");
    String topologyName = className[className.length - 1];
    if (isLocal) {
        drpc = new LocalDRPC();
    }
    try {
        JStormHelper.runTopology(buildTopology(drpc), topologyName, conf, 60, new DrpcValidator(), isLocal);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        Assert.fail("Failed");
    }
}
Also used : InOrderSpout(org.apache.storm.starter.InOrderDeliveryTest.InOrderSpout) Fields(backtype.storm.tuple.Fields) TopologyBuilder(backtype.storm.topology.TopologyBuilder) Check(org.apache.storm.starter.InOrderDeliveryTest.Check) LocalDRPC(backtype.storm.LocalDRPC)

Example 2 with InOrderSpout

use of org.apache.storm.starter.InOrderDeliveryTest.InOrderSpout in project jstorm by alibaba.

the class TridentMapExample method test.

public static void test() {
    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("spout", new InOrderSpout(), 8);
    builder.setBolt("count", new Check(), 8).fieldsGrouping("spout", new Fields("c1"));
    Config conf = new Config();
    conf.setMaxSpoutPending(20);
    String[] className = Thread.currentThread().getStackTrace()[1].getClassName().split("\\.");
    String topologyName = className[className.length - 1];
    if (isLocal) {
        drpc = new LocalDRPC();
    }
    try {
        JStormHelper.runTopology(buildTopology(drpc), topologyName, conf, 60, new DrpcValidator(), isLocal);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        Assert.fail("Failed");
    }
}
Also used : InOrderSpout(org.apache.storm.starter.InOrderDeliveryTest.InOrderSpout) Fields(backtype.storm.tuple.Fields) TopologyBuilder(backtype.storm.topology.TopologyBuilder) Config(backtype.storm.Config) Check(org.apache.storm.starter.InOrderDeliveryTest.Check) LocalDRPC(backtype.storm.LocalDRPC)

Example 3 with InOrderSpout

use of org.apache.storm.starter.InOrderDeliveryTest.InOrderSpout in project jstorm by alibaba.

the class TridentMinMaxOfDevicesTopology method test.

public static void test() {
    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("spout", new InOrderSpout(), 8);
    builder.setBolt("count", new Check(), 8).fieldsGrouping("spout", new Fields("c1"));
    conf.setMaxSpoutPending(20);
    String[] className = Thread.currentThread().getStackTrace()[1].getClassName().split("\\.");
    String topologyName = className[className.length - 1];
    if (isLocal) {
        drpc = new LocalDRPC();
    }
    try {
        JStormHelper.runTopology(buildDevicesTopology(), topologyName, conf, 60, new JStormHelper.CheckAckedFail(conf), isLocal);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        Assert.fail("Failed");
    }
}
Also used : InOrderSpout(org.apache.storm.starter.InOrderDeliveryTest.InOrderSpout) JStormHelper(com.alibaba.starter.utils.JStormHelper) Fields(backtype.storm.tuple.Fields) TopologyBuilder(backtype.storm.topology.TopologyBuilder) Check(org.apache.storm.starter.InOrderDeliveryTest.Check) LocalDRPC(backtype.storm.LocalDRPC)

Example 4 with InOrderSpout

use of org.apache.storm.starter.InOrderDeliveryTest.InOrderSpout in project jstorm by alibaba.

the class TridentMinMaxOfVehiclesTopology method test.

public static void test() {
    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("spout", new InOrderSpout(), 8);
    builder.setBolt("count", new Check(), 8).fieldsGrouping("spout", new Fields("c1"));
    conf.setMaxSpoutPending(20);
    String[] className = Thread.currentThread().getStackTrace()[1].getClassName().split("\\.");
    String topologyName = className[className.length - 1];
    if (isLocal) {
        drpc = new LocalDRPC();
    }
    try {
        JStormHelper.runTopology(buildVehiclesTopology(), topologyName, conf, 60, new JStormHelper.CheckAckedFail(conf), isLocal);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        Assert.fail("Failed");
    }
}
Also used : InOrderSpout(org.apache.storm.starter.InOrderDeliveryTest.InOrderSpout) JStormHelper(com.alibaba.starter.utils.JStormHelper) Fields(backtype.storm.tuple.Fields) TopologyBuilder(backtype.storm.topology.TopologyBuilder) Check(org.apache.storm.starter.InOrderDeliveryTest.Check) LocalDRPC(backtype.storm.LocalDRPC)

Aggregations

LocalDRPC (backtype.storm.LocalDRPC)4 TopologyBuilder (backtype.storm.topology.TopologyBuilder)4 Fields (backtype.storm.tuple.Fields)4 Check (org.apache.storm.starter.InOrderDeliveryTest.Check)4 InOrderSpout (org.apache.storm.starter.InOrderDeliveryTest.InOrderSpout)4 JStormHelper (com.alibaba.starter.utils.JStormHelper)2 Config (backtype.storm.Config)1