backtype.storm.task.TopologyContext.getTopologyMasterId()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(81)

本文整理了Java中backtype.storm.task.TopologyContext.getTopologyMasterId()方法的一些代码示例,展示了TopologyContext.getTopologyMasterId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TopologyContext.getTopologyMasterId()方法的具体详情如下:
包路径:backtype.storm.task.TopologyContext
类名称:TopologyContext
方法名:getTopologyMasterId

TopologyContext.getTopologyMasterId介绍

暂无

代码示例

代码示例来源:origin: alibaba/jstorm

@Override
public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {
  this.topologyMasterId = context.getTopologyMasterId();
  this.spoutTaskId = context.getThisTaskId();
  this.collector = collector;
}

代码示例来源:origin: alibaba/jstorm

@Override
public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {
  this.conf = conf;
  this.topologyContext = context;
  this.topologyId = topologyContext.getTopologyId();
  this.taskId = topologyContext.getThisTaskId();
  this.topologyMasterId = topologyContext.getTopologyMasterId();
  this.componentId = topologyContext.getThisComponentId();
  this.taskStats = new TaskBaseMetric(topologyId, componentId, taskId);
  this.downstreamTasks = TransactionCommon.getDownstreamTasks(componentId, topologyContext);
  LOG.info("downstreamTasks: {}", downstreamTasks);
  this.outputCollector = new TransactionSpoutOutputCollector(collector, this);
  this.spoutStatus = State.INIT;
  this.committingBatches = new TreeMap<>();
  this.isMaxPending = false;
  this.MAX_PENDING_BATCH_NUM = ConfigExtension.getTransactionMaxPendingBatch(conf);
  int taskLaunchTimeout = JStormUtils.parseInt(conf.get(Config.NIMBUS_TASK_LAUNCH_SECS));
  int spoutInitRetryDelaySec = JStormUtils.parseInt(conf.get("transaction.spout.init.retry.secs"), taskLaunchTimeout);
  this.initRetryCheck = new IntervalCheck();
  initRetryCheck.setInterval(spoutInitRetryDelaySec);
  this.lock = new ReentrantLock(true);
}

代码示例来源:origin: alibaba/jstorm

public BaseExecutors mkExecutor() {
  BaseExecutors baseExecutor = null;
  if (taskObj instanceof IBolt) {
    if (taskId == topologyContext.getTopologyMasterId())
      baseExecutor = new TopologyMasterBoltExecutors(this);
    else
      baseExecutor = new BoltExecutors(this);
  } else if (taskObj instanceof ISpout) {
    if (isSingleThread(stormConf)) {
      baseExecutor = new SingleThreadSpoutExecutors(this);
    } else {
      baseExecutor = new MultipleThreadSpoutExecutors(this);
    }
  }
  return baseExecutor;
}

代码示例来源:origin: alibaba/jstorm

this.taskId = topologyContext.getThisTaskId();
this.componentId = topologyContext.getThisComponentId();
this.topologyMasterId = context.getTopologyMasterId();

代码示例来源:origin: alibaba/jstorm

Integer topologyId = sysTopologyCtx.getTopologyMasterId();
List<Integer> localWorkerTasks = sysTopologyCtx.getThisWorkerTasks();
if (topologyId != 0 && !localWorkerTasks.contains(topologyId)) {

代码示例来源:origin: alibaba/jstorm

topologyId, componentId, this.taskId, MetricDef.SERIALIZE_TIME, MetricType.HISTOGRAM), serializeTimerHistogram);
isTopologyMaster = (task.getTopologyContext().getTopologyMasterId() == task.getTaskId());

代码示例来源:origin: alibaba/jstorm

Integer topologyMasterId = sysTopologyCtx.getTopologyMasterId();
List<Integer> localWorkerTasks = sysTopologyCtx.getThisWorkerTasks();
if (topologyMasterId != 0 && !localWorkerTasks.contains(topologyMasterId)) {

代码示例来源:origin: com.alibaba.jstorm/jstorm-core

@Override
public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {
  this.conf = conf;
  this.topologyContext = context;
  this.topologyId = topologyContext.getTopologyId();
  this.taskId = topologyContext.getThisTaskId();
  this.topologyMasterId = topologyContext.getTopologyMasterId();
  this.componentId = topologyContext.getThisComponentId();
  this.groupId = TransactionCommon.groupIndex(context.getRawTopology(), componentId);
  this.downstreamTasks = TransactionCommon.getDownstreamTasks(componentId, topologyContext);
  this.outputCollector = new TransactionSpoutOutputCollector(collector, this);
  this.spoutStatus = State.INIT;
  this.committingBatches = new TreeSet<Long>();
  this.isMaxPending = false;
  this.MAX_PENDING_BATCH_NUM = JStormUtils.parseInt(conf.get("transaction.max.pending.batch"), 2);
  int taskLaunchTimeout = JStormUtils.parseInt(conf.get(Config.NIMBUS_TASK_LAUNCH_SECS));
  int spoutInitRetryDelaySec = JStormUtils.parseInt(conf.get("transaction.spout.init.retry.secs"), taskLaunchTimeout);
  this.initRetryCheck = new IntervalCheck();
  initRetryCheck.setInterval(spoutInitRetryDelaySec);
  this.lock = new ReentrantLock(true);
  spoutExecutor.open(conf, context, new SpoutOutputCollector(outputCollector));
}

代码示例来源:origin: com.alibaba.jstorm/jstorm-core

this.upstreamTasks = TransactionCommon.getUpstreamTasks(componentId, topologyContext);
this.downstreamTasks = TransactionCommon.getDownstreamTasks(componentId, topologyContext);
this.topologyMasterId = context.getTopologyMasterId();
LOG.info("TransactionBolt: upstreamTasks=" + upstreamTasks + ", downstreamTasks=" + downstreamTasks);

代码示例来源:origin: com.alibaba.jstorm/jstorm-core

Integer topologyId = sysTopologyCtx.getTopologyMasterId();
List<Integer> localWorkerTasks = sysTopologyCtx.getThisWorkerTasks();
if (topologyId != 0 && !localWorkerTasks.contains(topologyId)) {

代码示例来源:origin: com.alibaba.jstorm/jstorm-core

topolgyId, componentId, this.taskId, MetricDef.SERIALIZE_TIME, MetricType.HISTOGRAM), serializeTimerHistogram);
isTopologyMaster = (task.getTopologyContext().getTopologyMasterId() == task.getTaskId());

代码示例来源:origin: com.alibaba.jstorm/jstorm-core

Integer topologyMasterId = sysTopologyCtx.getTopologyMasterId();
List<Integer> localWorkerTasks = sysTopologyCtx.getThisWorkerTasks();
if (topologyMasterId != 0 && !localWorkerTasks.contains(topologyMasterId)){

相关文章

微信公众号

最新文章

更多