當前位置: 首頁>>代碼示例>>Java>>正文


Java TopologyContext.getThisComponentId方法代碼示例

本文整理匯總了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;
}
 
開發者ID:pathbreak,項目名稱:reddit-sentiment-storm,代碼行數:17,代碼來源:SummarizerBolt.java

示例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");
	}
}
 
開發者ID:pathbreak,項目名稱:reddit-sentiment-storm,代碼行數:10,代碼來源:SentimentCalculatorBolt.java

示例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);
    }
}
 
開發者ID:lovelock,項目名稱:storm-demo,代碼行數:12,代碼來源:SimpleFileNameFormat.java

示例4: prepare

import backtype.storm.task.TopologyContext; //導入方法依賴的package包/類
@Override
public void prepare(Map conf, TopologyContext topologyContext) {
    this.componentId = topologyContext.getThisComponentId();
    this.taskId = topologyContext.getThisTaskId();
}
 
開發者ID:lovelock,項目名稱:storm-demo,代碼行數:6,代碼來源:DefaultFileNameFormat.java


注:本文中的backtype.storm.task.TopologyContext.getThisComponentId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。