test_class.declarator: time = new MockTime()
test_class.modifier: private final
test_class.original_string: private final MockTime time = new MockTime();
test_class.type: MockTime
test_class.var_name: time
test_class.declarator: systemTime = new SystemTime()
test_class.modifier: private final
test_class.original_string: private final SystemTime systemTime = new SystemTime();
test_class.type: SystemTime
test_class.var_name: systemTime
test_class.declarator: metrics = new Metrics(time)
test_class.modifier: private final
test_class.original_string: private final Metrics metrics = new Metrics(time);
test_class.type: Metrics
test_class.var_name: metrics
test_class.declarator: maxBlockTimeMs = 2000
test_class.modifier: private final
test_class.original_string: private final long maxBlockTimeMs = 2000;
test_class.type: long
test_class.var_name: maxBlockTimeMs
test_class.declarator: metricGroup = "TestMetrics"
test_class.modifier: private final
test_class.original_string: private final String metricGroup = "TestMetrics";
test_class.type: String
test_class.var_name: metricGroup
test_class.file: clients/src/test/java/org/apache/kafka/clients/producer/internals/BufferPoolTest.java
test_class.identifier: BufferPoolTest
test_case.body: @Test
      public void testStressfulSituation() throws Exception {
          int numThreads = 10;
          final int iterations = 50000;
          final int poolableSize = 1024;
          final long totalMemory = numThreads / 2 * poolableSize;
          final BufferPool pool = new BufferPool(totalMemory, poolableSize, metrics, time, metricGroup);
          List<StressTestThread> threads = new ArrayList<StressTestThread>();
          for (int i = 0; i < numThreads; i++)
              threads.add(new StressTestThread(pool, iterations));
          for (StressTestThread thread : threads)
              thread.start();
          for (StressTestThread thread : threads)
              thread.join();
          for (StressTestThread thread : threads)
              assertTrue("Thread should have completed all iterations successfully.", thread.success.get());
          assertEquals(totalMemory, pool.availableMemory());
      }
test_case.class_method_signature: BufferPoolTest.testStressfulSituation()
test_case.full_signature: @Test public void testStressfulSituation()
test_case.identifier: testStressfulSituation
test_case.invocations: add start join assertTrue get assertEquals availableMemory
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testStressfulSituation()
focal_class.declarator: totalMemory
focal_class.modifier: private final
focal_class.original_string: private final long totalMemory;
focal_class.type: long
focal_class.var_name: totalMemory
focal_class.declarator: poolableSize
focal_class.modifier: private final
focal_class.original_string: private final int poolableSize;
focal_class.type: int
focal_class.var_name: poolableSize
focal_class.declarator: lock
focal_class.modifier: private final
focal_class.original_string: private final ReentrantLock lock;
focal_class.type: ReentrantLock
focal_class.var_name: lock
focal_class.declarator: free
focal_class.modifier: private final
focal_class.original_string: private final Deque<ByteBuffer> free;
focal_class.type: Deque<ByteBuffer>
focal_class.var_name: free
focal_class.declarator: waiters
focal_class.modifier: private final
focal_class.original_string: private final Deque<Condition> waiters;
focal_class.type: Deque<Condition>
focal_class.var_name: waiters
focal_class.declarator: availableMemory
focal_class.modifier: private
focal_class.original_string: private long availableMemory;
focal_class.type: long
focal_class.var_name: availableMemory
focal_class.declarator: metrics
focal_class.modifier: private final
focal_class.original_string: private final Metrics metrics;
focal_class.type: Metrics
focal_class.var_name: metrics
focal_class.declarator: time
focal_class.modifier: private final
focal_class.original_string: private final Time time;
focal_class.type: Time
focal_class.var_name: time
focal_class.declarator: waitTime
focal_class.modifier: private final
focal_class.original_string: private final Sensor waitTime;
focal_class.type: Sensor
focal_class.var_name: waitTime
focal_class.file: clients/src/main/java/org/apache/kafka/clients/producer/internals/BufferPool.java
focal_class.identifier: BufferPool
focal_class.class_method_signature: BufferPool.BufferPool(long memory, int poolableSize, Metrics metrics, Time time, String metricGrpName)
focal_class.full_signature: public  BufferPool(long memory, int poolableSize, Metrics metrics, Time time, String metricGrpName)
focal_class.identifier: BufferPool
focal_class.modifiers: public
focal_class.parameters: (long memory, int poolableSize, Metrics metrics, Time time, String metricGrpName)
focal_class.signature:  BufferPool(long memory, int poolableSize, Metrics metrics, Time time, String metricGrpName)
focal_class.class_method_signature: BufferPool.allocate(int size, long maxTimeToBlockMs)
focal_class.full_signature: public ByteBuffer allocate(int size, long maxTimeToBlockMs)
focal_class.identifier: allocate
focal_class.modifiers: public
focal_class.parameters: (int size, long maxTimeToBlockMs)
focal_class.return: ByteBuffer
focal_class.signature: ByteBuffer allocate(int size, long maxTimeToBlockMs)
focal_class.class_method_signature: BufferPool.freeUp(int size)
focal_class.full_signature: private void freeUp(int size)
focal_class.identifier: freeUp
focal_class.modifiers: private
focal_class.parameters: (int size)
focal_class.return: void
focal_class.signature: void freeUp(int size)
focal_class.class_method_signature: BufferPool.deallocate(ByteBuffer buffer, int size)
focal_class.full_signature: public void deallocate(ByteBuffer buffer, int size)
focal_class.identifier: deallocate
focal_class.modifiers: public
focal_class.parameters: (ByteBuffer buffer, int size)
focal_class.return: void
focal_class.signature: void deallocate(ByteBuffer buffer, int size)
focal_class.class_method_signature: BufferPool.deallocate(ByteBuffer buffer)
focal_class.full_signature: public void deallocate(ByteBuffer buffer)
focal_class.identifier: deallocate
focal_class.modifiers: public
focal_class.parameters: (ByteBuffer buffer)
focal_class.return: void
focal_class.signature: void deallocate(ByteBuffer buffer)
focal_class.class_method_signature: BufferPool.availableMemory()
focal_class.full_signature: public long availableMemory()
focal_class.identifier: availableMemory
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long availableMemory()
focal_class.class_method_signature: BufferPool.unallocatedMemory()
focal_class.full_signature: public long unallocatedMemory()
focal_class.identifier: unallocatedMemory
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long unallocatedMemory()
focal_class.class_method_signature: BufferPool.queued()
focal_class.full_signature: public int queued()
focal_class.identifier: queued
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int queued()
focal_class.class_method_signature: BufferPool.poolableSize()
focal_class.full_signature: public int poolableSize()
focal_class.identifier: poolableSize
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int poolableSize()
focal_class.class_method_signature: BufferPool.totalMemory()
focal_class.full_signature: public long totalMemory()
focal_class.identifier: totalMemory
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long totalMemory()
focal_class.class_method_signature: BufferPool.waiters()
focal_class.full_signature:  Deque<Condition> waiters()
focal_class.identifier: waiters
focal_class.parameters: ()
focal_class.return: Deque<Condition>
focal_class.signature: Deque<Condition> waiters()
focal_method.body: public long availableMemory() {
          lock.lock();
          try {
              return this.availableMemory + this.free.size() * this.poolableSize;
          } finally {
              lock.unlock();
          }
      }
focal_method.class_method_signature: BufferPool.availableMemory()
focal_method.full_signature: public long availableMemory()
focal_method.identifier: availableMemory
focal_method.invocations: lock size unlock
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: long
focal_method.signature: long availableMemory()