test_class.declarator: topic = "test"
test_class.modifier: private final
test_class.original_string: private final String topic = "test";
test_class.type: String
test_class.var_name: topic
test_class.declarator: tp0 = new TopicPartition("test", 0)
test_class.modifier: private final
test_class.original_string: private final TopicPartition tp0 = new TopicPartition("test", 0);
test_class.type: TopicPartition
test_class.var_name: tp0
test_class.file: clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java
test_class.identifier: KafkaConsumerTest
test_case.body: @Test
      public void testInterceptorConstructorClose() throws Exception {
          try {
              Properties props = new Properties();
              // test with client ID assigned by KafkaConsumer
              props.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9999");
              props.setProperty(ConsumerConfig.INTERCEPTOR_CLASSES_CONFIG, MockConsumerInterceptor.class.getName());
  
              KafkaConsumer<String, String> consumer = new KafkaConsumer<String, String>(
                      props, new StringDeserializer(), new StringDeserializer());
              assertEquals(1, MockConsumerInterceptor.INIT_COUNT.get());
              assertEquals(0, MockConsumerInterceptor.CLOSE_COUNT.get());
  
              consumer.close();
              assertEquals(1, MockConsumerInterceptor.INIT_COUNT.get());
              assertEquals(1, MockConsumerInterceptor.CLOSE_COUNT.get());
          } finally {
              // cleanup since we are using mutable static variables in MockConsumerInterceptor
              MockConsumerInterceptor.resetCounters();
          }
      }
test_case.class_method_signature: KafkaConsumerTest.testInterceptorConstructorClose()
test_case.full_signature: @Test public void testInterceptorConstructorClose()
test_case.identifier: testInterceptorConstructorClose
test_case.invocations: setProperty setProperty getName assertEquals get assertEquals get close assertEquals get assertEquals get resetCounters
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInterceptorConstructorClose()
focal_class.declarator: log = LoggerFactory.getLogger(KafkaConsumer.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(KafkaConsumer.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: NO_CURRENT_THREAD = -1L
focal_class.modifier: private static final
focal_class.original_string: private static final long NO_CURRENT_THREAD = -1L;
focal_class.type: long
focal_class.var_name: NO_CURRENT_THREAD
focal_class.declarator: CONSUMER_CLIENT_ID_SEQUENCE = new AtomicInteger(1)
focal_class.modifier: private static final
focal_class.original_string: private static final AtomicInteger CONSUMER_CLIENT_ID_SEQUENCE = new AtomicInteger(1);
focal_class.type: AtomicInteger
focal_class.var_name: CONSUMER_CLIENT_ID_SEQUENCE
focal_class.declarator: JMX_PREFIX = "kafka.consumer"
focal_class.modifier: private static final
focal_class.original_string: private static final String JMX_PREFIX = "kafka.consumer";
focal_class.type: String
focal_class.var_name: JMX_PREFIX
focal_class.declarator: clientId
focal_class.modifier: private final
focal_class.original_string: private final String clientId;
focal_class.type: String
focal_class.var_name: clientId
focal_class.declarator: coordinator
focal_class.modifier: private final
focal_class.original_string: private final ConsumerCoordinator coordinator;
focal_class.type: ConsumerCoordinator
focal_class.var_name: coordinator
focal_class.declarator: keyDeserializer
focal_class.modifier: private final
focal_class.original_string: private final Deserializer<K> keyDeserializer;
focal_class.type: Deserializer<K>
focal_class.var_name: keyDeserializer
focal_class.declarator: valueDeserializer
focal_class.modifier: private final
focal_class.original_string: private final Deserializer<V> valueDeserializer;
focal_class.type: Deserializer<V>
focal_class.var_name: valueDeserializer
focal_class.declarator: fetcher
focal_class.modifier: private final
focal_class.original_string: private final Fetcher<K, V> fetcher;
focal_class.type: Fetcher<K, V>
focal_class.var_name: fetcher
focal_class.declarator: interceptors
focal_class.modifier: private final
focal_class.original_string: private final ConsumerInterceptors<K, V> interceptors;
focal_class.type: ConsumerInterceptors<K, V>
focal_class.var_name: interceptors
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: client
focal_class.modifier: private final
focal_class.original_string: private final ConsumerNetworkClient client;
focal_class.type: ConsumerNetworkClient
focal_class.var_name: client
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: subscriptions
focal_class.modifier: private final
focal_class.original_string: private final SubscriptionState subscriptions;
focal_class.type: SubscriptionState
focal_class.var_name: subscriptions
focal_class.declarator: metadata
focal_class.modifier: private final
focal_class.original_string: private final Metadata metadata;
focal_class.type: Metadata
focal_class.var_name: metadata
focal_class.declarator: retryBackoffMs
focal_class.modifier: private final
focal_class.original_string: private final long retryBackoffMs;
focal_class.type: long
focal_class.var_name: retryBackoffMs
focal_class.declarator: requestTimeoutMs
focal_class.modifier: private final
focal_class.original_string: private final long requestTimeoutMs;
focal_class.type: long
focal_class.var_name: requestTimeoutMs
focal_class.declarator: closed = false
focal_class.modifier: private
focal_class.original_string: private boolean closed = false;
focal_class.type: boolean
focal_class.var_name: closed
focal_class.declarator: currentThread = new AtomicLong(NO_CURRENT_THREAD)
focal_class.modifier: private final
focal_class.original_string: private final AtomicLong currentThread = new AtomicLong(NO_CURRENT_THREAD);
focal_class.type: AtomicLong
focal_class.var_name: currentThread
focal_class.declarator: refcount = new AtomicInteger(0)
focal_class.modifier: private final
focal_class.original_string: private final AtomicInteger refcount = new AtomicInteger(0);
focal_class.type: AtomicInteger
focal_class.var_name: refcount
focal_class.file: clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
focal_class.identifier: KafkaConsumer
focal_class.interfaces: implements Consumer<K, V>
focal_class.class_method_signature: KafkaConsumer.KafkaConsumer(Map<String, Object> configs)
focal_class.full_signature: public  KafkaConsumer(Map<String, Object> configs)
focal_class.identifier: KafkaConsumer
focal_class.modifiers: public
focal_class.parameters: (Map<String, Object> configs)
focal_class.signature:  KafkaConsumer(Map<String, Object> configs)
focal_class.class_method_signature: KafkaConsumer.KafkaConsumer(Map<String, Object> configs,
          Deserializer<K> keyDeserializer,
          Deserializer<V> valueDeserializer)
focal_class.full_signature: public  KafkaConsumer(Map<String, Object> configs,
          Deserializer<K> keyDeserializer,
          Deserializer<V> valueDeserializer)
focal_class.identifier: KafkaConsumer
focal_class.modifiers: public
focal_class.parameters: (Map<String, Object> configs,
          Deserializer<K> keyDeserializer,
          Deserializer<V> valueDeserializer)
focal_class.signature:  KafkaConsumer(Map<String, Object> configs,
          Deserializer<K> keyDeserializer,
          Deserializer<V> valueDeserializer)
focal_class.class_method_signature: KafkaConsumer.KafkaConsumer(Properties properties)
focal_class.full_signature: public  KafkaConsumer(Properties properties)
focal_class.identifier: KafkaConsumer
focal_class.modifiers: public
focal_class.parameters: (Properties properties)
focal_class.signature:  KafkaConsumer(Properties properties)
focal_class.class_method_signature: KafkaConsumer.KafkaConsumer(Properties properties,
          Deserializer<K> keyDeserializer,
          Deserializer<V> valueDeserializer)
focal_class.full_signature: public  KafkaConsumer(Properties properties,
          Deserializer<K> keyDeserializer,
          Deserializer<V> valueDeserializer)
focal_class.identifier: KafkaConsumer
focal_class.modifiers: public
focal_class.parameters: (Properties properties,
          Deserializer<K> keyDeserializer,
          Deserializer<V> valueDeserializer)
focal_class.signature:  KafkaConsumer(Properties properties,
          Deserializer<K> keyDeserializer,
          Deserializer<V> valueDeserializer)
focal_class.class_method_signature: KafkaConsumer.KafkaConsumer(ConsumerConfig config,
          Deserializer<K> keyDeserializer,
          Deserializer<V> valueDeserializer)
focal_class.full_signature: @SuppressWarnings("unchecked") private  KafkaConsumer(ConsumerConfig config,
          Deserializer<K> keyDeserializer,
          Deserializer<V> valueDeserializer)
focal_class.identifier: KafkaConsumer
focal_class.modifiers: @SuppressWarnings("unchecked") private
focal_class.parameters: (ConsumerConfig config,
          Deserializer<K> keyDeserializer,
          Deserializer<V> valueDeserializer)
focal_class.signature:  KafkaConsumer(ConsumerConfig config,
          Deserializer<K> keyDeserializer,
          Deserializer<V> valueDeserializer)
focal_class.class_method_signature: KafkaConsumer.KafkaConsumer(String clientId,
          ConsumerCoordinator coordinator,
          Deserializer<K> keyDeserializer,
          Deserializer<V> valueDeserializer,
          Fetcher<K, V> fetcher,
          ConsumerInterceptors<K, V> interceptors,
          Time time,
          ConsumerNetworkClient client,
          Metrics metrics,
          SubscriptionState subscriptions,
          Metadata metadata,
          long retryBackoffMs,
          long requestTimeoutMs)
focal_class.full_signature:   KafkaConsumer(String clientId,
          ConsumerCoordinator coordinator,
          Deserializer<K> keyDeserializer,
          Deserializer<V> valueDeserializer,
          Fetcher<K, V> fetcher,
          ConsumerInterceptors<K, V> interceptors,
          Time time,
          ConsumerNetworkClient client,
          Metrics metrics,
          SubscriptionState subscriptions,
          Metadata metadata,
          long retryBackoffMs,
          long requestTimeoutMs)
focal_class.identifier: KafkaConsumer
focal_class.parameters: (String clientId,
          ConsumerCoordinator coordinator,
          Deserializer<K> keyDeserializer,
          Deserializer<V> valueDeserializer,
          Fetcher<K, V> fetcher,
          ConsumerInterceptors<K, V> interceptors,
          Time time,
          ConsumerNetworkClient client,
          Metrics metrics,
          SubscriptionState subscriptions,
          Metadata metadata,
          long retryBackoffMs,
          long requestTimeoutMs)
focal_class.signature:  KafkaConsumer(String clientId,
          ConsumerCoordinator coordinator,
          Deserializer<K> keyDeserializer,
          Deserializer<V> valueDeserializer,
          Fetcher<K, V> fetcher,
          ConsumerInterceptors<K, V> interceptors,
          Time time,
          ConsumerNetworkClient client,
          Metrics metrics,
          SubscriptionState subscriptions,
          Metadata metadata,
          long retryBackoffMs,
          long requestTimeoutMs)
focal_class.class_method_signature: KafkaConsumer.assignment()
focal_class.full_signature: public Set<TopicPartition> assignment()
focal_class.identifier: assignment
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Set<TopicPartition>
focal_class.signature: Set<TopicPartition> assignment()
focal_class.class_method_signature: KafkaConsumer.subscription()
focal_class.full_signature: public Set<String> subscription()
focal_class.identifier: subscription
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Set<String>
focal_class.signature: Set<String> subscription()
focal_class.class_method_signature: KafkaConsumer.subscribe(Collection<String> topics, ConsumerRebalanceListener listener)
focal_class.full_signature: @Override public void subscribe(Collection<String> topics, ConsumerRebalanceListener listener)
focal_class.identifier: subscribe
focal_class.modifiers: @Override public
focal_class.parameters: (Collection<String> topics, ConsumerRebalanceListener listener)
focal_class.return: void
focal_class.signature: void subscribe(Collection<String> topics, ConsumerRebalanceListener listener)
focal_class.class_method_signature: KafkaConsumer.subscribe(Collection<String> topics)
focal_class.full_signature: @Override public void subscribe(Collection<String> topics)
focal_class.identifier: subscribe
focal_class.modifiers: @Override public
focal_class.parameters: (Collection<String> topics)
focal_class.return: void
focal_class.signature: void subscribe(Collection<String> topics)
focal_class.class_method_signature: KafkaConsumer.subscribe(Pattern pattern, ConsumerRebalanceListener listener)
focal_class.full_signature: @Override public void subscribe(Pattern pattern, ConsumerRebalanceListener listener)
focal_class.identifier: subscribe
focal_class.modifiers: @Override public
focal_class.parameters: (Pattern pattern, ConsumerRebalanceListener listener)
focal_class.return: void
focal_class.signature: void subscribe(Pattern pattern, ConsumerRebalanceListener listener)
focal_class.class_method_signature: KafkaConsumer.unsubscribe()
focal_class.full_signature: public void unsubscribe()
focal_class.identifier: unsubscribe
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void unsubscribe()
focal_class.class_method_signature: KafkaConsumer.assign(Collection<TopicPartition> partitions)
focal_class.full_signature: @Override public void assign(Collection<TopicPartition> partitions)
focal_class.identifier: assign
focal_class.modifiers: @Override public
focal_class.parameters: (Collection<TopicPartition> partitions)
focal_class.return: void
focal_class.signature: void assign(Collection<TopicPartition> partitions)
focal_class.class_method_signature: KafkaConsumer.poll(long timeout)
focal_class.full_signature: @Override public ConsumerRecords<K, V> poll(long timeout)
focal_class.identifier: poll
focal_class.modifiers: @Override public
focal_class.parameters: (long timeout)
focal_class.return: ConsumerRecords<K, V>
focal_class.signature: ConsumerRecords<K, V> poll(long timeout)
focal_class.class_method_signature: KafkaConsumer.pollOnce(long timeout)
focal_class.full_signature: private Map<TopicPartition, List<ConsumerRecord<K, V>>> pollOnce(long timeout)
focal_class.identifier: pollOnce
focal_class.modifiers: private
focal_class.parameters: (long timeout)
focal_class.return: Map<TopicPartition, List<ConsumerRecord<K, V>>>
focal_class.signature: Map<TopicPartition, List<ConsumerRecord<K, V>>> pollOnce(long timeout)
focal_class.class_method_signature: KafkaConsumer.commitSync()
focal_class.full_signature: @Override public void commitSync()
focal_class.identifier: commitSync
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void commitSync()
focal_class.class_method_signature: KafkaConsumer.commitSync(final Map<TopicPartition, OffsetAndMetadata> offsets)
focal_class.full_signature: @Override public void commitSync(final Map<TopicPartition, OffsetAndMetadata> offsets)
focal_class.identifier: commitSync
focal_class.modifiers: @Override public
focal_class.parameters: (final Map<TopicPartition, OffsetAndMetadata> offsets)
focal_class.return: void
focal_class.signature: void commitSync(final Map<TopicPartition, OffsetAndMetadata> offsets)
focal_class.class_method_signature: KafkaConsumer.commitAsync()
focal_class.full_signature: @Override public void commitAsync()
focal_class.identifier: commitAsync
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void commitAsync()
focal_class.class_method_signature: KafkaConsumer.commitAsync(OffsetCommitCallback callback)
focal_class.full_signature: @Override public void commitAsync(OffsetCommitCallback callback)
focal_class.identifier: commitAsync
focal_class.modifiers: @Override public
focal_class.parameters: (OffsetCommitCallback callback)
focal_class.return: void
focal_class.signature: void commitAsync(OffsetCommitCallback callback)
focal_class.class_method_signature: KafkaConsumer.commitAsync(final Map<TopicPartition, OffsetAndMetadata> offsets, OffsetCommitCallback callback)
focal_class.full_signature: @Override public void commitAsync(final Map<TopicPartition, OffsetAndMetadata> offsets, OffsetCommitCallback callback)
focal_class.identifier: commitAsync
focal_class.modifiers: @Override public
focal_class.parameters: (final Map<TopicPartition, OffsetAndMetadata> offsets, OffsetCommitCallback callback)
focal_class.return: void
focal_class.signature: void commitAsync(final Map<TopicPartition, OffsetAndMetadata> offsets, OffsetCommitCallback callback)
focal_class.class_method_signature: KafkaConsumer.seek(TopicPartition partition, long offset)
focal_class.full_signature: @Override public void seek(TopicPartition partition, long offset)
focal_class.identifier: seek
focal_class.modifiers: @Override public
focal_class.parameters: (TopicPartition partition, long offset)
focal_class.return: void
focal_class.signature: void seek(TopicPartition partition, long offset)
focal_class.class_method_signature: KafkaConsumer.seekToBeginning(Collection<TopicPartition> partitions)
focal_class.full_signature: public void seekToBeginning(Collection<TopicPartition> partitions)
focal_class.identifier: seekToBeginning
focal_class.modifiers: public
focal_class.parameters: (Collection<TopicPartition> partitions)
focal_class.return: void
focal_class.signature: void seekToBeginning(Collection<TopicPartition> partitions)
focal_class.class_method_signature: KafkaConsumer.seekToEnd(Collection<TopicPartition> partitions)
focal_class.full_signature: public void seekToEnd(Collection<TopicPartition> partitions)
focal_class.identifier: seekToEnd
focal_class.modifiers: public
focal_class.parameters: (Collection<TopicPartition> partitions)
focal_class.return: void
focal_class.signature: void seekToEnd(Collection<TopicPartition> partitions)
focal_class.class_method_signature: KafkaConsumer.position(TopicPartition partition)
focal_class.full_signature: public long position(TopicPartition partition)
focal_class.identifier: position
focal_class.modifiers: public
focal_class.parameters: (TopicPartition partition)
focal_class.return: long
focal_class.signature: long position(TopicPartition partition)
focal_class.class_method_signature: KafkaConsumer.committed(TopicPartition partition)
focal_class.full_signature: @Override public OffsetAndMetadata committed(TopicPartition partition)
focal_class.identifier: committed
focal_class.modifiers: @Override public
focal_class.parameters: (TopicPartition partition)
focal_class.return: OffsetAndMetadata
focal_class.signature: OffsetAndMetadata committed(TopicPartition partition)
focal_class.class_method_signature: KafkaConsumer.metrics()
focal_class.full_signature: @Override public Map<MetricName, ? extends Metric> metrics()
focal_class.identifier: metrics
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Map<MetricName, ? extends Metric>
focal_class.signature: Map<MetricName, ? extends Metric> metrics()
focal_class.class_method_signature: KafkaConsumer.partitionsFor(String topic)
focal_class.full_signature: @Override public List<PartitionInfo> partitionsFor(String topic)
focal_class.identifier: partitionsFor
focal_class.modifiers: @Override public
focal_class.parameters: (String topic)
focal_class.return: List<PartitionInfo>
focal_class.signature: List<PartitionInfo> partitionsFor(String topic)
focal_class.class_method_signature: KafkaConsumer.listTopics()
focal_class.full_signature: @Override public Map<String, List<PartitionInfo>> listTopics()
focal_class.identifier: listTopics
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Map<String, List<PartitionInfo>>
focal_class.signature: Map<String, List<PartitionInfo>> listTopics()
focal_class.class_method_signature: KafkaConsumer.pause(Collection<TopicPartition> partitions)
focal_class.full_signature: @Override public void pause(Collection<TopicPartition> partitions)
focal_class.identifier: pause
focal_class.modifiers: @Override public
focal_class.parameters: (Collection<TopicPartition> partitions)
focal_class.return: void
focal_class.signature: void pause(Collection<TopicPartition> partitions)
focal_class.class_method_signature: KafkaConsumer.resume(Collection<TopicPartition> partitions)
focal_class.full_signature: @Override public void resume(Collection<TopicPartition> partitions)
focal_class.identifier: resume
focal_class.modifiers: @Override public
focal_class.parameters: (Collection<TopicPartition> partitions)
focal_class.return: void
focal_class.signature: void resume(Collection<TopicPartition> partitions)
focal_class.class_method_signature: KafkaConsumer.paused()
focal_class.full_signature: @Override public Set<TopicPartition> paused()
focal_class.identifier: paused
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Set<TopicPartition>
focal_class.signature: Set<TopicPartition> paused()
focal_class.class_method_signature: KafkaConsumer.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: KafkaConsumer.wakeup()
focal_class.full_signature: @Override public void wakeup()
focal_class.identifier: wakeup
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void wakeup()
focal_class.class_method_signature: KafkaConsumer.close(boolean swallowException)
focal_class.full_signature: private void close(boolean swallowException)
focal_class.identifier: close
focal_class.modifiers: private
focal_class.parameters: (boolean swallowException)
focal_class.return: void
focal_class.signature: void close(boolean swallowException)
focal_class.class_method_signature: KafkaConsumer.updateFetchPositions(Set<TopicPartition> partitions)
focal_class.full_signature: private void updateFetchPositions(Set<TopicPartition> partitions)
focal_class.identifier: updateFetchPositions
focal_class.modifiers: private
focal_class.parameters: (Set<TopicPartition> partitions)
focal_class.return: void
focal_class.signature: void updateFetchPositions(Set<TopicPartition> partitions)
focal_class.class_method_signature: KafkaConsumer.ensureNotClosed()
focal_class.full_signature: private void ensureNotClosed()
focal_class.identifier: ensureNotClosed
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void ensureNotClosed()
focal_class.class_method_signature: KafkaConsumer.acquire()
focal_class.full_signature: private void acquire()
focal_class.identifier: acquire
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void acquire()
focal_class.class_method_signature: KafkaConsumer.main(String[] args)
focal_class.full_signature: public static void main(String[] args)
focal_class.identifier: main
focal_class.modifiers: public static
focal_class.parameters: (String[] args)
focal_class.return: void
focal_class.signature: void main(String[] args)
focal_class.class_method_signature: KafkaConsumer.release()
focal_class.full_signature: private void release()
focal_class.identifier: release
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void release()
focal_method.body: @Override
      public void close() {
          acquire();
          try {
              if (closed) {
                  return;
              }
              close(false);
          } finally {
              release();
          }
      }
focal_method.class_method_signature: KafkaConsumer.close()
focal_method.full_signature: @Override public void close()
focal_method.identifier: close
focal_method.invocations: acquire close release
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void close()