/** * Gets the declared output fields for the specified stream id for the component this task is a part of. */ public Fields getThisOutputFields(String streamId) { return getComponentOutputFields(getThisComponentId(), streamId); }
/** * Gets information about who is consuming the outputs of this component, and how. * * @return Map from stream id to component id to the Grouping used. */ public Map<String, Map<String, Grouping>> getThisTargets() { return getTargets(getThisComponentId()); }
@Override public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) { this.topologyMasterId = context.getTopologyMasterId(); this.spoutTaskId = context.getThisTaskId(); this.collector = collector; }
/** * Emits a new tuple to the default stream anchored on a group of input * tuples. The emitted values must be immutable. * * @param anchors the tuples to anchor to * @param tuple the new output tuple from this bolt * @return the list of task ids that this new tuple was sent to */ public List<Integer> emit(Collection<Tuple> anchors, List<Object> tuple) { return emit(Utils.DEFAULT_STREAM_ID, anchors, tuple); }
public MetricClient(TopologyContext context) { taskId = context.getThisTaskId(); this.topologyId = context.getTopologyId(); this.componentId = context.getThisComponentId(); }
private void failBatch(TrackedBatch tracked, FailedException e) { if (e != null && e instanceof ReportedFailedException) { _collector.reportError(e); } tracked.failed = true; if (tracked.delayedAck != null) { _collector.fail(tracked.delayedAck); tracked.delayedAck = null; } }
/** * Gets the set of streams declared for the component of this task. */ public Set<String> getThisStreams() { return getComponentStreams(getThisComponentId()); }
/** * Gets the declared inputs to this component. * * @return A map from subscribed component/stream to the grouping subscribed with. */ public Map<GlobalStreamId, Grouping> getThisSources() { return getSources(getThisComponentId()); }
public TaskSendTargets(Map<Object, Object> _storm_conf, String _component, Map<String, Map<String, MkGrouper>> _stream_component_grouper, TopologyContext _topology_context, TaskBaseMetric _task_stats) { this.stormConf = _storm_conf; this.componentId = _component; this.streamComponentGrouper = _stream_component_grouper; this.topologyContext = _topology_context; this.taskStats = _task_stats; taskId = topologyContext.getThisTaskId(); debugIdStr = " emit from " + componentId + ":" + taskId + " "; }
@Override public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) { _collector = collector; _base = context.getThisTaskIndex(); }
/** * Gets the component id for this task. The component id maps to a component id specified for a Spout or Bolt * in the topology definition. */ public String getThisComponentId() { return getComponentId(_taskId); }
@Override public void cleanup() { try { _bolt.cleanup(); } catch (AbstractMethodError ignored) { } }
@Override public List<Integer> emit(String streamId, Collection<Tuple> anchors, List<Object> tuple) { return _delegate.emit(streamId, anchors, tuple); }
@Override public void emitDirectCtrl(int taskId, String streamId, Collection<Tuple> anchors, List<Object> tuple) { delegate.emitDirectCtrl(taskId, streamId, anchors, tuple); } }
@Override public void emitDirect(int taskId, String streamId, Collection<Tuple> anchors, List<Object> tuple) { _delegate.emitDirect(taskId, streamId, anchors, tuple); }
/** * Emits a new unanchored tuple to the default stream. Beacuse it's * unanchored, if a failure happens downstream, this new tuple won't affect * whether any spout tuples are considered failed or not. The emitted values * must be immutable. * * @param tuple the new output tuple from this bolt * @return the list of task ids that this new tuple was sent to */ public List<Integer> emit(List<Object> tuple) { return emit(Utils.DEFAULT_STREAM_ID, tuple); }
@Override public List<Integer> emit(String streamId, Collection<Tuple> anchors, List<Object> tuple, ICollectorCallback callback) { return _delegate.emit(streamId, anchors, tuple, callback); }
@Override public void emitDirectCtrl(int taskId, String streamId, Collection<Tuple> anchors, List<Object> tuple) { _delegate.emitDirectCtrl(taskId, streamId, anchors, tuple); } }
@Override public void emitDirect(int taskId, String streamId, Collection<Tuple> anchors, List<Object> tuple, ICollectorCallback callback) { _delegate.emitDirect(taskId, streamId, anchors, tuple, callback); }
/** * Emits a new tuple to the default stream anchored on a single tuple. The * emitted values must be immutable. * * @param anchor the tuple to anchor to * @param tuple the new output tuple from this bolt * @return the list of task ids that this new tuple was sent to */ public List<Integer> emit(Tuple anchor, List<Object> tuple) { return emit(Utils.DEFAULT_STREAM_ID, anchor, tuple); }