/** * Hands off tuple to the wrapped bolt to execute. * * <p> * Right now tuples continue to get forwarded while waiting for checkpoints to arrive on other streams after checkpoint arrives on one * of the streams. This can cause duplicates but still at least once. * </p> * * @param input the input tuple */ protected void handleTuple(Tuple input) { bolt.execute(input); } }
public void run() { try { while (true) { _delegate.execute(_rrQueue.take()); } } catch (InterruptedException e) { } } });
} else { synchronized (_tracked) { _delegate.execute(tuple);
/** * Hands off tuple to the wrapped bolt to execute. * * <p> * Right now tuples continue to get forwarded while waiting for checkpoints to arrive on other streams * after checkpoint arrives on one of the streams. This can cause duplicates but still at least once. * </p> * * @param input the input tuple */ protected void handleTuple(Tuple input) { bolt.execute(input); } }
@Override public void execute(com.twitter.heron.api.tuple.Tuple tuple) { TupleImpl impl = new TupleImpl(tuple); delegate.execute(impl); }
public void run() { try { while(true) { _delegate.execute(_rrQueue.take()); } } catch (InterruptedException e) { } } });
@Override public void processElement(final StreamRecord<StormTuple<IN>> element) throws Exception { this.flinkCollector.setTimestamp(element); this.bolt.execute(element.getValue()); }
@Override public void processElement(final StreamRecord<IN> element) throws Exception { this.flinkCollector.setTimestamp(element); IN value = element.getValue(); if (this.stormTopology != null) { Tuple tuple = (Tuple) value; Integer producerTaskId = tuple.getField(tuple.getArity() - 1); this.bolt.execute(new StormTuple<>(value, this.inputSchemas.get(producerTaskId), producerTaskId, this.inputStreamIds.get(producerTaskId), this.inputComponentIds .get(producerTaskId), MessageId.makeUnanchored())); } else { this.bolt.execute(new StormTuple<>(value, this.inputSchemas.get(null), -1, null, null, MessageId.makeUnanchored())); } } }
private static void sendRawByteTuplesTo(IRichBolt bolt, String id, List<byte[]> data) { for (byte[] b : data) { Tuple tuple = TupleUtils.makeIDTuple(TupleClassifier.Type.DATA_TUPLE, id, b); bolt.execute(tuple); } }
private static List<BulletRecord> sendRawRecordTuplesTo(IRichBolt bolt, String id, int n, int batchSize) { List<BulletRecord> sent = new ArrayList<>(); for (int i = 0; i < n; i += batchSize) { BulletRecord[] batch = new BulletRecord[batchSize]; for (int j = 0; j < batchSize; ++j) { batch[j] = RecordBox.get().add("field", String.valueOf(i + j)).getRecord(); } Tuple tuple = TupleUtils.makeIDTuple(TupleClassifier.Type.DATA_TUPLE, id, getListBytes(batch)); bolt.execute(tuple); sent.addAll(asList(batch)); } return sent; }
private static List<BulletRecord> sendSlidingWindowWithRawRecordTuplesTo(IRichBolt bolt, String id, int n) { BulletRecord[] sent = new BulletRecord[n]; for (int i = 0; i < n; ++i) { sent[i] = RecordBox.get().add("field", String.valueOf(i)).getRecord(); } byte[] listBytes = getListBytes(sent); byte[] dataBytes = SerializerDeserializer.toBytes(new SlidingRecord.Data(sent.length, listBytes)); Tuple tuple = TupleUtils.makeIDTuple(TupleClassifier.Type.DATA_TUPLE, id, dataBytes); bolt.execute(tuple); return asList(sent); }
} else { synchronized(_tracked) { _delegate.execute(tuple);