@Test public void shouldReadNothingFromEmptyBuffer() { final long head = 0L; when(buffer.getLong(HEAD_COUNTER_INDEX)).thenReturn(head); final MessageHandler handler = (msgTypeId, buffer, index, length) -> fail("should not be called"); final int messagesRead = ringBuffer.read(handler); assertThat(messagesRead, is(0)); }
public int read(final MessageHandler handler) { return read(handler, Integer.MAX_VALUE); }
ManyToOneRingBuffer implements RingBuffer { public int read(final MessageHandler handler) { return read(handler, Integer.MAX_VALUE); } }
ManyToOneRingBuffer implements RingBuffer { public int read(final MessageHandler handler) { return read(handler, Integer.MAX_VALUE); } ManyToOneRingBuffer(final AtomicBuffer buffer); }
ManyToOneRingBuffer implements RingBuffer { public int read(final MessageHandler handler) { return read(handler, Integer.MAX_VALUE); } ManyToOneRingBuffer(final AtomicBuffer buffer); int capacity(); boolean write(final int msgTypeId, final DirectBuffer srcBuffer, final int offset, final int length); int read(final MessageHandler handler); int read(final MessageHandler handler, final int messageCountLimit); int maxMsgLength(); long nextCorrelationId(); AtomicBuffer buffer(); void consumerHeartbeatTime(final long time); long consumerHeartbeatTime(); long producerPosition(); long consumerPosition(); int size(); boolean unblock(); int tryClaim(final int msgTypeId, final int length); void commit(final int index); void abort(final int index); }
ManyToOneRingBuffer implements RingBuffer { public int read(final MessageHandler handler) { return read(handler, Integer.MAX_VALUE); } ManyToOneRingBuffer(final AtomicBuffer buffer); int capacity(); boolean write(final int msgTypeId, final DirectBuffer srcBuffer, final int offset, final int length); int read(final MessageHandler handler); int read(final MessageHandler handler, final int messageCountLimit); int maxMsgLength(); long nextCorrelationId(); AtomicBuffer buffer(); void consumerHeartbeatTime(final long time); long consumerHeartbeatTime(); long producerPosition(); long consumerPosition(); int size(); boolean unblock(); int tryClaim(final int msgTypeId, final int length); void commit(final int index); void abort(final int index);  }