@Override public void flush() throws InterruptedException { spoutInQ.flush(); } }
public void flushRemotes() throws InterruptedException { transferQueue.flush(); }
private void flushLocal() throws InterruptedException { for (int i = 0; i < queuesToFlush.length(); i++) { JCQueue q = queuesToFlush.get(i); if (q != null) { q.flush(); queuesToFlush.set(i, null); } } }
protected void setupMetrics() { for (final Integer interval : intervalToTaskToMetricToRegistry.keySet()) { StormTimer timerTask = workerData.getUserTimer(); timerTask.scheduleRecurring(interval, interval, () -> { TupleImpl tuple = new TupleImpl(workerTopologyContext, new Values(interval), Constants.SYSTEM_COMPONENT_ID, (int) Constants.SYSTEM_TASK_ID, Constants.METRICS_TICK_STREAM_ID); AddressedTuple metricsTickTuple = new AddressedTuple(AddressedTuple.BROADCAST_DEST, tuple); try { receiveQueue.publish(metricsTickTuple); receiveQueue.flush(); // avoid buffering } catch (InterruptedException e) { LOG.warn("Thread interrupted when publishing metrics. Setting interrupt flag."); Thread.currentThread().interrupt(); return; } } ); } }
try { receiveQueue.publish(tickTuple); receiveQueue.flush(); // avoid buffering } catch (InterruptedException e) { LOG.warn("Thread interrupted when emitting tick tuple. Setting interrupt flag.");
@Override public void credentialsChanged(Credentials credentials) { TupleImpl tuple = new TupleImpl(executor.getWorkerTopologyContext(), new Values(credentials), Constants.SYSTEM_COMPONENT_ID, (int) Constants.SYSTEM_TASK_ID, Constants.CREDENTIALS_CHANGED_STREAM_ID); AddressedTuple addressedTuple = new AddressedTuple(AddressedTuple.BROADCAST_DEST, tuple); try { executor.getReceiveQueue().publish(addressedTuple); executor.getReceiveQueue().flush(); } catch (InterruptedException e) { throw new RuntimeException(e); } }