当前位置: 首页>>代码示例>>Java>>正文


Java Constants.SYSTEM_TICK_STREAM_ID属性代码示例

本文整理汇总了Java中backtype.storm.Constants.SYSTEM_TICK_STREAM_ID属性的典型用法代码示例。如果您正苦于以下问题:Java Constants.SYSTEM_TICK_STREAM_ID属性的具体用法?Java Constants.SYSTEM_TICK_STREAM_ID怎么用?Java Constants.SYSTEM_TICK_STREAM_ID使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在backtype.storm.Constants的用法示例。


在下文中一共展示了Constants.SYSTEM_TICK_STREAM_ID属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: BoltExecutors

public BoltExecutors(Task task) {

        super(task);

        this.bolt = (IBolt)task.getTaskObj();

        // create TimeCacheMap
        this.tuple_start_times = new RotatingMap<Tuple, Long>(Acker.TIMEOUT_BUCKET_NUM);
        this.ackerNum = JStormUtils.parseInt(storm_conf.get(Config.TOPOLOGY_ACKER_EXECUTORS));

        // create BoltCollector
        IOutputCollector output_collector = new BoltCollector(task, tuple_start_times, message_timeout_secs);
        outputCollector = new OutputCollector(output_collector);
        taskHbTrigger.setBoltOutputCollector(outputCollector);

        String metricName = MetricUtils.taskMetricName(topologyId, componentId, taskId, MetricDef.EXECUTE_TIME, MetricType.HISTOGRAM);
        this.boltExeTimer = JStormMetrics.registerTaskMetric(metricName, new AsmHistogram());

        Object tickFrequence = storm_conf.get(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS);
        if (tickFrequence != null) {
            Integer frequence = JStormUtils.parseInt(tickFrequence);
            TickTupleTrigger tickTupleTrigger = new TickTupleTrigger(sysTopologyCtx, frequence, idStr + Constants.SYSTEM_TICK_STREAM_ID, exeQueue);
            tickTupleTrigger.register();
        }
       
        
        isSystemBolt = Common.isSystemComponent(componentId);
        if (isSystemBolt == false) {
            backpressureTrigger = new BackpressureTrigger(task, this, storm_conf, outputCollector);
            int backpressureCheckFrequence = ConfigExtension.getBackpressureCheckIntervl(storm_conf);
            BackpressureCheckTrigger backpressureCheckTrigger =
                    new BackpressureCheckTrigger(30, backpressureCheckFrequence, idStr + " backpressure check trigger", backpressureTrigger);
            backpressureCheckTrigger.register(TimeUnit.MILLISECONDS);
        }

        LOG.info("Successfully create BoltExecutors " + idStr);
    }
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:37,代码来源:BoltExecutors.java

示例2: updateObject

@Override
public void updateObject() {
	this.object = new TupleImplExt(topologyContext, new Values(
			TimeUtils.current_time_secs()), (int) Constants.SYSTEM_TASK_ID,
			Constants.SYSTEM_TICK_STREAM_ID);
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:6,代码来源:TickTupleTrigger.java

示例3: BoltExecutors

public BoltExecutors(IBolt _bolt, TaskTransfer _transfer_fn,
			Map<Integer, DisruptorQueue> innerTaskTransfer, Map storm_conf,
			DisruptorQueue deserializeQueue, TaskSendTargets _send_fn,
			TaskStatus taskStatus, TopologyContext sysTopologyCxt,
			TopologyContext userTopologyCxt, CommonStatsRolling _task_stats,
			ITaskReportErr _report_error) {

		super(_transfer_fn, storm_conf, deserializeQueue, innerTaskTransfer,
				sysTopologyCxt, userTopologyCxt, _task_stats, taskStatus,
				_report_error);

		this.bolt = _bolt;

		// create TimeCacheMap

		this.tuple_start_times = new RotatingMap<Tuple, Long>(
				Acker.TIMEOUT_BUCKET_NUM);

		this.ackerNum = JStormUtils.parseInt(storm_conf
				.get(Config.TOPOLOGY_ACKER_EXECUTORS));

		// don't use TimeoutQueue for recv_tuple_queue,
		// then other place should check the queue size
		// TimeCacheQueue.DefaultExpiredCallback<Tuple> logExpireCb = new
		// TimeCacheQueue.DefaultExpiredCallback<Tuple>(
		// idStr);
		// this.recv_tuple_queue = new
		// TimeCacheQueue<Tuple>(message_timeout_secs,
		// TimeCacheQueue.DEFAULT_NUM_BUCKETS, logExpireCb);

		// create BoltCollector
		IOutputCollector output_collector = new BoltCollector(
				message_timeout_secs, _report_error, _send_fn, storm_conf,
				_transfer_fn, sysTopologyCxt, taskId, tuple_start_times,
				_task_stats);

		outputCollector = new OutputCollector(output_collector);

		boltExeTimer = Metrics.registerTimer(idStr, MetricDef.EXECUTE_TIME, 
				String.valueOf(taskId), Metrics.MetricType.TASK);
		
		Object tickFrequence = storm_conf.get(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS);
		if (tickFrequence != null) {
			Integer frequence = JStormUtils.parseInt(tickFrequence);
			TickTupleTrigger tickTupleTrigger = new TickTupleTrigger(
					sysTopologyCxt, frequence, 
					idStr + Constants.SYSTEM_TICK_STREAM_ID, exeQueue);
			tickTupleTrigger.register();
		}

		try {
			// do prepare
			WorkerClassLoader.switchThreadContext();
			
//			Method method = IBolt.class.getMethod("prepare", new Class[] {Map.class, TopologyContext.class,
//					OutputCollector.class});
//			method.invoke(bolt, new Object[] {storm_conf, userTopologyCxt, outputCollector});
			bolt.prepare(storm_conf, userTopologyCtx, outputCollector);

		} catch (Throwable e) {
			error = e;
			LOG.error("bolt prepare error ", e);
			report_error.report(e);
		} finally {
			WorkerClassLoader.restoreThreadContext();
		}

		LOG.info("Successfully create BoltExecutors " + idStr);

	}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:70,代码来源:BoltExecutors.java

示例4: updateObject

@Override
public void updateObject() {
    this.object =
            new TupleImplExt(topologyContext, new Values(TimeUtils.current_time_secs()), (int) Constants.SYSTEM_TASK_ID, Constants.SYSTEM_TICK_STREAM_ID);
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:5,代码来源:TickTupleTrigger.java

示例5: updateObject

@Override
public void updateObject() {
    this.object = new TupleImplExt(topologyContext,
            new Values(TimeUtils.current_time_secs()), (int) Constants.SYSTEM_TASK_ID, Constants.SYSTEM_TICK_STREAM_ID);
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:5,代码来源:TickTupleTrigger.java

示例6: BoltExecutors

public BoltExecutors(Task task) {
    super(task);

    this.bolt = (IBolt) task.getTaskObj();

    // create TimeCacheMap
    this.tupleStartTimes = new RotatingMap<>(Acker.TIMEOUT_BUCKET_NUM);
    this.ackerNum = JStormUtils.parseInt(storm_conf.get(Config.TOPOLOGY_ACKER_EXECUTORS));

    // create BoltCollector
    BoltCollector outputCollector;
    if (ConfigExtension.isTaskBatchTuple(storm_conf)) {
        outputCollector = new BoltBatchCollector(task, tupleStartTimes, messageTimeoutSecs);
    } else {
        outputCollector = new BoltCollector(task, tupleStartTimes, messageTimeoutSecs);
    }
    this.outputCollector = new OutputCollector(outputCollector);

    //this task don't continue until it bulid connection with topologyMaster
    Integer topologyId = sysTopologyCtx.getTopologyMasterId();
    List<Integer> localWorkerTasks = sysTopologyCtx.getThisWorkerTasks();
    if (topologyId != 0 && !localWorkerTasks.contains(topologyId)) {
        while (getConnection(topologyId) == null) {
            JStormUtils.sleepMs(10);
            LOG.info("this task still is building connection with topology Master");
        }
    }

    taskHbTrigger.setBoltOutputCollector(outputCollector);
    taskHbTrigger.register();
    Object tickFrequency = storm_conf.get(Config.TOPOLOGY_TICK_TUPLE_FREQ_MS);
    if (tickFrequency == null) {
        tickFrequency = storm_conf.get(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS);
        if (tickFrequency != null)
            tickFrequency = JStormUtils.parseInt(tickFrequency) * 1000;
    }

    isSystemBolt = Common.isSystemComponent(componentId);
    if (tickFrequency != null && !isSystemBolt) {
        Integer frequency = JStormUtils.parseInt(tickFrequency);
        tickTupleTrigger = new TickTupleTrigger(
                sysTopologyCtx, frequency, idStr + Constants.SYSTEM_TICK_STREAM_ID, controlQueue);
        tickTupleTrigger.register();
    }

    LOG.info("Successfully create BoltExecutors " + idStr);
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:47,代码来源:BoltExecutors.java


注:本文中的backtype.storm.Constants.SYSTEM_TICK_STREAM_ID属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。