本文整理匯總了Java中backtype.storm.task.TopologyContext.getThisComponentId方法的典型用法代碼示例。如果您正苦於以下問題:Java TopologyContext.getThisComponentId方法的具體用法?Java TopologyContext.getThisComponentId怎麽用?Java TopologyContext.getThisComponentId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類backtype.storm.task.TopologyContext
的用法示例。
在下文中一共展示了TopologyContext.getThisComponentId方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: prepare
import backtype.storm.task.TopologyContext; //導入方法依賴的package包/類
public void prepare(Map conf, TopologyContext ctx, OutputCollector collector) {
this.collector = collector;
this.myId = ctx.getThisComponentId() + "-" + ctx.getThisTaskId();
this.summary = new Summary();
this.publisher = new ZkPublisher();
try {
this.publisher.init(conf);
} catch (Exception e) {
throw new RuntimeException(e);
}
this.lastPublishedTimestamp = 0;
}
示例2: prepare
import backtype.storm.task.TopologyContext; //導入方法依賴的package包/類
public void prepare(Map conf, TopologyContext ctx, OutputCollector collector) {
this.collector = collector;
this.myId = ctx.getThisComponentId() + "-" + ctx.getThisTaskId();
this.sentimentData = (Map<String, Long>) conf.get("sentimentData");
if (this.sentimentData != null) {
LOG.info("SentiCalcBolt " + myId + " has received sentimentData");
}
}
示例3: prepare
import backtype.storm.task.TopologyContext; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public void prepare(Map conf, TopologyContext topologyContext) {
this.componentId = topologyContext.getThisComponentId();
this.taskId = topologyContext.getThisTaskId();
try {
this.host = Utils.localHostname();
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
}
示例4: prepare
import backtype.storm.task.TopologyContext; //導入方法依賴的package包/類
@Override
public void prepare(Map conf, TopologyContext topologyContext) {
this.componentId = topologyContext.getThisComponentId();
this.taskId = topologyContext.getThisTaskId();
}