本文整理汇总了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;
}
示例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());
}
示例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);
}
}
示例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();
}
}
示例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();
}
}
}
示例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();
}
}
}
示例7: setComponentType
import backtype.storm.spout.ISpout; //导入依赖的package包/类
private void setComponentType() {
if (taskObj instanceof IBolt) {
componentType = "bolt";
} else if (taskObj instanceof ISpout) {
componentType = "spout";
}
}
示例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();
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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();
}
}
示例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();
}
}
}
示例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();
}
}
}
示例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;
}