本文整理汇总了Java中org.apache.storm.Config.setDebug方法的典型用法代码示例。如果您正苦于以下问题:Java Config.setDebug方法的具体用法?Java Config.setDebug怎么用?Java Config.setDebug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.storm.Config
的用法示例。
在下文中一共展示了Config.setDebug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import org.apache.storm.Config; //导入方法依赖的package包/类
private void start(StormTopology topology, boolean runAsLocal) throws Exception {
Config conf = new Config();
conf.put(Constants.StormConfigKey.FULL_SPLITTER_TOPOLOGY_ID, fullSplitterTopologyId);
conf.put(Constants.StormConfigKey.FULL_PULLER_TOPOLOGY_ID, fullPullerTopologyId);
conf.put(Constants.StormConfigKey.ZKCONNECT, this.zkConnect);
conf.setMessageTimeoutSecs(3600);
conf.setMaxSpoutPending(30);
conf.setDebug(true);
conf.setNumWorkers(1);
if (runAsLocal) {
conf.setMaxTaskParallelism(3);
LocalCluster cluster = new LocalCluster();
cluster.submitTopology(topologyName, conf, topology);
} else {
StormSubmitter.submitTopology(topologyName, conf, topology);
}
}
示例2: main
import org.apache.storm.Config; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout("integer", new RandomIntegerSpout(), 1);
builder.setBolt("slidingsum", new SlidingWindowSumBolt().withWindow(new Count(30), new Count(10)), 1)
.shuffleGrouping("integer");
builder.setBolt("tumblingavg", new TumblingWindowAvgBolt().withTumblingWindow(new Count(3)), 1)
.shuffleGrouping("slidingsum");
builder.setBolt("printer", new PrinterBolt(), 1).shuffleGrouping("tumblingavg");
Config conf = new Config();
conf.setDebug(true);
if (args != null && args.length > 0) {
conf.setNumWorkers(1);
StormSubmitter.submitTopologyWithProgressBar(args[0], conf, builder.createTopology());
} else {
LocalCluster cluster = new LocalCluster();
cluster.submitTopology("test", conf, builder.createTopology());
Utils.sleep(40000);
cluster.killTopology("test");
cluster.shutdown();
}
}
示例3: main
import org.apache.storm.Config; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout("word", new WordSpout(), 1);
builder.setBolt("exclaim", new ExclamationBolt(), 1).shuffleGrouping("word"); // Tuple流向:word 》 exclaim
builder.setBolt("print", new PrintBolt(), 1).shuffleGrouping("exclaim"); // exclaim 》 print
Config conf = new Config();
conf.setDebug(true);
if (args != null && args.length > 0) {
conf.setNumWorkers(3);
StormSubmitter.submitTopologyWithProgressBar(args[0], conf, builder.createTopology());
} else {
LocalCluster cluster = new LocalCluster(); // storm依赖,<scope>provided</scope>--> 本地开发是注释掉 -->
cluster.submitTopology("test3", conf, builder.createTopology());
Utils.sleep(60 * 1000);
cluster.killTopology("test3");
cluster.shutdown();
}
}
示例4: submitTopology
import org.apache.storm.Config; //导入方法依赖的package包/类
private LocalCluster submitTopology() throws AlreadyAliveException,
InvalidTopologyException {
Config stormConfig = new Config();
stormConfig.setDebug(false);
stormConfig.setFallBackOnJavaSerialization(true);
stormConfig.setNumWorkers(1);
// enable backpressure since the spouts can move at a much faster speed than the bolts
stormConfig.put(Config.TOPOLOGY_BACKPRESSURE_ENABLE, true);
stormConfig.put(Config.TOPOLOGY_EXECUTOR_RECEIVE_BUFFER_SIZE, 2048);
stormConfig.put(Config.TOPOLOGY_EXECUTOR_SEND_BUFFER_SIZE, 2048);
stormConfig.put(Config.TOPOLOGY_SLEEP_SPOUT_WAIT_STRATEGY_TIME_MS, 1000);
stormConfig.put(Config.TOPOLOGY_MAX_SPOUT_PENDING, 10);
stormConfig.setSkipMissingKryoRegistrations(true);
stormConfig.put(ConfigurationConstants.CHATALYTICS_CONFIG.txt,
YamlUtils.writeYaml(chatalyticsConfig));
LocalCluster cluster = new LocalCluster();
cluster.submitTopology(TOPOLOGY_NAME, stormConfig, chatTopology);
return cluster;
}
示例5: getConfig
import org.apache.storm.Config; //导入方法依赖的package包/类
protected Config getConfig(String[] SETTINGS) {
Config config = new Config();
// config.put("mongodb.ip", args[2]);
// config.put("mongodb.port", Integer.parseInt(args[3]));
// config.put("redis.ip", args[4]);
// config.put("redis.port", Integer.parseInt(args[5]));
// config.put("kafka.properties", args[6]);
config.put("mongodb.ip", SETTINGS[0]);
config.put("mongodb.port", Integer.parseInt(SETTINGS[1]));
config.put("redis.ip", SETTINGS[2]);
config.put("redis.port", Integer.parseInt(SETTINGS[3]));
config.put("kafka.properties", SETTINGS[4]);
config.setDebug(true);
config.setNumWorkers(2);
return config;
}
示例6: getConfig
import org.apache.storm.Config; //导入方法依赖的package包/类
protected Config getConfig(String[] SETTINGS) {
Config config = new Config();
// config.put("mongodb.ip", args[2]);
// config.put("mongodb.port", Integer.parseInt(args[3]));
// config.put("redis.ip", args[4]);
// config.put("redis.port", Integer.parseInt(args[5]));
// config.put("kafka.properties", args[6]);
config.put("mongodb.ip", SETTINGS[0]);
config.put("mongodb.port", Integer.parseInt(SETTINGS[1]));
config.put("redis.ip", SETTINGS[2]);
config.put("redis.port", Integer.parseInt(SETTINGS[3]));
config.put("kafka.properties", SETTINGS[4]);
config.setDebug(true);
config.setNumWorkers(4);
return config;
}
示例7: run
import org.apache.storm.Config; //导入方法依赖的package包/类
public static int run(String[] args) throws Exception {
CommandLineParser parser = new BasicParser();
Options options = getCommonRequiredOptions();
CommandLine cmd = parser.parse( options, args);
Map<String, String> dsConf = getAccumuloDataStoreConf(cmd);
String featureName = cmd.getOptionValue(FEATURE_NAME);
SimpleFeatureType featureType = DataUtilities.createType(featureName, "geom:Point:srid=4326");
DataStore ds = DataStoreFinder.getDataStore(dsConf);
ds.createSchema(featureType);
TopologyBuilder topologyBuilder = new TopologyBuilder();
String topic = cmd.getOptionValue(TOPIC);
String groupId = topic;
dsConf.put(OSMIngest.FEATURE_NAME, featureName);
OSMKafkaSpout OSMKafkaSpout = new OSMKafkaSpout(dsConf, groupId, topic);
topologyBuilder.setSpout("Spout", OSMKafkaSpout, 10).setNumTasks(10);
OSMKafkaBolt OSMKafkaBolt = new OSMKafkaBolt(dsConf, groupId, topic);
topologyBuilder.setBolt("Bolt", OSMKafkaBolt, 20).shuffleGrouping("Spout");
Config stormConf = new Config();
stormConf.setNumWorkers(10);
stormConf.setDebug(true);
StormSubmitter.submitTopology(topic, stormConf, topologyBuilder.createTopology());
return 0;
}
示例8: buildAndSubmit
import org.apache.storm.Config; //导入方法依赖的package包/类
public void buildAndSubmit() throws Exception {
TopologyBuilder builder = new TopologyBuilder();
Config config = new Config();
config.setDebug(true);
// String nimbusHost = topologyConfig.getProperty("nimbus.host");
config.put(Config.NIMBUS_HOST, "localhost");
configureKafkaSpout(builder);
//configureRouteBolt(builder);
configurePhoenixTest(builder);
/*
builder.setBolt("submitter", new SubmitBolt())
.shuffleGrouping(ROUTE_BOLT);
*/
try {
StormSubmitter.submitTopology("simple-topology", config, builder.createTopology());
} catch (Exception e) {
LOG.error("Error submiting Topology", e);
}
}
示例9: buildAndSubmit
import org.apache.storm.Config; //导入方法依赖的package包/类
public void buildAndSubmit() throws Exception {
TopologyBuilder builder = new TopologyBuilder();
Config config = new Config();
config.setDebug(true);
// String nimbusHost = topologyConfig.getProperty("nimbus.host");
config.put(Config.NIMBUS_HOST, "localhost");
configureKafkaSpout(builder);
configureRouteBolt(builder);
configureInsertBolt(builder);
//builder.setBolt("submitter", new SubmitBolt())
// .shuffleGrouping(ROUTE_BOLT);
try {
StormSubmitter.submitTopology("realestate-topology", config, builder.createTopology());
} catch (Exception e) {
LOG.error("Error submiting Topology", e);
}
}
示例10: main
import org.apache.storm.Config; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
StormTopology topology = buildTopology();
Config conf = new Config();
conf.setDebug(false);
if (args != null && args.length > 0) {
conf.setNumWorkers(3);
StormSubmitter.submitTopologyWithProgressBar(args[0], conf, topology);
} else {
LocalCluster cluster = new LocalCluster();
cluster.submitTopology("wordcount", conf, topology);
try {
System.out.println("PRESS ENTER TO STOP");
new BufferedReader(new InputStreamReader(System.in)).readLine();
cluster.killTopology("wordcount");
cluster.shutdown();
} catch (IOException e) {
e.printStackTrace();
}
}
}
示例11: run
import org.apache.storm.Config; //导入方法依赖的package包/类
private static void run(String name)
throws ClassNotFoundException, IllegalAccessException,
InstantiationException, AlreadyAliveException, InvalidTopologyException {
LOG.info("running benchmark " + name);
IBenchmark benchmark = (IBenchmark) Runner.getApplicationFromName(PACKAGE + "." + name);
Config config = new Config();
config.putAll(Utils.readStormConfig());
config.setDebug(true);
StormTopology topology = benchmark.getTopology(config);
LocalCluster localCluster = new LocalCluster();
localCluster.submitTopology(name, config, topology);
final int runtime = BenchmarkUtils.getInt(config, MetricsCollectorConfig.METRICS_TOTAL_TIME,
MetricsCollectorConfig.DEFAULT_TOTAL_TIME);
IMetricsCollector collector = benchmark.getMetricsCollector(config, topology);
collector.run();
try {
Thread.sleep(runtime);
} catch (InterruptedException e) {
LOG.error("benchmark interrupted", e);
}
localCluster.shutdown();
}
示例12: main
import org.apache.storm.Config; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout("integer", new RandomIntegerSpout(), 1);
builder.setBolt("slidingsum", new SlidingWindowSumBolt()
.withWindow(BaseWindowedBolt.Count.of(30), BaseWindowedBolt.Count.of(10)), 1)
.shuffleGrouping("integer");
builder.setBolt("tumblingavg", new TumblingWindowAvgBolt()
.withTumblingWindow(BaseWindowedBolt.Count.of(3)), 1)
.shuffleGrouping("slidingsum");
builder.setBolt("printer", new PrinterBolt(), 1)
.shuffleGrouping("tumblingavg");
Config conf = new Config();
conf.setDebug(true);
String topoName = "test";
if (args != null && args.length > 0) {
topoName = args[0];
}
StormSubmitter.submitTopology(topoName, conf, builder.createTopology());
}
示例13: main
import org.apache.storm.Config; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout("spout", new RandomIntegerSpout());
builder.setBolt("partialsum", new StatefulSumBolt("partial"), 1).shuffleGrouping("spout");
builder.setBolt("printer", new PrinterBolt(), 2).shuffleGrouping("partialsum");
builder.setBolt("total", new StatefulSumBolt("total"), 1).shuffleGrouping("printer");
Config conf = new Config();
conf.setDebug(false);
if (args != null && args.length > 0) {
conf.setNumWorkers(1);
StormSubmitter.submitTopologyWithProgressBar(args[0], conf, builder.createTopology());
} else {
LocalCluster cluster = new LocalCluster();
StormTopology topology = builder.createTopology();
cluster.submitTopology("test", conf, topology);
Utils.sleep(40000);
cluster.killTopology("test");
cluster.shutdown();
}
}
示例14: main
import org.apache.storm.Config; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout("spout", new RandomIntegerSpout());
builder.setBolt("sumbolt", new WindowSumBolt().withWindow(new Count(5), new Count(3))
.withMessageIdField("msgid"), 1).shuffleGrouping("spout");
builder.setBolt("printer", new PrinterBolt(), 1).shuffleGrouping("sumbolt");
Config conf = new Config();
conf.setDebug(false);
//conf.put(Config.TOPOLOGY_STATE_PROVIDER, "org.apache.storm.redis.state.RedisKeyValueStateProvider");
if (args != null && args.length > 0) {
conf.setNumWorkers(1);
StormSubmitter.submitTopologyWithProgressBar(args[0], conf, builder.createTopology());
} else {
LocalCluster cluster = new LocalCluster();
StormTopology topology = builder.createTopology();
cluster.submitTopology("test", conf, topology);
Utils.sleep(40000);
cluster.killTopology("test");
cluster.shutdown();
}
}
示例15: main
import org.apache.storm.Config; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout("word0", new TestWordSpout(), 2);
builder.setSpout("word1", new TestWordSpout(), 2);
builder.setSpout("word2", new TestWordSpout(), 2);
builder.setBolt("exclaim1", new ExclamationBolt(), 2)
.shuffleGrouping("word0")
.shuffleGrouping("word1")
.shuffleGrouping("word2");
Config conf = new Config();
conf.setDebug(true);
conf.setMaxSpoutPending(10);
conf.put(Config.TOPOLOGY_WORKER_CHILDOPTS, "-XX:+HeapDumpOnOutOfMemoryError");
if (args != null && args.length > 0) {
conf.setNumWorkers(3);
StormSubmitter.submitTopology(args[0], conf, builder.createTopology());
} else {
LocalCluster cluster = new LocalCluster();
cluster.submitTopology("test", conf, builder.createTopology());
Utils.sleep(10000);
cluster.killTopology("test");
cluster.shutdown();
}
}