Class ShareFetchBufferTest

java.lang.Object
org.apache.kafka.clients.consumer.internals.ShareFetchBufferTest

public class ShareFetchBufferTest extends Object
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:
  1. A special "next in line" buffer
  2. The remainder of the buffers in a queue
  • 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()
      Verifies ShareFetchBuffer.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

      @Test public void testWakeup() throws Exception
      Throws:
      Exception