@Test public void flushesHaveTraces() throws Exception { TracingEventHandler<Integer, Long> tracingHandler = new TracingEventHandler<>(delegate, 10); DisruptorFuture<Long> eventFuture = Tracers.wrapListenableFuture("test", () -> { TestBatchElement element = new TestBatchElement(); try { tracingHandler.onEvent(element, 45, true); } catch (Exception e) { throw new RuntimeException(e); } return element.result(); }); eventFuture.get(); }
@Override public void onEvent(BatchElement<I, O> event, long sequence, boolean endOfBatch) throws Exception { pending.add(event); if (endOfBatch) { pending.forEach(e -> e.result().running()); handler.onEvent(event, sequence, true); pending.clear(); } else { handler.onEvent(event, sequence, false); } }
TracingEventHandler implements EventHandler<BatchElement<I, O>> { @Override public void onEvent(BatchElement<I, O> event, long sequence, boolean endOfBatch) throws Exception { pending.add(event); if (endOfBatch) { pending.forEach(e -> e.result().running()); handler.onEvent(event, sequence, true); pending.clear(); } else { handler.onEvent(event, sequence, false); } } }
TracingEventHandler implements EventHandler<BatchElement<I, O>> { @Override public void onEvent(BatchElement<I, O> event, long sequence, boolean endOfBatch) throws Exception { pending.add(event); if (endOfBatch) { pending.forEach(e -> e.result().running()); handler.onEvent(event, sequence, true); pending.clear(); } else { handler.onEvent(event, sequence, false); } } TracingEventHandler(
            EventHandler<BatchElement<I, O>> delegate,
            int bufferSize); }
TracingEventHandler implements EventHandler<BatchElement<I, O>> { @Override public void onEvent(BatchElement<I, O> event, long sequence, boolean endOfBatch) throws Exception { pending.add(event); if (endOfBatch) { pending.forEach(e -> e.result().running()); handler.onEvent(event, sequence, true); pending.clear(); } else { handler.onEvent(event, sequence, false); } } TracingEventHandler(
            EventHandler<BatchElement<I, O>> delegate,
            int bufferSize); @Override void onEvent(BatchElement<I, O> event, long sequence, boolean endOfBatch); }
TracingEventHandler implements EventHandler<BatchElement<I, O>> { @Override public void onEvent(BatchElement<I, O> event, long sequence, boolean endOfBatch) throws Exception { pending.add(event); if (endOfBatch) { pending.forEach(e -> e.result().running()); handler.onEvent(event, sequence, true); pending.clear(); } else { handler.onEvent(event, sequence, false); } } TracingEventHandler(
            EventHandler<BatchElement<I, O>> delegate,
            int bufferSize); @Override void onEvent(BatchElement<I, O> event, long sequence, boolean endOfBatch);  }