本文整理汇总了Java中backtype.storm.topology.base.BaseRichBolt类的典型用法代码示例。如果您正苦于以下问题:Java BaseRichBolt类的具体用法?Java BaseRichBolt怎么用?Java BaseRichBolt使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BaseRichBolt类属于backtype.storm.topology.base包,在下文中一共展示了BaseRichBolt类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepare
import backtype.storm.topology.base.BaseRichBolt; //导入依赖的package包/类
@Override
public void prepare(Map conf, TopologyContext context,
OutputCollector collector) {
// get the implementation to use
// and instantiate it
String className = ConfUtils.getString(conf,
"stormcrawler.indexer.class");
if (StringUtils.isBlank(className)) {
throw new RuntimeException("No configuration found for indexing");
}
try {
final Class<BaseRichBolt> implClass = (Class<BaseRichBolt>) Class
.forName(className);
endpoint = implClass.newInstance();
} catch (final Exception e) {
throw new RuntimeException("Couldn't create " + className, e);
}
if (endpoint != null)
endpoint.prepare(conf, context, collector);
}
示例2: setupParserBolt
import backtype.storm.topology.base.BaseRichBolt; //导入依赖的package包/类
protected void setupParserBolt(BaseRichBolt bolt) {
this.bolt = bolt;
output = new TestOutputCollector();
}