/** * Emits a tuple to the default output stream with a null message id. Storm * will not track this message so ack and fail will never be called for this * tuple. The emitted values must be immutable. */ public List<Integer> emit(List<Object> tuple) { return emit(tuple, null); }
@Override public void nextTuple() { int n = tupleNumPerBatch; while (--n >= 0) { collector.emit(new Values(CHOICES[index])); index = (++index) % CHOICES.length; } collector.emitBarrier(); printSendTps(tupleNumPerBatch); }
/** * Emits a tuple to the specified output stream with a null message id. * Storm will not track this message so ack and fail will never be called * for this tuple. The emitted values must be immutable. */ public List<Integer> emit(String streamId, List<Object> tuple) { return emit(streamId, tuple, null); }
@Override public void nextTuple() { int sendNum = sendNumEachTime; while (--sendNum >= 0) { ++count; collector.emit(new Values(count), count); } }
public void nextTuple() { if (_serveTuples.size() > 0) { FixedTuple ft = _serveTuples.remove(0); String id = UUID.randomUUID().toString(); _pending.put(id, ft); _collector.emit(ft.stream, ft.values, id); } else { Utils.sleep(100); } }
@Override public void nextTuple() { String sentence = CHOICES[index++]; if (index >= CHOICES.length) { index = 0; } collector.emit(new Values(sentence)); }
@Override public void fail(Object msgId) { Integer val = (Integer) msgId; collector.emit(new Values(val), val); }
@Override public void nextTuple() { Values v = new Values(_base, _i); _collector.emit(v, "ACK"); _i++; }
public void nextTuple() { if (eventId < myCount) { eventId++; _collector.emit(new Values(source, eventId), eventId); } }
public List<Integer> emit(String streamId, List<Object> tuple, Object messageId) { List<Integer> ret = _collector.emit(streamId, tuple, messageId); recordSpoutEmit(); return ret; }
@Override public void nextTuple() { Utils.sleep(100); collector.emit(new Values(rand.nextInt(1000), System.currentTimeMillis() - (24 * 60 * 60 * 1000), ++msgId), msgId); }
public void nextTuple() { Utils.sleep(100); final String[] words = new String[] { "nathan", "mike", "jackson", "golda", "bertels" }; final Random rand = new Random(); final String word = words[rand.nextInt(words.length)]; _collector.emit(new Values(word)); }
@Override public void nextTuple() { Utils.sleep(100); String[] sentences = new String[] { "the cow jumped over the moon", "an apple a day keeps the doctor away", "four score and seven years ago", "snow white and the seven dwarfs", "i am at two with nature" }; String sentence = sentences[_rand.nextInt(sentences.length)]; _collector.emit(new Values(sentence)); }
@Override public void nextTuple() { Utils.sleep(10); collector.emit(new Values(rand.nextInt(1000), ip, port), msgId); }
@Override public void nextTuple() { String sentence = CHOICES[index]; collector.emit(new Values(sentence), ++msgId); index = (++index) % CHOICES.length; printSendTps(1); }
@Override public void nextTuple() { String sentence = CHOICES[index]; collector.emit(new Values(sentence)); index = (++index) % CHOICES.length; printSendTps(1); }
@Override public void nextTuple() { String sentence = CHOICES[index++]; if (index >= CHOICES.length) { index = 0; } collector.emit(new Values(sentence)); JStormUtils.sleepMs(50); }
@Override public void nextTuple() { sentNum++; String sentence = CHOICES[index++]; if (index >= CHOICES.length) { index = 0; } _collector.emit(new Values(sentence)); JStormUtils.sleepMs(1); }
public void sendTuple(OnsTuple OnsTuple) { OnsTuple.updateEmitMs(); collector.emit(new Values(OnsTuple), OnsTuple.getCreateMs()); }