public void nextTuple() { Utils.sleep(100); }
public void nextTuple() { Utils.sleep(100); }
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 boolean isReady(long txid) { if(!_waitToEmit) return true; List allBatches = (List) RegisteredGlobalState.getState(_id); if(allBatches.size() > _masterEmitted) { _masterEmitted++; return true; } else { Utils.sleep(2); return false; } } }
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() { 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)); }
/** * Meant to be called only by the supervisor for stormjar/stormconf/stormcode files. * * @param key * @param localFile * @param cb * @throws KeyNotFoundException * @throws IOException */ public static void downloadResourcesAsSupervisorDirect(String key, String localFile, ClientBlobStore cb) throws KeyNotFoundException, IOException { final int MAX_RETRY_ATTEMPTS = 2; final int ATTEMPTS_INTERVAL_TIME = 100; for (int retryAttempts = 0; retryAttempts < MAX_RETRY_ATTEMPTS; retryAttempts++) { if (downloadResourcesAsSupervisorAttempt(cb, key, localFile)) { break; } Utils.sleep(ATTEMPTS_INTERVAL_TIME); } }
@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); }
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)); }
public void nextTuple() { List<Object> tuple = (List<Object>) InprocMessaging.pollMessage(_id); if(tuple!=null) { _collector.emit(tuple, UUID.randomUUID().toString()); } else { Utils.sleep(10); } }
public void serializer(KryoTupleSerializer serializer) { LOG.debug("start serializer of task: {}", taskId); if (!AsyncLoopRunnable.getShutdown().get()) { //note: sleep 1ms to reduce cpu usage when serializeQueue is empty if (serializeQueue.population() == 0) { Utils.sleep(1); return; } try { List<Object> objects = serializeQueue.retreiveAvailableBatch(); for (Object object : objects) { if (object == null) { continue; } serialize(serializer, object); } } catch (InterruptedException e) { LOG.error("InterruptedException " + e.getCause()); } catch (TimeoutException ignored) { } catch (AlertException e) { LOG.error(e.getMessage(), e); throw new RuntimeException(e); } } }
@Override public void nextTuple() { if (shouldRecover()) { handleRecovery(); startProgress(); } else if (shouldCheckpoint()) { doCheckpoint(); startProgress(); } else { Utils.sleep(sleepInterval); } }
Utils.sleep(1);
Utils.sleep(1);
LocalCluster cluster = new LocalCluster(); cluster.submitTopology("wordCounter", conf, buildTopology(mapState, windowConfig)); Utils.sleep(60 * 1000); cluster.shutdown();
@Override public void nextTuple() { getSomeMoreTuples(); if (this.tuples.size() == 0) { Utils.sleep(10); return; } final EmitItem poll = this.tuples.poll(); collector.emit(poll.tuple, poll.sourceId); // collector.emit(poll.tuple); }
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)); }