public void flush() { out.flush(); }
public void emitDirect(int task, String stream, Collection<Tuple> anchors, List<Object> tuple) { updateTaskCounts(tuple.get(0), Arrays.asList(task)); _delegate.emitDirect(task, stream, anchors, tuple); // due to here do updateTaskCounts, so we do flush operation _delegate.flush(); }
public void emitDirect(int task, String stream, Collection<Tuple> anchors, List<Object> tuple) { updateTaskCounts(Arrays.asList(task)); _delegate.emitDirect(task, stream, anchors, tuple); _delegate.flush(); }
public void cleanup() { if (JStormUtils.isKilledStatus(context)){ long start = System.currentTimeMillis(); while (_expectExcevieNum != 0) { if (_expectExcevieNum < 0) { LOG.warn("_expectExcevieNum can't less than zero"); break; } JStormUtils.sleepMs(1); if (System.currentTimeMillis() - start > timeout * 1000) { LOG.warn("timeout, this component still not receive {} finish stream", _expectExcevieNum); break; } } JStormUtils.sleepMs(10); int sendNum = 0; for (List<Integer> tasks : _targetTasks.values()) { for (Integer task : tasks) { sendNum++; _collector.emitDirect(task, new Values()); } } _collector.flush(); LOG.info("this component-{} already sent {} finish messages", context.getThisTaskId(), sendNum); JStormUtils.sleepMs(100); } }
private boolean finishBatch(TrackedBatch tracked, Tuple finishTuple) { boolean success = true; try { _bolt.finishBatch(tracked.info); String stream = COORD_STREAM(tracked.info.batchGroup); _collector.flush(); 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; }
public void flush(){ out.flush();}
public void emitDirect(int task, String stream, Collection<Tuple> anchors, List<Object> tuple) { updateTaskCounts(tuple.get(0), Arrays.asList(task)); _delegate.emitDirect(task, stream, anchors, tuple); // due to here do updateTaskCounts, so we do flush operation _delegate.flush(); }
public void emitDirect(int task, String stream, Collection<Tuple> anchors, List<Object> tuple) { updateTaskCounts(Arrays.asList(task)); _delegate.emitDirect(task, stream, anchors, tuple); _delegate.flush(); }
private boolean finishBatch(TrackedBatch tracked, Tuple finishTuple) { boolean success = true; try { _bolt.finishBatch(tracked.info); String stream = COORD_STREAM(tracked.info.batchGroup); _collector.flush(); 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; }