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


Java WorkerData.getDeserializeQueues方法代码示例

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


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

示例1: 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);
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:35,代码来源:Task.java

示例2: 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);
}
 
开发者ID:songtk,项目名称:learn_jstorm,代码行数:36,代码来源:Task.java

示例3: 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);
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:35,代码来源:Task.java

示例4: 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);
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:59,代码来源:Task.java


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