@Override public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { init(context, collector); bolt.prepare(stormConf, context, this.collector); }
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { if (_delegate instanceof FinishedCallback) { _callback = (FinishedCallback) _delegate; } _delegate.prepare(stormConf, context, collector); _rrQueue = new KeyedRoundRobinQueue<>(); _executor = new Thread(new Runnable() { public void run() { try { while (true) { _delegate.execute(_rrQueue.take()); } } catch (InterruptedException ignored) { } } }); _executor.setDaemon(true); _executor.start(); }
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { if(_delegate instanceof FinishedCallback) { _callback = (FinishedCallback) _delegate; } _delegate.prepare(stormConf, context, collector); _rrQueue = new KeyedRoundRobinQueue<Tuple>(); _executor = new Thread(new Runnable() { public void run() { try { while(true) { _delegate.execute(_rrQueue.take()); } } catch (InterruptedException e) { } } }); _executor.setDaemon(true); _executor.start(); }
public void prepare(Map config, TopologyContext context, OutputCollector collector) { TimeCacheMap.ExpiredCallback<Object, TrackingInfo> callback = null; if (_delegate instanceof TimeoutCallback) { callback = new TimeoutItems(); } _tracked = new TimeCacheMap<>(context.maxTopologyMessageTimeout(), callback); _collector = collector; _delegate.prepare(config, context, new OutputCollector(new CoordinatedOutputCollector(collector))); for (String component : Utils.get(context.getThisTargets(), Constants.COORDINATED_STREAM_ID, new HashMap<String, Grouping>()).keySet()) { for (Integer task : context.getComponentTasks(component)) { _countOutTasks.add(task); } } if (!_sourceArgs.isEmpty()) { _numSourceReports = 0; for (Entry<String, SourceArgs> entry : _sourceArgs.entrySet()) { if (entry.getValue().singleCount) { _numSourceReports += 1; } else { _numSourceReports += context.getComponentTasks(entry.getKey()).size(); } } } }
public void prepare(Map config, TopologyContext context, OutputCollector collector) { TimeCacheMap.ExpiredCallback<Object, TrackingInfo> callback = null; if(_delegate instanceof TimeoutCallback) { callback = new TimeoutItems(); } _tracked = new TimeCacheMap<Object, TrackingInfo>(context.maxTopologyMessageTimeout(config), callback); _collector = collector; _delegate.prepare(config, context, new OutputCollector(new CoordinatedOutputCollector(collector))); for(String component: Utils.get(context.getThisTargets(), Constants.COORDINATED_STREAM_ID, new HashMap<String, Grouping>()) .keySet()) { for(Integer task: context.getComponentTasks(component)) { _countOutTasks.add(task); } } if(!_sourceArgs.isEmpty()) { _numSourceReports = 0; for(Entry<String, SourceArgs> entry: _sourceArgs.entrySet()) { if(entry.getValue().singleCount) { _numSourceReports+=1; } else { _numSourceReports+=context.getComponentTasks(entry.getKey()).size(); } } } }
@Override public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { this.batchXorTracker = new AckPendingBatchTracker<>(); this.ackOutputCollector = new AckOutputCollector(collector.getDelegate(), batchXorTracker); this.bolt.prepare(stormConf, context, new OutputCollector(ackOutputCollector)); this.componentId = context.getThisComponentId(); this.taskId = context.getThisTaskId(); this.taskStats = new TaskBaseMetric(context.getTopologyId(), componentId, taskId); this.batchTimeout = ConfigExtension.getTransactionBatchSnapshotTimeout(stormConf) * 1000; this.random = new Random(Utils.secureRandomLong()); LOG.info("batchTimeout: {}", batchTimeout); }
@Override public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { init(context, collector); bolt.prepare(stormConf, context, this.collector); }
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { if (_delegate instanceof FinishedCallback) { _callback = (FinishedCallback) _delegate; } _delegate.prepare(stormConf, context, collector); _rrQueue = new KeyedRoundRobinQueue<Tuple>(); _executor = new Thread(new Runnable() { public void run() { try { while (true) { _delegate.execute(_rrQueue.take()); } } catch (InterruptedException e) { } } }); _executor.setDaemon(true); _executor.start(); }
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { if(_delegate instanceof FinishedCallback) { _callback = (FinishedCallback) _delegate; } _delegate.prepare(stormConf, context, collector); _rrQueue = new KeyedRoundRobinQueue<Tuple>(); _executor = new Thread(new Runnable() { public void run() { try { while(true) { _delegate.execute(_rrQueue.take()); } } catch (InterruptedException e) { } } }); _executor.setDaemon(true); _executor.start(); }
@Override @SuppressWarnings("rawtypes") public void prepare( Map conf, com.twitter.heron.api.topology.TopologyContext context, com.twitter.heron.api.bolt.OutputCollector collector) { topologyContextImpl = new TopologyContext(context); outputCollectorImpl = new OutputCollectorImpl(collector); delegate.prepare(conf, topologyContextImpl, outputCollectorImpl); }
@Override public void prepare(Map conf, TopologyContext context, OutputCollector collector) { this.context = context; try { // Register the metrics hook for this bolt to track statistics context.addTaskHook(new BoltMetricsHook()); getDelegate().prepare(conf, context, collector); } catch (FrameworkException ex) { LOG.error("prepare() not delegated due to a Framework exception: ", ex); throw new RuntimeException(ex); } }
public void prepare(Map config, TopologyContext context, OutputCollector collector) { TimeCacheMap.ExpiredCallback<Object, TrackingInfo> callback = null; if (_delegate instanceof TimeoutCallback) { callback = new TimeoutItems(); } _tracked = new TimeCacheMap<Object, TrackingInfo>(context.maxTopologyMessageTimeout(), callback); _collector = collector; _delegate.prepare(config, context, new OutputCollector(new CoordinatedOutputCollector(collector))); for (String component : Utils.get(context.getThisTargets(), Constants.COORDINATED_STREAM_ID, new HashMap<String, Grouping>()).keySet()) { for (Integer task : context.getComponentTasks(component)) { _countOutTasks.add(task); } } if (!_sourceArgs.isEmpty()) { _numSourceReports = 0; for (Entry<String, SourceArgs> entry : _sourceArgs.entrySet()) { if (entry.getValue().singleCount) { _numSourceReports += 1; } else { _numSourceReports += context.getComponentTasks(entry.getKey()).size(); } } } }
public void prepare(Map config, TopologyContext context, OutputCollector collector) { TimeCacheMap.ExpiredCallback<Object, TrackingInfo> callback = null; if(_delegate instanceof TimeoutCallback) { callback = new TimeoutItems(); } _tracked = new TimeCacheMap<Object, TrackingInfo>(context.maxTopologyMessageTimeout(), callback); _collector = collector; _delegate.prepare(config, context, new OutputCollector(new CoordinatedOutputCollector(collector))); for(String component: Utils.get(context.getThisTargets(), Constants.COORDINATED_STREAM_ID, new HashMap<String, Grouping>()) .keySet()) { for(Integer task: context.getComponentTasks(component)) { _countOutTasks.add(task); } } if(!_sourceArgs.isEmpty()) { _numSourceReports = 0; for(Entry<String, SourceArgs> entry: _sourceArgs.entrySet()) { if(entry.getValue().singleCount) { _numSourceReports+=1; } else { _numSourceReports+=context.getComponentTasks(entry.getKey()).size(); } } } }