Package backtype.storm

Examples of backtype.storm.LocalDRPC.execute()


            Thread.sleep(10000);


            assertEquals("[[5]]", client.execute("words", "cat dog the man")); // 5
            assertEquals("[[0]]", client.execute("words", "cat")); // 0
            assertEquals("[[0]]", client.execute("words", "dog")); // 0
            assertEquals("[[4]]", client.execute("words", "the")); // 4
            assertEquals("[[1]]", client.execute("words", "man")); // 1
           

View Full Code Here



            assertEquals("[[5]]", client.execute("words", "cat dog the man")); // 5
            assertEquals("[[0]]", client.execute("words", "cat")); // 0
            assertEquals("[[0]]", client.execute("words", "dog")); // 0
            assertEquals("[[4]]", client.execute("words", "the")); // 4
            assertEquals("[[1]]", client.execute("words", "man")); // 1
           


        cluster.shutdown();
View Full Code Here

            assertEquals("[[5]]", client.execute("words", "cat dog the man")); // 5
            assertEquals("[[0]]", client.execute("words", "cat")); // 0
            assertEquals("[[0]]", client.execute("words", "dog")); // 0
            assertEquals("[[4]]", client.execute("words", "the")); // 4
            assertEquals("[[1]]", client.execute("words", "man")); // 1
           


        cluster.shutdown();
        client.shutdown();
View Full Code Here

      LocalCluster cluster = new LocalCluster();

      cluster.submitTopology("drpc-demo", conf, builder.createLocalTopology(drpc));

      for (String word : new String[]{ "hello", "goodbye" }) {
        System.out.println("Result for \"" + word + "\": " + drpc.execute("exclamation", word));
      }

      cluster.shutdown();
      drpc.shutdown();
    }
View Full Code Here

    if (args.length == 0) {
      LocalDRPC drpc = new LocalDRPC();
      LocalCluster cluster = new LocalCluster();
      cluster.submitTopology("wordCounter", conf, buildTopology(drpc));
      for (int i = 0; i < 100; i++) {
        System.out.println("DRPC RESULT: " + drpc.execute("words", "cat the dog jumped"));
        Thread.sleep(1000);
      }
    }
    else {
      conf.setNumWorkers(3);
View Full Code Here

    cluster.submitTopology("reach", conf, buildTopology(drpc));

    Thread.sleep(2000);

    System.out.println("REACH: " + drpc.execute("reach", "aaa"));
    System.out.println("REACH: " + drpc.execute("reach", "foo.com/blog/1"));
    System.out.println("REACH: " + drpc.execute("reach", "engineering.twitter.com/blog/5"));


    cluster.shutdown();
View Full Code Here

    cluster.submitTopology("reach", conf, buildTopology(drpc));

    Thread.sleep(2000);

    System.out.println("REACH: " + drpc.execute("reach", "aaa"));
    System.out.println("REACH: " + drpc.execute("reach", "foo.com/blog/1"));
    System.out.println("REACH: " + drpc.execute("reach", "engineering.twitter.com/blog/5"));


    cluster.shutdown();
    drpc.shutdown();
View Full Code Here

    Thread.sleep(2000);

    System.out.println("REACH: " + drpc.execute("reach", "aaa"));
    System.out.println("REACH: " + drpc.execute("reach", "foo.com/blog/1"));
    System.out.println("REACH: " + drpc.execute("reach", "engineering.twitter.com/blog/5"));


    cluster.shutdown();
    drpc.shutdown();
  }
View Full Code Here

    LocalCluster cluster = new LocalCluster();
    Config conf = new Config();
    cluster.submitTopology("exclaim", conf, builder.createTopology());

    System.out.println(drpc.execute("exclamation", "aaa"));
    System.out.println(drpc.execute("exclamation", "bbb"));

  }
}
View Full Code Here

    LocalCluster cluster = new LocalCluster();
    Config conf = new Config();
    cluster.submitTopology("exclaim", conf, builder.createTopology());

    System.out.println(drpc.execute("exclamation", "aaa"));
    System.out.println(drpc.execute("exclamation", "bbb"));

  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.