Class ShareFetchBufferTest
java.lang.Object
org.apache.kafka.clients.consumer.internals.ShareFetchBufferTest
This tests the
ShareFetchBuffer functionality.
One of the main concerns of these tests are that we correctly handle both places that data is held internally:
- A special "next in line" buffer
- The remainder of the buffers in a queue
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetup()voidVerifies the basics: we can add buffered data to the queue, peek to view them, and poll to remove them.voidTests that a fetch which has been consumed but whose acknowledgements are still outstanding continues to be reported as buffered, thus preventing the share session for its node being closed prematurely.voidTests that the buffer returns partitions for both the queue and the next-in-line buffer.voidVerifiesShareFetchBuffer.close()} closes the buffered data for both the queue and the next-in-line buffer.voidvoidvoidvoid
-
Constructor Details
-
ShareFetchBufferTest
public ShareFetchBufferTest()
-
-
Method Details
-
setup
@BeforeEach public void setup() -
testBasicPeekAndPoll
@Test public void testBasicPeekAndPoll()Verifies the basics: we can add buffered data to the queue, peek to view them, and poll to remove them. -
testCloseClearsData
@Test public void testCloseClearsData()VerifiesShareFetchBuffer.close()} closes the buffered data for both the queue and the next-in-line buffer. -
testBufferedPartitions
@Test public void testBufferedPartitions()Tests that the buffer returns partitions for both the queue and the next-in-line buffer. -
testBufferedIncludesConsumedFetchWithPendingAcknowledgements
@Test public void testBufferedIncludesConsumedFetchWithPendingAcknowledgements()Tests that a fetch which has been consumed but whose acknowledgements are still outstanding continues to be reported as buffered, thus preventing the share session for its node being closed prematurely. -
testRetainsEvictedFetchWithPendingAcknowledgements
@Test public void testRetainsEvictedFetchWithPendingAcknowledgements() -
testRetainsEvictedFetchWithPendingRenewAcknowledgements
@Test public void testRetainsEvictedFetchWithPendingRenewAcknowledgements() -
testCloseClearsPendingAcknowledgementFetches
@Test public void testCloseClearsPendingAcknowledgementFetches() -
testWakeup
-