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


Java ISpout类代码示例

本文整理汇总了Java中backtype.storm.spout.ISpout的典型用法代码示例。如果您正苦于以下问题:Java ISpout类的具体用法?Java ISpout怎么用?Java ISpout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: mk_executors

import backtype.storm.spout.ISpout; //导入依赖的package包/类
public RunnableCallback mk_executors(DisruptorQueue deserializeQueue,
		TaskSendTargets sendTargets, ITaskReportErr report_error) {

	if (taskObj instanceof IBolt) {
		return new BoltExecutors((IBolt) taskObj, taskTransfer,
				innerTaskTransfer, stormConf, deserializeQueue, sendTargets,
				taskStatus, topologyContext, userContext, taskStats,
				report_error);
	} else if (taskObj instanceof ISpout) {
		if (isSingleThread(stormConf) == true) {
			return new SingleThreadSpoutExecutors((ISpout) taskObj, taskTransfer,
					innerTaskTransfer, stormConf, deserializeQueue, sendTargets,
					taskStatus, topologyContext, userContext, taskStats,
					report_error);
		}else {
			return new MultipleThreadSpoutExecutors((ISpout) taskObj, taskTransfer,
					innerTaskTransfer, stormConf, deserializeQueue, sendTargets,
					taskStatus, topologyContext, userContext, taskStats,
					report_error);
		}
	}

	return null;
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:25,代码来源:Task.java

示例2: SpoutCollector

import backtype.storm.spout.ISpout; //导入依赖的package包/类
public SpoutCollector(Task task, TimeOutMap<Long, TupleInfo> pending, DisruptorQueue disruptorAckerQueue) {
    this.sendTargets = task.getTaskSendTargets();
    this.storm_conf = task.getStormConf();
    this.transfer_fn = task.getTaskTransfer();
    this.pending = pending;
    this.topology_context = task.getTopologyContext();

    this.disruptorAckerQueue = disruptorAckerQueue;

    this.task_stats = task.getTaskStats();
    this.spout = (ISpout)task.getTaskObj();
    this.task_id = task.getTaskId();
    this.report_error = task.getReportErrorDie();

    ackerNum = JStormUtils.parseInt(storm_conf.get(Config.TOPOLOGY_ACKER_EXECUTORS));
    isDebug = JStormUtils.parseBoolean(storm_conf.get(Config.TOPOLOGY_DEBUG), false);

    random = new Random();
    random.setSeed(System.currentTimeMillis());

    String componentId = topology_context.getThisComponentId();
    emitTotalTimer =
            (AsmHistogram) JStormMetrics
                    .registerTaskMetric(MetricUtils.taskMetricName(topology_context.getTopologyId(), componentId, task_id, MetricDef.COLLECTOR_EMIT_TIME,
                            MetricType.HISTOGRAM), new AsmHistogram());
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:27,代码来源:SpoutCollector.java

示例3: open

import backtype.storm.spout.ISpout; //导入依赖的package包/类
@Override
public void open(final Map conf, final TopologyContext context, final SpoutOutputCollector collector) {
    IFn hof = Utils.loadClojureFn(_fnSpec.get(0), _fnSpec.get(1));
    try {
        IFn preparer = (IFn) hof.applyTo(RT.seq(_params));
        final Map<Keyword,Object> collectorMap = new PersistentArrayMap( new Object[] {
            Keyword.intern(Symbol.create("output-collector")), collector,
            Keyword.intern(Symbol.create("context")), context});
        List<Object> args = new ArrayList<Object>() {{
            add(conf);
            add(context);
            add(collectorMap);
        }};
        
        _spout = (ISpout) preparer.applyTo(RT.seq(args));
        //this is kind of unnecessary for clojure
        try {
            _spout.open(conf, context, collector);
        } catch(AbstractMethodError ame) {
            
        }
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:metamx,项目名称:incubator-storm,代码行数:26,代码来源:ClojureSpout.java

示例4: closeComponent

import backtype.storm.spout.ISpout; //导入依赖的package包/类
private void closeComponent(Object _task_obj) {
	if (_task_obj instanceof IBolt) {
		((IBolt) _task_obj).cleanup();
	}

	if (_task_obj instanceof ISpout) {
		((ISpout) _task_obj).close();
	}
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:10,代码来源:TaskShutdownDameon.java

示例5: deactive

import backtype.storm.spout.ISpout; //导入依赖的package包/类
public void deactive() {

		if (task_obj instanceof ISpout) {
			taskStatus.setStatus(TaskStatus.PAUSE);
			WorkerClassLoader.switchThreadContext();

			try {
				((ISpout) task_obj).deactivate();
			} finally {
				WorkerClassLoader.restoreThreadContext();
			}
		}

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

示例6: active

import backtype.storm.spout.ISpout; //导入依赖的package包/类
public void active() {
	if (task_obj instanceof ISpout) {
		taskStatus.setStatus(TaskStatus.RUN);
		WorkerClassLoader.switchThreadContext();
		try {
			((ISpout) task_obj).activate();
		} finally {
			WorkerClassLoader.restoreThreadContext();
		}
	}
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:12,代码来源:TaskShutdownDameon.java

示例7: setComponentType

import backtype.storm.spout.ISpout; //导入依赖的package包/类
private void setComponentType() {
	if (taskObj instanceof IBolt) {
		componentType = "bolt";
	} else if (taskObj instanceof ISpout) {
		componentType = "spout";
	}
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:8,代码来源:Task.java

示例8: AckSpoutMsg

import backtype.storm.spout.ISpout; //导入依赖的package包/类
public AckSpoutMsg(ISpout _spout, TupleInfo tupleInfo,
		CommonStatsRolling _task_stats, boolean _isDebug) {

	this.task_stats = _task_stats;

	this.spout = _spout;
	this.isDebug = _isDebug;

	this.msgId = tupleInfo.getMessageId();
	this.stream = tupleInfo.getStream();
	this.timeStamp = tupleInfo.getTimestamp();
	this.values = tupleInfo.getValues();
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:14,代码来源:AckSpoutMsg.java

示例9: FailSpoutMsg

import backtype.storm.spout.ISpout; //导入依赖的package包/类
public FailSpoutMsg(Object id, ISpout _spout, TupleInfo _tupleInfo,
		CommonStatsRolling _task_stats, boolean _isDebug) {
	this.id = id;
	this.spout = _spout;
	this.tupleInfo = _tupleInfo;
	this.task_stats = _task_stats;
	this.isDebug = _isDebug;
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:9,代码来源:FailSpoutMsg.java

示例10: open

import backtype.storm.spout.ISpout; //导入依赖的package包/类
@Override
public void open(final Map conf, final TopologyContext context,
		final SpoutOutputCollector collector) {
	IFn hof = Utils.loadClojureFn(_fnSpec.get(0), _fnSpec.get(1));
	try {
		IFn preparer = (IFn) hof.applyTo(RT.seq(_params));
		final Map<Keyword, Object> collectorMap = new PersistentArrayMap(
				new Object[] {
						Keyword.intern(Symbol.create("output-collector")),
						collector,
						Keyword.intern(Symbol.create("context")), context });
		List<Object> args = new ArrayList<Object>() {
			/**
			 * 
			 */
			private static final long serialVersionUID = 9036954267397717931L;

			{
				add(conf);
				add(context);
				add(collectorMap);
			}
		};

		_spout = (ISpout) preparer.applyTo(RT.seq(args));
		// this is kind of unnecessary for clojure
		try {
			_spout.open(conf, context, collector);
		} catch (AbstractMethodError ame) {

		}
	} catch (Exception e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:36,代码来源:ClojureSpout.java

示例11: open

import backtype.storm.spout.ISpout; //导入依赖的package包/类
@Override
public void open(final Map conf, final TopologyContext context,
		final SpoutOutputCollector collector) {
	IFn hof = Utils.loadClojureFn(_fnSpec.get(0), _fnSpec.get(1));
	try {
		IFn preparer = (IFn) hof.applyTo(RT.seq(_params));
		final Map<Keyword, Object> collectorMap = new PersistentArrayMap(
				new Object[] {
						Keyword.intern(Symbol.create("output-collector")),
						collector,
						Keyword.intern(Symbol.create("context")), context });
		List<Object> args = new ArrayList<Object>() {
			{
				add(conf);
				add(context);
				add(collectorMap);
			}
		};

		_spout = (ISpout) preparer.applyTo(RT.seq(args));
		// this is kind of unnecessary for clojure
		try {
			_spout.open(conf, context, collector);
		} catch (AbstractMethodError ame) {

		}
	} catch (Exception e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:songtk,项目名称:learn_jstorm,代码行数:31,代码来源:ClojureSpout.java

示例12: closeComponent

import backtype.storm.spout.ISpout; //导入依赖的package包/类
private void closeComponent(Object _task_obj) {
    if (_task_obj instanceof IBolt) {
        ((IBolt) _task_obj).cleanup();
    }

    if (_task_obj instanceof ISpout) {
        ((ISpout) _task_obj).close();
    }
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:10,代码来源:TaskShutdownDameon.java

示例13: deactive

import backtype.storm.spout.ISpout; //导入依赖的package包/类
public void deactive() {

        if (task_obj instanceof ISpout) {
            taskStatus.setStatus(TaskStatus.PAUSE);
            WorkerClassLoader.switchThreadContext();

            try {
                ((ISpout) task_obj).deactivate();
            } finally {
                WorkerClassLoader.restoreThreadContext();
            }
        }

    }
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:15,代码来源:TaskShutdownDameon.java

示例14: active

import backtype.storm.spout.ISpout; //导入依赖的package包/类
public void active() {
    if (task_obj instanceof ISpout) {
        taskStatus.setStatus(TaskStatus.RUN);
        WorkerClassLoader.switchThreadContext();
        try {
            ((ISpout) task_obj).activate();
        } finally {
            WorkerClassLoader.restoreThreadContext();
        }
    }
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:12,代码来源:TaskShutdownDameon.java

示例15: FailSpoutMsg

import backtype.storm.spout.ISpout; //导入依赖的package包/类
public FailSpoutMsg(Object id, ISpout _spout, TupleInfo _tupleInfo, TaskBaseMetric _task_stats, boolean _isDebug) {
    this.id = id;
    this.spout = _spout;
    this.tupleInfo = _tupleInfo;
    this.task_stats = _task_stats;
    this.isDebug = _isDebug;
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:8,代码来源:FailSpoutMsg.java


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