本文整理汇总了Java中backtype.storm.topology.SpoutDeclarer类的典型用法代码示例。如果您正苦于以下问题:Java SpoutDeclarer类的具体用法?Java SpoutDeclarer怎么用?Java SpoutDeclarer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpoutDeclarer类属于backtype.storm.topology包,在下文中一共展示了SpoutDeclarer类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setSpout
import backtype.storm.topology.SpoutDeclarer; //导入依赖的package包/类
@Override
public SpoutDeclarer setSpout(String id, IRichSpout spout, Number parallelismHint) {
if(this.meassureThroughput) {
spout = new ThroughputSpout(spout, this.reportingInterval);
}
if(this.meassureLatency) {
spout = new LatencySpout(spout);
}
SpoutDeclarer declarer = super.setSpout(id, spout, parallelismHint);
if(this.meassureThroughput) {
this.callSuper = true;
setBolt(id + "Stats", new FileFlushSinkBolt(DEFAULT_STATS_DIR + File.separator + id + ".throughput"))
.shuffleGrouping(id, MonitoringTopoloyBuilder.DEFAULT_THROUGHPUT_STREAM);
this.callSuper = false;
}
return declarer;
}
示例2: setBatchPerTupleSpout
import backtype.storm.topology.SpoutDeclarer; //导入依赖的package包/类
public SpoutDeclarer setBatchPerTupleSpout(String id, String streamName, IRichSpout spout, Integer parallelism, String batchGroup) {
Map<String, String> batchGroups = new HashMap();
batchGroups.put(streamName, batchGroup);
markBatchGroups(id, batchGroups);
SpoutComponent c = new SpoutComponent(spout, streamName, parallelism, batchGroup);
_batchPerTupleSpouts.put(id, c);
return new SpoutDeclarerImpl(c);
}
示例3: setSpout
import backtype.storm.topology.SpoutDeclarer; //导入依赖的package包/类
public SpoutDeclarer setSpout(String id, String streamName, String txStateId, ITridentSpout spout, Integer parallelism, String batchGroup) {
Map<String, String> batchGroups = new HashMap();
batchGroups.put(streamName, batchGroup);
markBatchGroups(id, batchGroups);
TransactionalSpoutComponent c = new TransactionalSpoutComponent(spout, streamName, parallelism, txStateId, batchGroup);
_spouts.put(id, c);
return new SpoutDeclarerImpl(c);
}
示例4: setBatchingSpout
import backtype.storm.topology.SpoutDeclarer; //导入依赖的package包/类
public SpoutDeclarer setBatchingSpout(String id, IRichSpout spout, int batchSize, Number parallelismHint) {
MonitoringDeclarer outputFieldsDeclarer = new MonitoringDeclarer();
spout.declareOutputFields(outputFieldsDeclarer);
Map<String, Integer> batchSizePerStream = new HashMap<String, Integer>();
for(String streamId : outputFieldsDeclarer.declaredStreams) {
batchSizePerStream.put(streamId, batchSize);
}
if(this.meassureThroughput) {
spout = new ThroughputSpout(spout, this.reportingInterval);
}
if(this.meassureLatency) {
spout = new LatencySpout(spout);
}
spout = new SpoutOutputBatcher(spout, batchSizePerStream);
SpoutDeclarer declarer = super.setSpout(id, spout, parallelismHint);
if(this.meassureThroughput) {
this.callSuper = true;
setBolt(id + "Stats", new FileFlushSinkBolt(DEFAULT_STATS_DIR + File.separator + id + ".throughput"))
.shuffleGrouping(id, MonitoringTopoloyBuilder.DEFAULT_THROUGHPUT_STREAM);
this.callSuper = false;
}
return declarer;
}
示例5: setNumTasks
import backtype.storm.topology.SpoutDeclarer; //导入依赖的package包/类
@Override
public SpoutDeclarer setNumTasks(Number val) {
Number tasks = val;
if (null != options) {
tasks = options.getTaskParallelism(spoutId, val);
}
return super.setNumTasks(tasks);
}
示例6: setSpout
import backtype.storm.topology.SpoutDeclarer; //导入依赖的package包/类
private SpoutDeclarer setSpout(String id, IRichSpout spout, Number parallelismHint, boolean isSchedule) {
upToDownstreamComponentsMap.put(id, new HashSet<String>());
IRichSpout spoutExecutor;
if (spout instanceof IBasicTransactionSpoutExecutor) {
spoutExecutor = new BasicTransactionSpout((IBasicTransactionSpoutExecutor) spout);
} else if (!isSchedule) {
spoutExecutor = new BasicTransactionSpout((ITransactionSpoutExecutor) spout);
} else {
spoutExecutor = new ScheduleTransactionSpout((ITransactionSpoutExecutor) spout);
}
SpoutDeclarer ret = super.setSpout(id, spoutExecutor, parallelismHint);
return ret;
}
示例7: addConfigurations
import backtype.storm.topology.SpoutDeclarer; //导入依赖的package包/类
@Override
public SpoutDeclarer addConfigurations(Map conf) {
_component.componentConfs.add(conf);
return this;
}
示例8: getSpoutDeclarer
import backtype.storm.topology.SpoutDeclarer; //导入依赖的package包/类
public SpoutDeclarer getSpoutDeclarer() {
return new SpoutDeclarerImpl();
}
示例9: addConfigurations
import backtype.storm.topology.SpoutDeclarer; //导入依赖的package包/类
@Override
public SpoutDeclarer addConfigurations(Map conf) {
_spoutConfs.add(conf);
return this;
}
示例10: setSpout
import backtype.storm.topology.SpoutDeclarer; //导入依赖的package包/类
@Override
public SpoutDeclarer setSpout(String id, IRichSpout spout) {
return this.setSpout(id, spout, null, null);
}
示例11: getSpoutDeclarer
import backtype.storm.topology.SpoutDeclarer; //导入依赖的package包/类
public SpoutDeclarer getSpoutDeclarer() {
return new SpoutDeclarerImpl();
}
示例12: addConfigurations
import backtype.storm.topology.SpoutDeclarer; //导入依赖的package包/类
@Override
public SpoutDeclarer addConfigurations(Map conf) {
_spoutConfs.add(conf);
return this;
}
示例13: setSpout
import backtype.storm.topology.SpoutDeclarer; //导入依赖的package包/类
@Override
public SpoutDeclarer setSpout(String id, IRichSpout spout) {
record(id, spout);
return setNumTasks(id, super.setSpout(id, spout, getExecutorParallelism(id, null)));
}
示例14: setSpout
import backtype.storm.topology.SpoutDeclarer; //导入依赖的package包/类
public void setSpout(String id, IRichSpout spout, int parallelism_hint) {
// add the spout into the topology
SpoutDeclarer declarer = builder.setSpout(id, spout, parallelism_hint);
}