public void fail(Tuple tup) { _collector.fail(tup); } }
public void fail(Tuple input) { out.fail(input); }
public void fail(Tuple tup) { _collector.fail(tup); } }
@Override public void expire(List<Object> id, Map<GlobalStreamId, Tuple> tuples) { for (Tuple tuple : tuples.values()) { _collector.fail(tuple); } } }
private void handleFail(Object id) { Tuple failed = _inputs.remove(id); if (failed == null) { throw new RuntimeException("Failed a non-existent or already acked/failed id: " + id); } _collector.fail(failed); }
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; } }
public void fail(Tuple tuple, OutputCollector collector) { _collector.fail(tuple); JStormUtils.reportError(topologyContext, "Receive invalid tuple"); }
public void fail(Tuple tuple) { Object id = tuple.getValue(0); synchronized (_tracked) { TrackingInfo track = _tracked.get(id); if (track != null) track.failed = true; } checkFinishId(tuple, TupleType.REGULAR); _delegate.fail(tuple); }
@Override public void execute(Tuple input) { TMHandler tmHandler = handlers.get(input.getSourceStreamId()); if (tmHandler == null) { LOG.error("No handler of " + input.getSourceStreamId()); tmContext.getCollector().fail(input); return; } TMEvent event = new TMEvent(tmHandler, input); threadPools.submit(event); tmContext.getCollector().ack(input); }
private void checkFinish(TrackedBatch tracked, Tuple tuple, TupleType type) { if (tracked.failed) { failBatch(tracked); _collector.fail(tuple); return; } CoordCondition cond = tracked.condition; boolean delayed = tracked.delayedAck == null && (cond.commitStream != null && type == TupleType.COMMIT || cond.commitStream == null); if (delayed) { tracked.delayedAck = tuple; } boolean failed = false; if (tracked.receivedCommit && tracked.reportedTasks == cond.expectedTaskReports) { if (tracked.receivedTuples == tracked.expectedTupleCount) { finishBatch(tracked, tuple); } else { //TODO: add logging that not all tuples were received failBatch(tracked); _collector.fail(tuple); failed = true; } } if (!delayed && !failed) { _collector.ack(tuple); } }
public void ack(Tuple tuple) { Object id = tuple.getValue(0); synchronized (_tracked) { TrackingInfo track = _tracked.get(id); if (track != null) track.receivedTuples++; } boolean failed = checkFinishId(tuple, TupleType.REGULAR); if (failed) { _delegate.fail(tuple); } else { _delegate.ack(tuple); } }
public void handleCommit(Tuple tuple) { Object id = tuple.getValue(0); try { byte[] commitResult = ((ICommitter) delegate).commit((BatchId) id); collector.ack(tuple); updateToZk(id, commitResult); commited.put(id, commitResult); } catch (Exception e) { LOG.error("Failed to commit ", e); collector.fail(tuple); } }
public void handleRegular(Tuple tuple) { basicCollector.setContext(tuple); try { delegate.execute(tuple, basicCollector); collector.ack(tuple); } catch (FailedException e) { if (e instanceof ReportedFailedException) { collector.reportError(e); } collector.fail(tuple); } }
public void handlePrepareCommit(Tuple tuple) { basicCollector.setContext(tuple); try { BatchId id = (BatchId) tuple.getValue(0); ((IPrepareCommit) delegate).prepareCommit(id, basicCollector); collector.ack(tuple); } catch (FailedException e) { if (e instanceof ReportedFailedException) { collector.reportError(e); } collector.fail(tuple); } }
} catch(TException e) { LOG.error("Failed to return results to DRPC server", e); _collector.fail(input);
} else { LOG.info("Unknow source component: " + input.getSourceComponent()); collector.fail(input); return;
@Override public void execute(Tuple tuple) { try { String index = mapper.getIndex(tuple); String type = mapper.getType(tuple); String id = mapper.getId(tuple); GetResponse response = client.prepareGet(index, type, id).execute() .actionGet(); collector.emit(esOutputDeclarer.getValues(response.getSource())); collector.ack(tuple); } catch (Exception e) { collector.fail(tuple); } }
LOG.error("Failed to send message, SendResult:" + sendResult + "\n", e); runCounter.count(System.currentTimeMillis() - before); collector.fail(tuple); return ;
@Override public void execute(Tuple tuple) { try { String index = mapper.getIndex(tuple); String type = mapper.getType(tuple); String id = mapper.getId(tuple); String source = mapper.getSource(tuple); OpType opType = mapper.getOpType(); client.prepareIndex(index, type).setId(id).setSource(source) .setOpType(opType).execute(); collector.ack(tuple); } catch (Exception e) { collector.fail(tuple); } }