本文整理汇总了Java中org.apache.storm.utils.Utils.getString方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.getString方法的具体用法?Java Utils.getString怎么用?Java Utils.getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.storm.utils.Utils
的用法示例。
在下文中一共展示了Utils.getString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTopology
import org.apache.storm.utils.Utils; //导入方法依赖的package包/类
@Override
public StormTopology getTopology(Config config) {
final int spoutNum = BenchmarkUtils.getInt(config, SPOUT_NUM, DEFAULT_SPOUT_NUM);
final int spBoltNum = BenchmarkUtils.getInt(config, SPLIT_NUM, DEFAULT_SP_BOLT_NUM);
final int rcBoltNum = BenchmarkUtils.getInt(config, COUNTER_NUM, DEFAULT_RC_BOLT_NUM);
final int windowLength = BenchmarkUtils.getInt(config, WINDOW_LENGTH,
RollingBolt.DEFAULT_SLIDING_WINDOW_IN_SECONDS);
final int emitFreq = BenchmarkUtils.getInt(config, EMIT_FREQ,
RollingBolt.DEFAULT_EMIT_FREQUENCY_IN_SECONDS);
final String filename = Utils.getString(Utils.get(config, FILE_CONFIG, "/A_Tale_of_Two_City.txt"));
spout = new FileReadSpout(BenchmarkUtils.ifAckEnabled(config), filename);
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout(SPOUT_ID, spout, spoutNum);
builder.setBolt(SPLIT_ID, new WordCount.SplitSentence(), spBoltNum)
.localOrShuffleGrouping(SPOUT_ID);
builder.setBolt(COUNTER_ID, new PartialWindowCountBolt().withWindow(new Count(windowLength), new Count(emitFreq)), rcBoltNum).shuffleGrouping(SPLIT_ID);
builder.setBolt("aggregator", new MergeCountBolt().withWindow(new Count(windowLength), new Count(emitFreq)), 6).fieldsGrouping(COUNTER_ID, new Fields("obj","count", "timestamp"));
// builder.setBolt(COUNTER_ID, new RollingCountBolt(windowLength, emitFreq), rcBoltNum)
// .fieldsGrouping(SPLIT_ID, new Fields(WordCount.SplitSentence.FIELDS));
// builder.setBolt("file sink", new FileSink(), 3).localOrShuffleGrouping(COUNTER_ID);
return builder.createTopology();
}
示例2: getTopology
import org.apache.storm.utils.Utils; //导入方法依赖的package包/类
@Override
public StormTopology getTopology(Config config) {
final int spoutNum = BenchmarkUtils.getInt(config, SPOUT_NUM, DEFAULT_SPOUT_NUM);
final int spBoltNum = BenchmarkUtils.getInt(config, SPLIT_NUM, DEFAULT_SP_BOLT_NUM);
final int rcBoltNum = BenchmarkUtils.getInt(config, COUNTER_NUM, DEFAULT_RC_BOLT_NUM);
final int windowLength = BenchmarkUtils.getInt(config, WINDOW_LENGTH,
RollingBolt.DEFAULT_SLIDING_WINDOW_IN_SECONDS);
final int emitFreq = BenchmarkUtils.getInt(config, EMIT_FREQ,
RollingBolt.DEFAULT_EMIT_FREQUENCY_IN_SECONDS);
final String filename = Utils.getString(Utils.get(config, FILE_CONFIG, "/A_Tale_of_Two_City.txt"));
spout = new FileReadSpout(BenchmarkUtils.ifAckEnabled(config), filename);
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout(SPOUT_ID, spout, spoutNum);
builder.setBolt(SPLIT_ID, new WordCount.SplitSentence(), spBoltNum)
.localOrShuffleGrouping(SPOUT_ID);
builder.setBolt(COUNTER_ID, new WindowCountBolt().withWindow(new Count(windowLength), new Count(emitFreq)), rcBoltNum).fieldsGrouping(SPLIT_ID, new Fields(WordCount.SplitSentence.FIELDS));
// builder.setBolt(COUNTER_ID, new RollingCountBolt(windowLength, emitFreq), rcBoltNum)
// .fieldsGrouping(SPLIT_ID, new Fields(WordCount.SplitSentence.FIELDS));
// builder.setBolt("file sink", new FileSink(), 3).localOrShuffleGrouping(COUNTER_ID);
return builder.createTopology();
}
示例3: getTopology
import org.apache.storm.utils.Utils; //导入方法依赖的package包/类
@Override
public StormTopology getTopology(Config config) {
final int spoutNum = BenchmarkUtils.getInt(config, SPOUT_NUM, DEFAULT_SPOUT_NUM);
final int spBoltNum = BenchmarkUtils.getInt(config, SPLIT_NUM, DEFAULT_SP_BOLT_NUM);
final int rcBoltNum = BenchmarkUtils.getInt(config, COUNTER_NUM, DEFAULT_RC_BOLT_NUM);
final int windowLength = BenchmarkUtils.getInt(config, WINDOW_LENGTH,
RollingBolt.DEFAULT_SLIDING_WINDOW_IN_SECONDS);
final int emitFreq = BenchmarkUtils.getInt(config, EMIT_FREQ,
RollingBolt.DEFAULT_EMIT_FREQUENCY_IN_SECONDS);
final String filename = Utils.getString(Utils.get(config, FILE_CONFIG, "/A_Tale_of_Two_City.txt"));
spout = new FileReadSpout(BenchmarkUtils.ifAckEnabled(config), filename);
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout(SPOUT_ID, spout, spoutNum);
builder.setBolt(SPLIT_ID, new WordCount.SplitSentence(), spBoltNum)
.localOrShuffleGrouping(SPOUT_ID);
builder.setBolt(COUNTER_ID, new RollingCountBolt(windowLength, emitFreq), rcBoltNum)
.fieldsGrouping(SPLIT_ID, new Fields(WordCount.SplitSentence.FIELDS));
// builder.setBolt("file sink", new FileSink(), 3).localOrShuffleGrouping(COUNTER_ID);
return builder.createTopology();
}
示例4: getTopology
import org.apache.storm.utils.Utils; //导入方法依赖的package包/类
@Override
public StormTopology getTopology(Config config) {
final int spoutNum = BenchmarkUtils.getInt(config, SPOUT_NUM, DEFAULT_SPOUT_NUM);
final int spBoltNum = BenchmarkUtils.getInt(config, SPLIT_NUM, DEFAULT_SP_BOLT_NUM);
final int rcBoltNum = BenchmarkUtils.getInt(config, COUNTER_NUM, DEFAULT_RC_BOLT_NUM);
final int windowLength = BenchmarkUtils.getInt(config, WINDOW_LENGTH,
RollingBolt.DEFAULT_SLIDING_WINDOW_IN_SECONDS);
final int emitFreq = BenchmarkUtils.getInt(config, EMIT_FREQ,
RollingBolt.DEFAULT_EMIT_FREQUENCY_IN_SECONDS);
final String filename = Utils.getString(Utils.get(config, FILE_CONFIG, "/A_Tale_of_Two_City.txt"));
spout = new FileReadSpout(BenchmarkUtils.ifAckEnabled(config), filename);
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout(SPOUT_ID, spout, spoutNum);
builder.setBolt(SPLIT_ID, new WordCount.SplitSentence(), spBoltNum)
.localOrShuffleGrouping(SPOUT_ID);
builder.setBolt(COUNTER_ID, new WordCount.Count(), rcBoltNum).fieldsGrouping(SPLIT_ID, new Fields(WordCount.SplitSentence.FIELDS));
// builder.setBolt(COUNTER_ID, new RollingCountBolt(windowLength, emitFreq), rcBoltNum)
// .fieldsGrouping(SPLIT_ID, new Fields(WordCount.SplitSentence.FIELDS));
// builder.setBolt("file sink", new FileSink(), 3).localOrShuffleGrouping(COUNTER_ID);
return builder.createTopology();
}
示例5: getTopology
import org.apache.storm.utils.Utils; //导入方法依赖的package包/类
@Override
public StormTopology getTopology(Config config) {
final int spoutNum = BenchmarkUtils.getInt(config, SPOUT_NUM, DEFAULT_SPOUT_NUM);
final int joinBoltNum = BenchmarkUtils.getInt(config, JOIN_NUM, DEFAULT_JOIN_BOLT_NUM);
final int windowLength = BenchmarkUtils.getInt(config, WINDOW_LENGTH,DEFAULT_SLIDING_WINDOW_IN_SECONDS);
final String adFile = Utils.getString(Utils.get(config, AD_FILE, "/ads"));
final String webFile = Utils.getString(Utils.get(config, WEB_FILE, "/web"));
final int spBoltNum = BenchmarkUtils.getInt(config, SPLIT_NUM, DEFAULT_JOIN_BOLT_NUM);
adspout = new FileSpout(BenchmarkUtils.ifAckEnabled(config), adFile);
webspout = new FileSpout(BenchmarkUtils.ifAckEnabled(config), webFile);
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout(AD_SPOUT_ID, adspout, spoutNum);
builder.setSpout(WEB_SPOUT_ID, webspout, spoutNum);
builder.setBolt("ad_split",new SplitBolt("user_id","ad_id"),spBoltNum).localOrShuffleGrouping(AD_SPOUT_ID);
builder.setBolt("web_split",new SplitBolt("user_id","web_id"),spBoltNum).localOrShuffleGrouping(WEB_SPOUT_ID);
builder.setBolt(JOIN_ID, new JoinBolt().withTumblingWindow(new Count(windowLength)), joinBoltNum).fieldsGrouping("ad_split", new Fields("user_id"))
.fieldsGrouping("web_split", new Fields("user_id"));
return builder.createTopology();
}
示例6: getTopology
import org.apache.storm.utils.Utils; //导入方法依赖的package包/类
@Override
public StormTopology getTopology(Config config) {
final int spoutNum = BenchmarkUtils.getInt(config, SPOUT_NUM, DEFAULT_SPOUT_NUM);
final int spBoltNum = BenchmarkUtils.getInt(config, SPLIT_NUM, DEFAULT_SP_BOLT_NUM);
final int rcBoltNum = BenchmarkUtils.getInt(config, COUNTER_NUM, DEFAULT_RC_BOLT_NUM);
final int windowLength = BenchmarkUtils.getInt(config, WINDOW_LENGTH,
RollingBolt.DEFAULT_SLIDING_WINDOW_IN_SECONDS);
final int emitFreq = BenchmarkUtils.getInt(config, EMIT_FREQ,
RollingBolt.DEFAULT_EMIT_FREQUENCY_IN_SECONDS);
final String filename = Utils.getString(Utils.get(config, FILE_CONFIG, "/A_Tale_of_Two_City.txt"));
spout = new FileReadSpout(BenchmarkUtils.ifAckEnabled(config), filename);
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout(SPOUT_ID, spout, spoutNum);
builder.setBolt(SPLIT_ID, new WordCount.SplitSentence(), spBoltNum)
.localOrShuffleGrouping(SPOUT_ID);
builder.setBolt(COUNTER_ID, new WordCount.Count(), rcBoltNum).shuffleGrouping(SPLIT_ID);
builder.setBolt("aggregator", new WordCount.ACount(), 1).fieldsGrouping(COUNTER_ID, new Fields(WordCount.SplitSentence.FIELDS));
// builder.setBolt(COUNTER_ID, new RollingCountBolt(windowLength, emitFreq), rcBoltNum)
// .fieldsGrouping(SPLIT_ID, new Fields(WordCount.SplitSentence.FIELDS));
// builder.setBolt("file sink", new FileSink(), 3).localOrShuffleGrouping(COUNTER_ID);
return builder.createTopology();
}
示例7: getTopology
import org.apache.storm.utils.Utils; //导入方法依赖的package包/类
@Override
public StormTopology getTopology(Config config) {
final int spoutNum = BenchmarkUtils.getInt(config, SPOUT_NUM, DEFAULT_SPOUT_NUM);
final int rankBoltNum = BenchmarkUtils.getInt(config, RANK_NUM, DEFAULT_SP_BOLT_NUM);
final int rcBoltNum = BenchmarkUtils.getInt(config, COUNTER_NUM, DEFAULT_RC_BOLT_NUM);
final int windowLength = BenchmarkUtils.getInt(config, WINDOW_LENGTH,
RollingBolt.DEFAULT_SLIDING_WINDOW_IN_SECONDS);
final int emitFreq = BenchmarkUtils.getInt(config, EMIT_FREQ,
RollingBolt.DEFAULT_EMIT_FREQUENCY_IN_SECONDS);
final int spBoltNum = BenchmarkUtils.getInt(config, SPLIT_NUM, DEFAULT_SP_BOLT_NUM);
final String filename = Utils.getString(Utils.get(config, FILE_CONFIG, "/A_Tale_of_Two_City.txt"));
spout = new FileReadSpout(BenchmarkUtils.ifAckEnabled(config), filename);
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout(SPOUT_ID, spout, spoutNum);
// builder.setBolt("file sink", new FileSink(), 3).localOrShuffleGrouping(COUNTER_ID);
builder.setBolt(SPLIT_ID, new WordCount.SplitSentence(), spBoltNum)
.localOrShuffleGrouping(SPOUT_ID);
builder.setBolt(COUNTER_ID, new RollingCountObjects(60, 10), rcBoltNum).fieldsGrouping(
SPLIT_ID,new Fields(WordCount.SplitSentence.FIELDS)); //RollingCountObjects
builder.setBolt(RANK_ID, new RankBolt(3), rankBoltNum).fieldsGrouping(COUNTER_ID,
new Fields("obj")); //RankBolt(TOP_N)
builder.setBolt("Merge", new MergeObjectsBolt(3)).globalGrouping(RANK_ID); // MergeObjectsBolt(TOP_N)
return builder.createTopology();
}
示例8: getTopology
import org.apache.storm.utils.Utils; //导入方法依赖的package包/类
@Override
public StormTopology getTopology(Config config) {
final int spoutNum = BenchmarkUtils.getInt(config, SPOUT_NUM, DEFAULT_SPOUT_NUM);
final int stemBoltNum = BenchmarkUtils.getInt(config, STEM_NUM, DEFAULT_SP_BOLT_NUM);
final int posBoltNum = BenchmarkUtils.getInt(config, POSITIVE_NUM, DEFAULT_RC_BOLT_NUM);
final int negBoltNum = BenchmarkUtils.getInt(config, NEGATIVE_NUM, DEFAULT_RC_BOLT_NUM);
final int scoreBoltNum = BenchmarkUtils.getInt(config, SCORE_NUM, DEFAULT_RC_BOLT_NUM);
final int logBoltNum = BenchmarkUtils.getInt(config, "component.logging_bolt_num", DEFAULT_RC_BOLT_NUM);
final int windowLength = BenchmarkUtils.getInt(config, WINDOW_LENGTH,
RollingBolt.DEFAULT_SLIDING_WINDOW_IN_SECONDS);
final int emitFreq = BenchmarkUtils.getInt(config, EMIT_FREQ,
RollingBolt.DEFAULT_EMIT_FREQUENCY_IN_SECONDS);
final String filename = Utils.getString(Utils.get(config, FILE_CONFIG, "/A_Tale_of_Two_City.txt"));
spout = new FileReadSpout(BenchmarkUtils.ifAckEnabled(config), filename);
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout(SPOUT_ID, spout, spoutNum);
// builder.setBolt("file sink", new FileSink(), 3).localOrShuffleGrouping(COUNTER_ID);
builder.setBolt(STEM_ID, new StemmingBolt(), stemBoltNum)
.localOrShuffleGrouping(SPOUT_ID);
builder.setBolt(POSITIVE_ID, new PositiveBolt(), posBoltNum).localOrShuffleGrouping(STEM_ID); //RollingCountObjects
builder.setBolt(NEGATIVE_ID, new NegativeBolt(), negBoltNum).localOrShuffleGrouping(POSITIVE_ID);
builder.setBolt(SCORE_ID, new ScoreBolt(), scoreBoltNum).localOrShuffleGrouping(NEGATIVE_ID);
builder.setBolt("logging", new LoggingBolt().withFields(Cons.TUPLE_VAR_MSG, Cons.TUPLE_VAR_SCORE), logBoltNum)
.localOrShuffleGrouping(SCORE_ID);
return builder.createTopology();
}