void prepare(Map stormConf, TopologyContext context, OutputCollector collector, State state) { init(context, collector); this.collector = new AckTrackingOutputCollector(collector); bolt.prepare(stormConf, context, this.collector); this.state = state; }
@Override public void declareOutputFields(OutputFieldsDeclarer declarer) { declarer.declare(_fields); } }
/** * Define a new bolt in this topology. This defines a control bolt, which is a simpler to use but more restricted kind of bolt. Control bolts are intended for * making sending control message more simply * @param id the id of this component. This id is referenced by other components that want to consume this bolt's outputs. * @param bolt the control bolt * @param parallelism_hint the number of tasks that should be assigned to execute this bolt. Each task will run on a thread in a process somwehere around * the cluster. * @return use the returned object to declare the inputs to this component */ public BoltDeclarer setBolt(String id, IControlBolt bolt, Number parallelism_hint) { return setBolt(id, new ControlBoltExecutor(bolt), parallelism_hint); } public BoltDeclarer setBolt(String id, IControlBolt bolt) {
public SpoutDeclarer setSpout(String id, IControlSpout spout, Number parallelism_hint) { return setSpout(id, new ControlSpoutExecutor(spout), parallelism_hint); } /**
/** * Define a new bolt in this topology. This defines a windowed bolt, intended * for windowing operations. The {@link IWindowedBolt#execute(TupleWindow)} method * is triggered for each window interval with the list of current events in the window. * * @param id the id of this component. This id is referenced by other components that want to consume this bolt's outputs. * @param bolt the windowed bolt * @param parallelism_hint the number of tasks that should be assigned to execute this bolt. Each task will run on a thread in a process somwehere around the cluster. * @return use the returned object to declare the inputs to this component * @throws IllegalArgumentException if {@code parallelism_hint} is not positive */ public BoltDeclarer setBolt(String id, IWindowedBolt bolt, Number parallelism_hint) throws IllegalArgumentException { return setBolt(id, new backtype.storm.topology.WindowedBoltExecutor(bolt), parallelism_hint); }
/** * Define a new bolt in this topology with parallelism of just one thread. * * @param id the id of this component. This id is referenced by other components that want to consume this bolt's outputs. * @param bolt the bolt * @return use the returned object to declare the inputs to this component * @throws IllegalArgumentException if {@code parallelism_hint} is not positive */ public BoltDeclarer setBolt(String id, IRichBolt bolt) throws IllegalArgumentException { return setBolt(id, bolt, null); }
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { _bolt.prepare(stormConf, context); _collector = new BasicOutputCollector(collector); }
@Override public void declare(String prevComponent, InputDeclarer declarer) { declarer.shuffleGrouping(prevComponent); } });
@Override public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { this.windowedOutputCollector = new WindowedOutputCollector(collector); bolt.prepare(stormConf, context, windowedOutputCollector); this.listener = newWindowLifecycleListener(); this.windowManager = initWindowManager(listener, stormConf, context); start(); LOG.debug("Initialized window manager {} ", this.windowManager); }
@Override public void declare(String prevComponent, InputDeclarer declarer) { declarer.globalGrouping(prevComponent, streamId); } });
@Override public void declare(String prevComponent, InputDeclarer declarer) { declarer.directGrouping(prevComponent); } });
@Override public void declare(String prevComponent, InputDeclarer declarer) { declarer.noneGrouping(prevComponent, streamId); } });
@Override public void declare(String prevComponent, InputDeclarer declarer) { declarer.allGrouping(prevComponent); } });
@Override public void declare(String prevComponent, InputDeclarer declarer) { declarer.customGrouping(prevComponent, grouping); } });
protected void init(TopologyContext context, OutputCollector collector) { this.collector = new AnchoringOutputCollector(collector); this.checkPointInputTaskCount = getCheckpointInputTaskCount(context); }
@Override public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) { _spout.open(conf, context, new ControlSpoutOutputCollector(collector)); }
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { _bolt.prepare(stormConf, context, new ControlOutputCollector(collector)); }
@Override public void declare(String prevComponent, InputDeclarer declarer) { declarer.shuffleGrouping(prevComponent, streamId); } });