当前位置: 首页>>代码示例>>Java>>正文


Java LocalDRPC.shutdown方法代码示例

本文整理汇总了Java中backtype.storm.LocalDRPC.shutdown方法的典型用法代码示例。如果您正苦于以下问题:Java LocalDRPC.shutdown方法的具体用法?Java LocalDRPC.shutdown怎么用?Java LocalDRPC.shutdown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在backtype.storm.LocalDRPC的用法示例。


在下文中一共展示了LocalDRPC.shutdown方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import backtype.storm.LocalDRPC; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
  LinearDRPCTopologyBuilder builder = construct();


  Config conf = new Config();

  if (args == null || args.length == 0) {
    conf.setMaxTaskParallelism(3);
    LocalDRPC drpc = new LocalDRPC();
    LocalCluster cluster = new LocalCluster();
    cluster.submitTopology("reach-drpc", conf, builder.createLocalTopology(drpc));

    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.submitTopologyWithProgressBar(args[0], conf, builder.createRemoteTopology());
  }
}
 
开发者ID:desp0916,项目名称:LearnStorm,代码行数:26,代码来源:ReachTopology.java

示例2: main

import backtype.storm.LocalDRPC; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
  LinearDRPCTopologyBuilder builder = new LinearDRPCTopologyBuilder("exclamation");
  builder.addBolt(new ExclaimBolt(), 3);

  Config conf = new Config();

  if (args == null || args.length == 0) {
    LocalDRPC drpc = new LocalDRPC();
    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();
  }
  else {
    conf.setNumWorkers(3);
    StormSubmitter.submitTopologyWithProgressBar(args[0], conf, builder.createRemoteTopology());
  }
}
 
开发者ID:luozhaoyu,项目名称:big-data-system,代码行数:25,代码来源:BasicDRPCTopology.java

示例3: main

import backtype.storm.LocalDRPC; //导入方法依赖的package包/类
public static void main(String args[]) throws Exception {
	LinearDRPCTopologyBuilder builder = new LinearDRPCTopologyBuilder("exclamation");
	builder.addBolt(new ExclaimBolt(), 3);

	Config conf = new Config();

	if (args == null || args.length == 0) {
		LocalDRPC drpc = new LocalDRPC();
		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));
		}

		Thread.sleep(10000);
		drpc.shutdown();
		cluster.shutdown();
	} else {
		conf.setNumWorkers(3);
		StormSubmitter.submitTopologyWithProgressBar(args[0], conf, builder.createRemoteTopology());
	}
}
 
开发者ID:desp0916,项目名称:LearnStorm,代码行数:23,代码来源:DRPCTest.java

示例4: main

import backtype.storm.LocalDRPC; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
	LocalDRPC drpc = new LocalDRPC();

	Config conf = new Config();
	LocalCluster cluster = new LocalCluster();

	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();
}
 
开发者ID:desp0916,项目名称:LearnStorm,代码行数:18,代码来源:TridentReach.java

示例5: main

import backtype.storm.LocalDRPC; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
  LinearDRPCTopologyBuilder builder = new LinearDRPCTopologyBuilder("exclamation");
  builder.addBolt(new ExclaimBolt(), 3);

  Config conf = new Config();

  if (args == null || args.length == 0) {
    LocalDRPC drpc = new LocalDRPC();
    LocalCluster cluster = new LocalCluster();

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

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

    Thread.sleep(10000);
    drpc.shutdown();
    cluster.shutdown();
  }
  else {
    conf.setNumWorkers(3);
    StormSubmitter.submitTopologyWithProgressBar(args[0], conf, builder.createRemoteTopology());
  }
}
 
开发者ID:desp0916,项目名称:LearnStorm,代码行数:26,代码来源:BasicDRPCTopology.java

示例6: main

import backtype.storm.LocalDRPC; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
  LinearDRPCTopologyBuilder builder = construct();


  Config conf = new Config();

  if (args == null || args.length == 0) {
    conf.setMaxTaskParallelism(3);
    LocalDRPC drpc = new LocalDRPC();
    LocalCluster cluster = new LocalCluster();
    cluster.submitTopology("reach-drpc", conf, builder.createLocalTopology(drpc));

    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());
  }
}
 
开发者ID:metamx,项目名称:incubator-storm,代码行数:26,代码来源:ReachTopology.java

示例7: main

import backtype.storm.LocalDRPC; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
  LinearDRPCTopologyBuilder builder = new LinearDRPCTopologyBuilder("exclamation");
  builder.addBolt(new ExclaimBolt(), 3);

  Config conf = new Config();

  if (args == null || args.length == 0) {
    LocalDRPC drpc = new LocalDRPC();
    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();
  }
  else {
    conf.setNumWorkers(3);
    StormSubmitter.submitTopology(args[0], conf, builder.createRemoteTopology());
  }
}
 
开发者ID:metamx,项目名称:incubator-storm,代码行数:25,代码来源:BasicDRPCTopology.java

示例8: main

import backtype.storm.LocalDRPC; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
   Config config = new Config();
   config.setDebug(false);

LocalDRPC drpc = new LocalDRPC();
   LocalCluster cluster = new LocalCluster();
   cluster.submitTopology("internet-radio-play-stats", config, TopologyBuilder.buildLocal(drpc));

   Utils.sleep(ONE_MINUTE);

   String result = drpc.execute("count-request-by-tag", "Classic Rock,Punk,Post Punk");
   System.out.println("RESULTS");
   System.out.println("==========================================================================");
   System.out.println(result);
   System.out.println("==========================================================================");

   cluster.killTopology("internet-radio-play-stats");
   cluster.shutdown();
   drpc.shutdown();
 }
 
开发者ID:Storm-Applied,项目名称:C9-Internet-radio-play-stats,代码行数:21,代码来源:LocalTopologyRunner.java

示例9: main

import backtype.storm.LocalDRPC; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    LinearDRPCTopologyBuilder builder = construct();
    
    
    Config conf = new Config();
    
    if(args==null || args.length==0) {
        conf.setMaxTaskParallelism(3);
        LocalDRPC drpc = new LocalDRPC();
        LocalCluster cluster = new LocalCluster();
        cluster.submitTopology("reach-drpc", conf, builder.createLocalTopology(drpc));
        
        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());
    }
}
 
开发者ID:adarshms,项目名称:sentweet,代码行数:25,代码来源:ReachTopology.java

示例10: main

import backtype.storm.LocalDRPC; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    LinearDRPCTopologyBuilder builder = new LinearDRPCTopologyBuilder("exclamation");
    builder.addBolt(new ExclaimBolt(), 3);
    
    Config conf = new Config();
    
    if(args==null || args.length==0) {
        LocalDRPC drpc = new LocalDRPC();
        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();
    } else {
        conf.setNumWorkers(3);
        StormSubmitter.submitTopology(args[0], conf, builder.createRemoteTopology());
    }
}
 
开发者ID:adarshms,项目名称:sentweet,代码行数:25,代码来源:BasicDRPCTopology.java

示例11: testDrpc

import backtype.storm.LocalDRPC; //导入方法依赖的package包/类
public static void testDrpc() {
    TopologyBuilder builder = new TopologyBuilder();
    LocalDRPC drpc = new LocalDRPC();
    
    DRPCSpout spout = new DRPCSpout("exclamation", drpc);
    builder.setSpout("drpc", spout);
    builder.setBolt("exclaim", new ExclamationBolt(), 3).shuffleGrouping("drpc");
    builder.setBolt("return", new ReturnResults(), 3).shuffleGrouping("exclaim");
    
    LocalCluster cluster = new LocalCluster();
    Config conf = new Config();
    cluster.submitTopology("exclaim", conf, builder.createTopology());
    
    JStormUtils.sleepMs(30 * 1000);
    
    try {
        System.out.println(drpc.execute("exclamation", "aaa"));
        System.out.println(drpc.execute("exclamation", "bbb"));
    } catch (Exception e) {
        Assert.fail("Failed to test drpc");
    }
    
    drpc.shutdown();
    cluster.shutdown();
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:26,代码来源:ManualDRPC.java

示例12: main

import backtype.storm.LocalDRPC; //导入方法依赖的package包/类
public static void main(String... args) throws Exception {

        Config conf = new Config();
        conf.setMaxSpoutPending(20);

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

    }
 
开发者ID:xuzhikethinker,项目名称:t4f-data,代码行数:22,代码来源:TridentWordCount.java

示例13: main

import backtype.storm.LocalDRPC; //导入方法依赖的package包/类
public static void main(String... args) throws Exception {
    LocalDRPC drpc = new LocalDRPC();

    Config conf = new Config();
    LocalCluster cluster = new LocalCluster();

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

    Thread.sleep(2000);

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

    cluster.shutdown();
    drpc.shutdown();
}
 
开发者ID:xuzhikethinker,项目名称:t4f-data,代码行数:19,代码来源:TridentReach.java

示例14: main

import backtype.storm.LocalDRPC; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
	
    LinearDRPCTopologyBuilder builder = construct();
    
    
    Config conf = new Config();
    conf.setNumWorkers(6);
    if (args.length == 0) {
    	StormSubmitter.submitTopology(TOPOLOGY_NAME, conf, builder.createRemoteTopology());
    }else {
    
    
        conf.setMaxTaskParallelism(3);
        LocalDRPC drpc = new LocalDRPC();
        LocalCluster cluster = new LocalCluster();
        cluster.submitTopology(TOPOLOGY_NAME, conf, builder.createLocalTopology(drpc));
        
        JStormUtils.sleepMs(50000);
        
        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(TOPOLOGY_NAME, url));
        }
        
        cluster.shutdown();
        drpc.shutdown();
    }
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:29,代码来源:ReachTopology.java

示例15: main

import backtype.storm.LocalDRPC; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    final Config configuration = new Config();
    configuration.put(MapConfiguredCqlClientFactory.TRIDENT_CASSANDRA_CQL_HOSTS, "localhost");
    final LocalCluster cluster = new LocalCluster();
    LocalDRPC client = new LocalDRPC();

    LOG.info("Submitting topology.");
    cluster.submitTopology("cqlexample", configuration, buildWordCountAndSourceTopology(client));
    LOG.info("Topology submitted.");
    Thread.sleep(10000);
    LOG.info("DRPC Query: Word Count [cat, dog, the, man]: {}", client.execute("words", "cat dog the man"));
    cluster.shutdown();
    client.shutdown();
}
 
开发者ID:hpcc-systems,项目名称:storm-cassandra-cql,代码行数:15,代码来源:WordCountTopology.java


注:本文中的backtype.storm.LocalDRPC.shutdown方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。