/** * Emits a tuple directly to the specified task id on the default stream. If the target bolt does not subscribe to this bolt using a * direct grouping, the tuple will not be sent. If the specified output stream is not declared as direct, or the target bolt subscribes * with a non-direct grouping, an error will occur at runtime. The emitted values must be immutable. * * The default stream must be declared as direct in the topology definition. See OutputDeclarer#declare for how this is done when * defining topologies in Java. * * @param taskId the taskId to send the new tuple to * @param anchors the tuples to anchor to * @param tuple the new output tuple from this bolt */ public void emitDirect(int taskId, Collection<Tuple> anchors, List<Object> tuple) { emitDirect(taskId, Utils.DEFAULT_STREAM_ID, anchors, tuple); }
@Override public void emitDirect(int taskId, String streamId, List<Object> tuple) { _collector.emitDirect(taskId, streamId, tuple); }
/** * Emits a tuple directly to the specified task id on the specified stream. If the target bolt does not subscribe to this bolt using a * direct grouping, the tuple will not be sent. If the specified output stream is not declared as direct, or the target bolt subscribes * with a non-direct grouping, an error will occur at runtime. Note that this method does not use anchors, so downstream failures won't * affect the failure status of any spout tuples. The emitted values must be immutable. * * @param taskId the taskId to send the new tuple to * @param streamId the stream to send the tuple on. It must be declared as a direct stream in the topology definition. * @param tuple the new output tuple from this bolt */ public void emitDirect(int taskId, String streamId, List<Object> tuple) { emitDirect(taskId, streamId, (List) null, tuple); }
public void emitDirect(int taskId, String streamId, List<Object> tuple) { out.emitDirect(taskId, streamId, inputTuple, tuple); }
/** * Emits a tuple directly to the specified task id on the default stream. If the target bolt does not subscribe to this bolt using a * direct grouping, the tuple will not be sent. If the specified output stream is not declared as direct, or the target bolt subscribes * with a non-direct grouping, an error will occur at runtime. The emitted values must be immutable. * * The default stream must be declared as direct in the topology definition. See OutputDeclarer#declare for how this is done when * defining topologies in Java.< * * Note that this method does not use anchors, so downstream failures won't affect the failure status of any spout tuples. * * @param taskId the taskId to send the new tuple to * @param tuple the new output tuple from this bolt */ public void emitDirect(int taskId, List<Object> tuple) { emitDirect(taskId, Utils.DEFAULT_STREAM_ID, tuple); }
/** * Emits a tuple directly to the specified task id on the default stream. If the target bolt does not subscribe to this bolt using a * direct grouping, the tuple will not be sent. If the specified output stream is not declared as direct, or the target bolt subscribes * with a non-direct grouping, an error will occur at runtime. The emitted values must be immutable. * * The default stream must be declared as direct in the topology definition. See OutputDeclarer#declare for how this is done when * defining topologies in Java. * * @param taskId the taskId to send the new tuple to * @param anchor the tuple to anchor to * @param tuple the new output tuple from this bolt */ public void emitDirect(int taskId, Tuple anchor, List<Object> tuple) { emitDirect(taskId, Utils.DEFAULT_STREAM_ID, anchor, tuple); }
/** * Emits a tuple directly to the specified task id on the specified stream. If the target bolt does not subscribe to this bolt using a * direct grouping, the tuple will not be sent. If the specified output stream is not declared as direct, or the target bolt subscribes * with a non-direct grouping, an error will occur at runtime. The emitted values must be immutable. * * @param taskId the taskId to send the new tuple to * @param streamId the stream to send the tuple on. It must be declared as a direct stream in the topology definition. * @param anchor the tuple to anchor to * @param tuple the new output tuple from this bolt */ public void emitDirect(int taskId, String streamId, Tuple anchor, List<Object> tuple) { emitDirect(taskId, streamId, anchor == null ? (List) null : Arrays.asList(anchor), tuple); }
private void handleEmit(ShellMsg shellMsg) throws InterruptedException { List<Tuple> anchors = new ArrayList<>(); List<String> recvAnchors = shellMsg.getAnchors(); if (recvAnchors != null) { for (String anchor : recvAnchors) { Tuple t = _inputs.get(anchor); if (t == null) { throw new RuntimeException("Anchored onto " + anchor + " after ack/fail"); } anchors.add(t); } } if (shellMsg.getTask() == 0) { List<Integer> outtasks = _collector.emit(shellMsg.getStream(), anchors, shellMsg.getTuple()); if (shellMsg.areTaskIdsNeeded()) { _pendingWrites.putTaskIds(outtasks); } } else { _collector.emitDirect((int) shellMsg.getTask(), shellMsg.getStream(), anchors, shellMsg.getTuple()); } }
int task = outTasks.next(); int numTuples = Utils.get(track.taskEmittedTuples, task, 0); _collector.emitDirect(task, Constants.COORDINATED_STREAM_ID, tup, new Values(id, numTuples));
if (curr.val == 0) { pending.remove(id); collector.emitDirect(task, ACKER_ACK_STREAM_ID, tuple); } else if (curr.failed) { pending.remove(id); collector.emitDirect(task, ACKER_FAIL_STREAM_ID, tuple); } else if (resetTimeout) { collector.emitDirect(task, ACKER_RESET_TIMEOUT_STREAM_ID, tuple); } else { throw new IllegalStateException("The checks are inconsistent we reach what should be unreachable code.");
private boolean finishBatch(TrackedBatch tracked, Tuple finishTuple) { boolean success = true; try { _bolt.finishBatch(tracked.info); String stream = COORD_STREAM(tracked.info.batchGroup); for (Integer task : tracked.condition.targetTasks) { _collector .emitDirect(task, stream, finishTuple, new Values(tracked.info.batchId, Utils.get(tracked.taskEmittedTuples, task, 0))); } if (tracked.delayedAck != null) { _collector.ack(tracked.delayedAck); tracked.delayedAck = null; } } catch (FailedException e) { failBatch(tracked, e); success = false; } _batches.remove(tracked.info.batchId.getId()); return success; }
@Override public void emitDirect(int taskId, String streamId, List<Object> tuple) { _collector.emitDirect(taskId, streamId, tuple); }
@Override public void emitDirect(int taskId, String streamId, Collection<Tuple> anchors, List<Object> tuple) { outputCollectorEventLogger.emitDirectWithLoggingEvent(taskId, streamId, tuple, t -> delegate.emitDirect(taskId, streamId, anchors, t)); }
@Override public void emitDirect(int taskId, List<Object> tuple) { outputCollectorEventLogger.emitDirectWithLoggingEvent(taskId, Utils.DEFAULT_STREAM_ID, tuple, t -> delegate.emitDirect(taskId, t)); }
@Override public void emitDirect(int taskId, Collection<Tuple> anchors, List<Object> tuple) { StreamlineEvent newEvent = injectCorrelationInformation(anchors, tuple); delegate.emitDirect(taskId, anchors, new Values(newEvent)); }
@Override public void emitDirect(int taskId, String streamId, Collection<Tuple> anchors, List<Object> tuple) { StreamlineEvent newEvent = injectCorrelationInformation(anchors, tuple); delegate.emitDirect(taskId, streamId, anchors, new Values(newEvent)); }
@Override public void emitDirect(int taskId, String streamId, List<Object> tuple) { StreamlineEvent newEvent = injectCorrelationInformation(tuple); delegate.emitDirect(taskId, streamId, new Values(newEvent)); }
@Override public void emitDirect(int taskId, String streamId, Tuple anchor, List<Object> tuple) { StreamlineEvent newEvent = injectCorrelationInformation(anchor, tuple); delegate.emitDirect(taskId, streamId, anchor, new Values(newEvent)); }
@Override public void emitDirect(int taskId, Tuple anchor, List<Object> tuple) { StreamlineEvent newEvent = injectCorrelationInformation(anchor, tuple); delegate.emitDirect(taskId, anchor, new Values(newEvent)); }
@Override public void emitDirect(int taskId, List<Object> tuple) { StreamlineEvent newEvent = injectCorrelationInformation(tuple); delegate.emitDirect(taskId, new Values(newEvent)); }