Package backtype.storm

Examples of backtype.storm.LocalCluster.shutdown()


      test(true, "Windows 8 is fun to use. I like it better then mac lion.", localDRPC);
      test(true, "Good morning loves 😁😁 apple jacks doe http://t.co/nOfi42enoQ", localDRPC);
      test(true, "@Saad_khan33 No i prefer apple anyday", localDRPC);

    } finally {
      cluster.shutdown();
      localDRPC.shutdown();
    }
  }

  protected static void test(boolean expected, String text, LocalDRPC localDRPC) {
View Full Code Here


        Integer prediction = extractPrediction(localDRPC.execute("classify", ReutersBatchSpout.REUTEURS_EVAL_SAMPLES.get(realClass)));
        assertEquals(realClass, prediction);
      }

    } finally {
      cluster.shutdown();
      localDRPC.shutdown();
    }
  }

  protected static Integer extractPrediction(String drpcResult) {
View Full Code Here

      Integer result31 = extractPrediction(localDRPC.execute("predict", "1.0 -1.0 -1.0"));
      Integer result32 = extractPrediction(localDRPC.execute("predict", "0.8 -1.1 -0.9"));
      assertEquals(result31, result32);
    } finally {
      cluster.shutdown();
      localDRPC.shutdown();
    }
  }

  protected static Integer extractPrediction(String drpcResult) {
View Full Code Here

      Double evaluation = extractEvaluation(localDRPC.execute("evaluate", ""));
      assertTrue(evaluation > 0.9);
      assertTrue(evaluation < 1);
    } finally {
      cluster.shutdown();
      localDRPC.shutdown();
    }
  }

  protected static Boolean extractPrediction(String drpcResult) {
View Full Code Here

      assertEquals(0.0, mean0, 0.1);
      assertEquals(0.0, mean1, 0.1);
      assertEquals(1.0, variance0, 0.1);
      assertEquals(1.0, variance1, 0.1);
    } finally {
      cluster.shutdown();
      localDRPC.shutdown();
    }
  }

  @SuppressWarnings({ "unchecked", "rawtypes" })
View Full Code Here

      assertEquals(Boolean.TRUE, extractPrediction(localDRPC.execute("predict", "1.0 0.0 0.0")));
      assertEquals(Boolean.TRUE, extractPrediction(localDRPC.execute("predict", "1.0 0.0 1.0")));
      assertEquals(Boolean.TRUE, extractPrediction(localDRPC.execute("predict", "1.0 1.0 0.0")));
      assertEquals(Boolean.FALSE, extractPrediction(localDRPC.execute("predict", "1.0 1.0 1.0")));
    } finally {
      cluster.shutdown();
      localDRPC.shutdown();
    }
  }

  protected static Boolean extractPrediction(String drpcResult) {
View Full Code Here

      Config conf = new Config();
      conf.setDebug(true);
      LocalCluster cluster = new LocalCluster();
      cluster.submitTopology("rdbms-workflow", conf, builder.createTopology());
      Utils.sleep(10000);
      cluster.shutdown();
    }
  }
View Full Code Here

       
            LocalCluster cluster = new LocalCluster();
            cluster.submitTopology("test", conf, builder.createTopology());
            Utils.sleep(10000);
            cluster.killTopology("test");
            cluster.shutdown();   
        }
    }
}
View Full Code Here

            String[] urlsToTry = new String[] { "foo.com/blog/1", "engineering.twitter.com/blog/5", "notaurl.com"};
            for(String url: urlsToTry) {
                System.out.println("Reach of " + url + ": " + drpc.execute("reach", url));
            }
           
            cluster.shutdown();
            drpc.shutdown();
        } else {
            conf.setNumWorkers(6);
            StormSubmitter.submitTopology(args[0], conf, builder.createRemoteTopology());
        }
View Full Code Here

            for(String word: new String[] {"hello", "goodbye"}) {
                System.out.println("Result for \"" + word + "\": "
                        + drpc.execute("exclamation", word));
            }
           
            cluster.shutdown();
            drpc.shutdown();
        } else {
            conf.setNumWorkers(3);
            StormSubmitter.submitTopology(args[0], conf, builder.createRemoteTopology());
        }
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.