@Override public void init() throws Exception { this.spout.open(storm_conf, userTopologyCtx, outputCollector); //send the HbMsg to TM, but it don't really finish spout's init. taskHbTrigger.sendHbMsg(); LOG.info("Successfully open SpoutExecutors " + idStr); }
public SpoutExecutors(backtype.storm.spout.ISpout _spout, WorkerTransfer _transfer_fn, Map _storm_conf, IConnection _puller, TaskSendTargets sendTargets, AtomicBoolean _storm_active_atom, TopologyContext topology_context, TopologyContext _user_context, BaseTaskStatsRolling _task_stats) { this.spout = _spout; this.storm_conf = _storm_conf; this.puller = _puller; this.zkActive = _storm_active_atom; this.user_context = _user_context; this.task_stats = _task_stats; Integer task_id = topology_context.getThisTaskId(); this.component_id = topology_context.getThisComponentId(); this.max_spout_pending = StormUtils.parseInt(storm_conf.get(Config.TOPOLOGY_MAX_SPOUT_PENDING)); this.deserializer = new KryoTupleDeserializer(storm_conf,topology_context);// (KryoTupleDeserializer. // storm-conf this.event_queue = new ConcurrentLinkedQueue<Runnable>(); int message_timeout_secs =StormUtils.parseInt(storm_conf.get(Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS)); // شtupleĶУȴtuple̫spoutͣTimeCacheMaptuple�ʱtuple.fail֪ͨackerطtyple this.pending = new TimeCacheMap(message_timeout_secs,new SpoutTimeCallBack<Object, Object>(event_queue, spout,storm_conf,task_stats)); // collector,ʵǵsend_spout_msg this.output_collector = new SpoutCollector(task_id,spout,task_stats,sendTargets,storm_conf,_transfer_fn,pending,topology_context,event_queue); LOG.info("Opening spout " + component_id + ":" + task_id); this.spout.open(storm_conf, user_context, new SpoutOutputCollector(output_collector)); LOG.info("Opend spout " + component_id + ":" + task_id); this.isRecvRun=new AtomicBoolean(); }
@SuppressWarnings("unchecked") @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 ignored) { } } catch (Exception e) { throw new RuntimeException(e); } }
@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); } }
@Override public void init() throws Exception { this.spout.open(storm_conf, userTopologyCtx, outputCollector); //send the HbMsg to TM, but it don't really finish spout's init. taskHbTrigger.sendHbMsg(); LOG.info("Successfully open SpoutExecutors " + idStr); }
@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); } }
@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); } }