本文整理汇总了Java中com.alibaba.jstorm.daemon.worker.WorkerData.getTopologyId方法的典型用法代码示例。如果您正苦于以下问题:Java WorkerData.getTopologyId方法的具体用法?Java WorkerData.getTopologyId怎么用?Java WorkerData.getTopologyId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.alibaba.jstorm.daemon.worker.WorkerData
的用法示例。
在下文中一共展示了WorkerData.getTopologyId方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: WorkerHeartbeatRunable
import com.alibaba.jstorm.daemon.worker.WorkerData; //导入方法依赖的package包/类
public WorkerHeartbeatRunable(WorkerData workerData) {
this.workerData = workerData;
this.conf = workerData.getStormConf();
this.worker_id = workerData.getWorkerId();
this.port = workerData.getPort();
this.topologyId = workerData.getTopologyId();
this.task_ids = new CopyOnWriteArraySet<Integer>(workerData.getTaskids());
this.shutdown = workerData.getShutdown();
String key = Config.WORKER_HEARTBEAT_FREQUENCY_SECS;
frequence = JStormUtils.parseInt(conf.get(key), 10);
this.workerStates = new HashMap<String, LocalState>();
}
示例2: WorkerHeartbeatRunable
import com.alibaba.jstorm.daemon.worker.WorkerData; //导入方法依赖的package包/类
public WorkerHeartbeatRunable(WorkerData workerData) {
this.workerData = workerData;
this.conf = workerData.getConf();
this.worker_id = workerData.getWorkerId();
this.port = workerData.getPort();
this.topologyId = workerData.getTopologyId();
this.task_ids = new CopyOnWriteArraySet<Integer>(
workerData.getTaskids());
this.active = workerData.getActive();
String key = Config.WORKER_HEARTBEAT_FREQUENCY_SECS;
frequence = JStormUtils.parseInt(conf.get(key), 10);
}
示例3: TaskHeartbeatRunable
import com.alibaba.jstorm.daemon.worker.WorkerData; //导入方法依赖的package包/类
public TaskHeartbeatRunable(WorkerData workerData) {
this.zkCluster = workerData.getZkCluster();
this.topology_id = workerData.getTopologyId();
this.uptime = new UptimeComputer();;
this.storm_conf = workerData.getStormConf();
this.active = workerData.getActive();
String key = Config.TASK_HEARTBEAT_FREQUENCY_SECS;
Object time = storm_conf.get(key);
frequence = JStormUtils.parseInt(time, 10);
}
示例4: Task
import com.alibaba.jstorm.daemon.worker.WorkerData; //导入方法依赖的package包/类
public Task(WorkerData workerData, int taskId) throws Exception {
openOrPrepareWasCalled = new Atom(Boolean.valueOf(false));
this.workerData = workerData;
this.topologyContext = workerData.getContextMaker()
.makeTopologyContext(workerData.getSysTopology(), taskId,
openOrPrepareWasCalled);
this.userContext = workerData.getContextMaker().makeTopologyContext(
workerData.getRawTopology(), taskId, openOrPrepareWasCalled);
this.taskid = taskId;
this.componentid = topologyContext.getThisComponentId();
this.taskStatus = new TaskStatus();
this.taskTransfer = getSendingTransfer(workerData);
this.innerTaskTransfer = workerData.getInnerTaskTransfer();
this.deserializeQueues = workerData.getDeserializeQueues();
this.topologyid = workerData.getTopologyId();
this.context = workerData.getContext();
this.workHalt = workerData.getWorkHalt();
this.zkCluster = new StormZkClusterState(workerData.getZkClusterstate());
this.stormConf = Common.component_conf(workerData.getStormConf(),
topologyContext, componentid);
WorkerClassLoader.switchThreadContext();
// get real task object -- spout/bolt/spoutspec
this.taskObj = Common.get_task_object(topologyContext.getRawTopology(),
componentid, WorkerClassLoader.getInstance());
WorkerClassLoader.restoreThreadContext();
int samplerate = StormConfig.sampling_rate(stormConf);
this.taskStats = new CommonStatsRolling(samplerate);
LOG.info("Loading task " + componentid + ":" + taskid);
}
示例5: Task
import com.alibaba.jstorm.daemon.worker.WorkerData; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
public Task(WorkerData workerData, int taskId) throws Exception {
openOrPrepareWasCalled = new Atom(Boolean.valueOf(false));
this.workerData = workerData;
this.topologyContext = workerData.getContextMaker()
.makeTopologyContext(workerData.getSysTopology(), taskId,
openOrPrepareWasCalled);
this.userContext = workerData.getContextMaker().makeTopologyContext(
workerData.getRawTopology(), taskId, openOrPrepareWasCalled);
this.taskid = taskId;
this.componentid = topologyContext.getThisComponentId();
this.taskStatus = new TaskStatus();
this.taskTransfer = getSendingTransfer(workerData);
this.innerTaskTransfer = workerData.getInnerTaskTransfer();
this.deserializeQueues = workerData.getDeserializeQueues();
this.topologyid = workerData.getTopologyId();
this.context = workerData.getContext();
this.workHalt = workerData.getWorkHalt();
this.zkCluster = new StormZkClusterState(workerData.getZkClusterstate());
this.stormConf = Common.component_conf(workerData.getStormConf(),
topologyContext, componentid);
WorkerClassLoader.switchThreadContext();
// get real task object -- spout/bolt/spoutspec
this.taskObj = Common.get_task_object(topologyContext.getRawTopology(),
componentid, WorkerClassLoader.getInstance());
WorkerClassLoader.restoreThreadContext();
int samplerate = StormConfig.sampling_rate(stormConf);
this.taskStats = new CommonStatsRolling(samplerate);
LOG.info("Loading task " + componentid + ":" + taskid);
}
示例6: Task
import com.alibaba.jstorm.daemon.worker.WorkerData; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
public Task(WorkerData workerData, int taskId) throws Exception {
openOrPrepareWasCalled = new Atom(Boolean.valueOf(false));
this.workerData = workerData;
this.topologyContext = workerData.getContextMaker().makeTopologyContext(workerData.getSysTopology(), taskId, openOrPrepareWasCalled);
this.userContext = workerData.getContextMaker().makeTopologyContext(workerData.getRawTopology(), taskId, openOrPrepareWasCalled);
this.taskId = taskId;
this.componentId = topologyContext.getThisComponentId();
this.stormConf = Common.component_conf(workerData.getStormConf(), topologyContext, componentId);
this.taskStatus = new TaskStatus();
this.innerTaskTransfer = workerData.getInnerTaskTransfer();
this.deserializeQueues = workerData.getDeserializeQueues();
this.topologyId = workerData.getTopologyId();
this.context = workerData.getContext();
this.workHalt = workerData.getWorkHalt();
this.zkCluster =workerData.getZkCluster();
this.taskStats = new TaskBaseMetric(topologyId, componentId, taskId,
ConfigExtension.isEnableMetrics(workerData.getStormConf()));
LOG.info("Begin to deserialize taskObj " + componentId + ":" + this.taskId);
WorkerClassLoader.switchThreadContext();
// get real task object -- spout/bolt/spoutspec
this.taskObj = Common.get_task_object(topologyContext.getRawTopology(), componentId, WorkerClassLoader.getInstance());
WorkerClassLoader.restoreThreadContext();
isTaskBatchTuple = ConfigExtension.isTaskBatchTuple(stormConf);
LOG.info("Transfer/receive in batch mode :" + isTaskBatchTuple);
LOG.info("Loading task " + componentId + ":" + this.taskId);
}
示例7: WorkerHeartbeatRunable
import com.alibaba.jstorm.daemon.worker.WorkerData; //导入方法依赖的package包/类
public WorkerHeartbeatRunable(WorkerData workerData) {
this.workerData = workerData;
this.conf = workerData.getStormConf();
this.workerId = workerData.getWorkerId();
this.port = workerData.getPort();
this.topologyId = workerData.getTopologyId();
this.taskIds = new CopyOnWriteArraySet<>(workerData.getTaskIds());
String key = Config.WORKER_HEARTBEAT_FREQUENCY_SECS;
frequency = JStormUtils.parseInt(conf.get(key), 10);
this.workerStates = new HashMap<>();
}
示例8: Task
import com.alibaba.jstorm.daemon.worker.WorkerData; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
public Task(WorkerData workerData, int taskId) throws Exception {
openOrPrepareWasCalled = new Atom(false);
this.workerData = workerData;
this.topologyContext = workerData.getContextMaker().makeTopologyContext(
workerData.getSysTopology(), taskId, openOrPrepareWasCalled);
this.userContext = workerData.getContextMaker().makeTopologyContext(
workerData.getRawTopology(), taskId, openOrPrepareWasCalled);
this.taskId = taskId;
this.componentId = topologyContext.getThisComponentId();
topologyContext.getStormConf().putAll(Common.component_conf(topologyContext, componentId));
this.stormConf = topologyContext.getStormConf();
this.taskStatus = new TaskStatus();
this.innerTaskTransfer = workerData.getInnerTaskTransfer();
this.deserializeQueues = workerData.getDeserializeQueues();
this.controlQueues = workerData.getControlQueues();
this.topologyId = workerData.getTopologyId();
this.context = workerData.getContext();
this.workHalt = workerData.getWorkHalt();
this.zkCluster = workerData.getZkCluster();
this.nodePortToSocket = workerData.getNodePortToSocket();
this.taskToNodePort = workerData.getTaskToNodePort();
// create report error callback,
// in fact it is storm_cluster.report-task-error
ITaskReportErr reportError = new TaskReportError(zkCluster, topologyId, taskId);
// report error and halt worker
reportErrorDie = new TaskReportErrorAndDie(reportError, workHalt);
this.taskStats = new TaskBaseMetric(topologyId, componentId, taskId);
//register auto hook
List<String> listHooks = Config.getTopologyAutoTaskHooks(stormConf);
for (String hook : listHooks) {
ITaskHook iTaskHook = (ITaskHook) Utils.newInstance(hook);
userContext.addTaskHook(iTaskHook);
}
LOG.info("Begin to deserialize taskObj " + componentId + ":" + this.taskId);
try {
WorkerClassLoader.switchThreadContext();
this.taskObj = Common.get_task_object(
topologyContext.getRawTopology(), componentId, WorkerClassLoader.getInstance());
WorkerClassLoader.restoreThreadContext();
} catch (Exception e) {
if (reportErrorDie != null) {
reportErrorDie.report(e);
} else {
throw e;
}
}
isTaskBatchTuple = ConfigExtension.isTaskBatchTuple(stormConf);
LOG.info("Transfer/receive in batch mode :" + isTaskBatchTuple);
LOG.info("Loading task " + componentId + ":" + this.taskId);
}