• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ISpout类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: 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:kkllwww007,项目名称:jstrom,代码行数:28,代码来源:ClojureSpout.java


示例17: deactive

import backtype.storm.spout.ISpout; //导入依赖的package包/类
public void deactive() {
    if (taskObj instanceof ISpout) {
        taskStatus.setStatus(TaskStatus.PAUSE);
        WorkerClassLoader.switchThreadContext();

        try {
            ((ISpout) taskObj).deactivate();
        } finally {
            WorkerClassLoader.restoreThreadContext();
        }
    } else {
        taskStatus.setStatus(TaskStatus.PAUSE);
    }
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:15,代码来源:TaskShutdownDameon.java


示例18: active

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


示例19: AckSpoutMsg

import backtype.storm.spout.ISpout; //导入依赖的package包/类
public AckSpoutMsg(Object id, ISpout _spout, Tuple tuple, TupleInfo tupleInfo, TaskBaseMetric _task_stats) {
    this.id = id;
    this.taskStats = _task_stats;
    this.spout = _spout;
    this.msgId = tupleInfo.getMessageId();
    this.stream = tupleInfo.getStream();
    this.values = tupleInfo.getValues();
    this.tuple = tuple;
    this.tupleInfo = tupleInfo;
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:11,代码来源:AckSpoutMsg.java


示例20: 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));

    random = new Random(Utils.secureRandomLong());

    if (spout instanceof IAckValueSpout || spout instanceof IFailValueSpout)
        isCacheTuple = true;
    else
        isCacheTuple = false;

    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());
    emitTotalTimer.setEnabled(false);
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:30,代码来源:SpoutCollector.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UsageInfo2UsageAdapter类代码示例发布时间:2022-05-22
下一篇:
Java LegacyServerSocketEndPointInfo类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap