test_class.declarator: topicName = "test"
test_class.modifier: private
test_class.original_string: private String topicName = "test";
test_class.type: String
test_class.var_name: topicName
test_class.declarator: groupId = "test-group"
test_class.modifier: private
test_class.original_string: private String groupId = "test-group";
test_class.type: String
test_class.var_name: groupId
test_class.declarator: tp = new TopicPartition(topicName, 0)
test_class.modifier: private
test_class.original_string: private TopicPartition tp = new TopicPartition(topicName, 0);
test_class.type: TopicPartition
test_class.var_name: tp
test_class.declarator: sessionTimeoutMs = 10000
test_class.modifier: private
test_class.original_string: private int sessionTimeoutMs = 10000;
test_class.type: int
test_class.var_name: sessionTimeoutMs
test_class.declarator: heartbeatIntervalMs = 5000
test_class.modifier: private
test_class.original_string: private int heartbeatIntervalMs = 5000;
test_class.type: int
test_class.var_name: heartbeatIntervalMs
test_class.declarator: retryBackoffMs = 100
test_class.modifier: private
test_class.original_string: private long retryBackoffMs = 100;
test_class.type: long
test_class.var_name: retryBackoffMs
test_class.declarator: autoCommitEnabled = false
test_class.modifier: private
test_class.original_string: private boolean autoCommitEnabled = false;
test_class.type: boolean
test_class.var_name: autoCommitEnabled
test_class.declarator: autoCommitIntervalMs = 2000
test_class.modifier: private
test_class.original_string: private long autoCommitIntervalMs = 2000;
test_class.type: long
test_class.var_name: autoCommitIntervalMs
test_class.declarator: partitionAssignor = new MockPartitionAssignor()
test_class.modifier: private
test_class.original_string: private MockPartitionAssignor partitionAssignor = new MockPartitionAssignor();
test_class.type: MockPartitionAssignor
test_class.var_name: partitionAssignor
test_class.declarator: assignors = Collections.<PartitionAssignor>singletonList(partitionAssignor)
test_class.modifier: private
test_class.original_string: private List<PartitionAssignor> assignors = Collections.<PartitionAssignor>singletonList(partitionAssignor);
test_class.type: List<PartitionAssignor>
test_class.var_name: assignors
test_class.declarator: time
test_class.modifier: private
test_class.original_string: private MockTime time;
test_class.type: MockTime
test_class.var_name: time
test_class.declarator: client
test_class.modifier: private
test_class.original_string: private MockClient client;
test_class.type: MockClient
test_class.var_name: client
test_class.declarator: cluster = TestUtils.singletonCluster(topicName, 1)
test_class.modifier: private
test_class.original_string: private Cluster cluster = TestUtils.singletonCluster(topicName, 1);
test_class.type: Cluster
test_class.var_name: cluster
test_class.declarator: node = cluster.nodes().get(0)
test_class.modifier: private
test_class.original_string: private Node node = cluster.nodes().get(0);
test_class.type: Node
test_class.var_name: node
test_class.declarator: subscriptions
test_class.modifier: private
test_class.original_string: private SubscriptionState subscriptions;
test_class.type: SubscriptionState
test_class.var_name: subscriptions
test_class.declarator: metadata
test_class.modifier: private
test_class.original_string: private Metadata metadata;
test_class.type: Metadata
test_class.var_name: metadata
test_class.declarator: metrics
test_class.modifier: private
test_class.original_string: private Metrics metrics;
test_class.type: Metrics
test_class.var_name: metrics
test_class.declarator: consumerClient
test_class.modifier: private
test_class.original_string: private ConsumerNetworkClient consumerClient;
test_class.type: ConsumerNetworkClient
test_class.var_name: consumerClient
test_class.declarator: rebalanceListener
test_class.modifier: private
test_class.original_string: private MockRebalanceListener rebalanceListener;
test_class.type: MockRebalanceListener
test_class.var_name: rebalanceListener
test_class.declarator: defaultOffsetCommitCallback
test_class.modifier: private
test_class.original_string: private MockCommitCallback defaultOffsetCommitCallback;
test_class.type: MockCommitCallback
test_class.var_name: defaultOffsetCommitCallback
test_class.declarator: coordinator
test_class.modifier: private
test_class.original_string: private ConsumerCoordinator coordinator;
test_class.type: ConsumerCoordinator
test_class.var_name: coordinator
test_class.file: clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinatorTest.java
test_class.identifier: ConsumerCoordinatorTest
test_case.body: @Test
      public void testCommitOffsetSyncCoordinatorDisconnected() {
          client.prepareResponse(consumerMetadataResponse(node, Errors.NONE.code()));
          coordinator.ensureCoordinatorReady();
  
          // sync commit with coordinator disconnected (should connect, get metadata, and then submit the commit request)
          client.prepareResponse(offsetCommitResponse(Collections.singletonMap(tp, Errors.NONE.code())), true);
          client.prepareResponse(consumerMetadataResponse(node, Errors.NONE.code()));
          client.prepareResponse(offsetCommitResponse(Collections.singletonMap(tp, Errors.NONE.code())));
          coordinator.commitOffsetsSync(Collections.singletonMap(tp, new OffsetAndMetadata(100L)));
      }
test_case.class_method_signature: ConsumerCoordinatorTest.testCommitOffsetSyncCoordinatorDisconnected()
test_case.full_signature: @Test public void testCommitOffsetSyncCoordinatorDisconnected()
test_case.identifier: testCommitOffsetSyncCoordinatorDisconnected
test_case.invocations: prepareResponse consumerMetadataResponse code ensureCoordinatorReady prepareResponse offsetCommitResponse singletonMap code prepareResponse consumerMetadataResponse code prepareResponse offsetCommitResponse singletonMap code commitOffsetsSync singletonMap
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCommitOffsetSyncCoordinatorDisconnected()
focal_class.declarator: log = LoggerFactory.getLogger(ConsumerCoordinator.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(ConsumerCoordinator.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: assignors
focal_class.modifier: private final
focal_class.original_string: private final List<PartitionAssignor> assignors;
focal_class.type: List<PartitionAssignor>
focal_class.var_name: assignors
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: sensors
focal_class.modifier: private final
focal_class.original_string: private final ConsumerCoordinatorMetrics sensors;
focal_class.type: ConsumerCoordinatorMetrics
focal_class.var_name: sensors
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: defaultOffsetCommitCallback
focal_class.modifier: private final
focal_class.original_string: private final OffsetCommitCallback defaultOffsetCommitCallback;
focal_class.type: OffsetCommitCallback
focal_class.var_name: defaultOffsetCommitCallback
focal_class.declarator: autoCommitEnabled
focal_class.modifier: private final
focal_class.original_string: private final boolean autoCommitEnabled;
focal_class.type: boolean
focal_class.var_name: autoCommitEnabled
focal_class.declarator: autoCommitTask
focal_class.modifier: private final
focal_class.original_string: private final AutoCommitTask autoCommitTask;
focal_class.type: AutoCommitTask
focal_class.var_name: autoCommitTask
focal_class.declarator: interceptors
focal_class.modifier: private final
focal_class.original_string: private final ConsumerInterceptors<?, ?> interceptors;
focal_class.type: ConsumerInterceptors<?, ?>
focal_class.var_name: interceptors
focal_class.declarator: excludeInternalTopics
focal_class.modifier: private final
focal_class.original_string: private final boolean excludeInternalTopics;
focal_class.type: boolean
focal_class.var_name: excludeInternalTopics
focal_class.declarator: metadataSnapshot
focal_class.modifier: private
focal_class.original_string: private MetadataSnapshot metadataSnapshot;
focal_class.type: MetadataSnapshot
focal_class.var_name: metadataSnapshot
focal_class.declarator: assignmentSnapshot
focal_class.modifier: private
focal_class.original_string: private MetadataSnapshot assignmentSnapshot;
focal_class.type: MetadataSnapshot
focal_class.var_name: assignmentSnapshot
focal_class.file: clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
focal_class.identifier: ConsumerCoordinator
focal_class.class_method_signature: ConsumerCoordinator.ConsumerCoordinator(ConsumerNetworkClient client,
          String groupId,
          int sessionTimeoutMs,
          int heartbeatIntervalMs,
          List<PartitionAssignor> assignors,
          Metadata metadata,
          SubscriptionState subscriptions,
          Metrics metrics,
          String metricGrpPrefix,
          Time time,
          long retryBackoffMs,
          OffsetCommitCallback defaultOffsetCommitCallback,
          boolean autoCommitEnabled,
          long autoCommitIntervalMs,
          ConsumerInterceptors<?, ?> interceptors,
          boolean excludeInternalTopics)
focal_class.full_signature: public  ConsumerCoordinator(ConsumerNetworkClient client,
          String groupId,
          int sessionTimeoutMs,
          int heartbeatIntervalMs,
          List<PartitionAssignor> assignors,
          Metadata metadata,
          SubscriptionState subscriptions,
          Metrics metrics,
          String metricGrpPrefix,
          Time time,
          long retryBackoffMs,
          OffsetCommitCallback defaultOffsetCommitCallback,
          boolean autoCommitEnabled,
          long autoCommitIntervalMs,
          ConsumerInterceptors<?, ?> interceptors,
          boolean excludeInternalTopics)
focal_class.identifier: ConsumerCoordinator
focal_class.modifiers: public
focal_class.parameters: (ConsumerNetworkClient client,
          String groupId,
          int sessionTimeoutMs,
          int heartbeatIntervalMs,
          List<PartitionAssignor> assignors,
          Metadata metadata,
          SubscriptionState subscriptions,
          Metrics metrics,
          String metricGrpPrefix,
          Time time,
          long retryBackoffMs,
          OffsetCommitCallback defaultOffsetCommitCallback,
          boolean autoCommitEnabled,
          long autoCommitIntervalMs,
          ConsumerInterceptors<?, ?> interceptors,
          boolean excludeInternalTopics)
focal_class.signature:  ConsumerCoordinator(ConsumerNetworkClient client,
          String groupId,
          int sessionTimeoutMs,
          int heartbeatIntervalMs,
          List<PartitionAssignor> assignors,
          Metadata metadata,
          SubscriptionState subscriptions,
          Metrics metrics,
          String metricGrpPrefix,
          Time time,
          long retryBackoffMs,
          OffsetCommitCallback defaultOffsetCommitCallback,
          boolean autoCommitEnabled,
          long autoCommitIntervalMs,
          ConsumerInterceptors<?, ?> interceptors,
          boolean excludeInternalTopics)
focal_class.class_method_signature: ConsumerCoordinator.protocolType()
focal_class.full_signature: @Override public String protocolType()
focal_class.identifier: protocolType
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String protocolType()
focal_class.class_method_signature: ConsumerCoordinator.metadata()
focal_class.full_signature: @Override public List<ProtocolMetadata> metadata()
focal_class.identifier: metadata
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<ProtocolMetadata>
focal_class.signature: List<ProtocolMetadata> metadata()
focal_class.class_method_signature: ConsumerCoordinator.addMetadataListener()
focal_class.full_signature: private void addMetadataListener()
focal_class.identifier: addMetadataListener
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void addMetadataListener()
focal_class.class_method_signature: ConsumerCoordinator.filterTopic(String topic)
focal_class.full_signature: private boolean filterTopic(String topic)
focal_class.identifier: filterTopic
focal_class.modifiers: private
focal_class.parameters: (String topic)
focal_class.return: boolean
focal_class.signature: boolean filterTopic(String topic)
focal_class.class_method_signature: ConsumerCoordinator.lookupAssignor(String name)
focal_class.full_signature: private PartitionAssignor lookupAssignor(String name)
focal_class.identifier: lookupAssignor
focal_class.modifiers: private
focal_class.parameters: (String name)
focal_class.return: PartitionAssignor
focal_class.signature: PartitionAssignor lookupAssignor(String name)
focal_class.class_method_signature: ConsumerCoordinator.performAssignment(String leaderId,
          String assignmentStrategy,
          Map<String/* memberId */, ByteBuffer/* 包含它关注了那些 topic */> allSubscriptions) {
focal_class.full_signature: @Override protected Map<String, ByteBuffer> performAssignment(String leaderId,
          String assignmentStrategy,
          Map<String/* memberId */, ByteBuffer/* 包含它关注了那些 topic */> allSubscriptions) {
focal_class.identifier: performAssignment
focal_class.modifiers: @Override protected
focal_class.parameters: (String leaderId,
          String assignmentStrategy,
          Map<String/* memberId */, ByteBuffer/* 包含它关注了那些 topic */> allSubscriptions) {
focal_class.return: Map<String, ByteBuffer>
focal_class.signature: Map<String, ByteBuffer> performAssignment(String leaderId,
          String assignmentStrategy,
          Map<String/* memberId */, ByteBuffer/* 包含它关注了那些 topic */> allSubscriptions) {
focal_class.class_method_signature: ConsumerCoordinator.onJoinComplete(int generation,
          String memberId,
          String assignmentStrategy,
          ByteBuffer assignmentBuffer)
focal_class.full_signature: @Override protected void onJoinComplete(int generation,
          String memberId,
          String assignmentStrategy,
          ByteBuffer assignmentBuffer)
focal_class.identifier: onJoinComplete
focal_class.modifiers: @Override protected
focal_class.parameters: (int generation,
          String memberId,
          String assignmentStrategy,
          ByteBuffer assignmentBuffer)
focal_class.return: void
focal_class.signature: void onJoinComplete(int generation,
          String memberId,
          String assignmentStrategy,
          ByteBuffer assignmentBuffer)
focal_class.class_method_signature: ConsumerCoordinator.onJoinPrepare(int generation, String memberId)
focal_class.full_signature: @Override protected void onJoinPrepare(int generation, String memberId)
focal_class.identifier: onJoinPrepare
focal_class.modifiers: @Override protected
focal_class.parameters: (int generation, String memberId)
focal_class.return: void
focal_class.signature: void onJoinPrepare(int generation, String memberId)
focal_class.class_method_signature: ConsumerCoordinator.needRejoin()
focal_class.full_signature: @Override public boolean needRejoin()
focal_class.identifier: needRejoin
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean needRejoin()
focal_class.class_method_signature: ConsumerCoordinator.refreshCommittedOffsetsIfNeeded()
focal_class.full_signature: public void refreshCommittedOffsetsIfNeeded()
focal_class.identifier: refreshCommittedOffsetsIfNeeded
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void refreshCommittedOffsetsIfNeeded()
focal_class.class_method_signature: ConsumerCoordinator.fetchCommittedOffsets(Set<TopicPartition> partitions)
focal_class.full_signature: public Map<TopicPartition, OffsetAndMetadata> fetchCommittedOffsets(Set<TopicPartition> partitions)
focal_class.identifier: fetchCommittedOffsets
focal_class.modifiers: public
focal_class.parameters: (Set<TopicPartition> partitions)
focal_class.return: Map<TopicPartition, OffsetAndMetadata>
focal_class.signature: Map<TopicPartition, OffsetAndMetadata> fetchCommittedOffsets(Set<TopicPartition> partitions)
focal_class.class_method_signature: ConsumerCoordinator.ensurePartitionAssignment()
focal_class.full_signature: public void ensurePartitionAssignment()
focal_class.identifier: ensurePartitionAssignment
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void ensurePartitionAssignment()
focal_class.class_method_signature: ConsumerCoordinator.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: ConsumerCoordinator.commitOffsetsAsync(final Map<TopicPartition, OffsetAndMetadata> offsets, OffsetCommitCallback callback)
focal_class.full_signature: public void commitOffsetsAsync(final Map<TopicPartition, OffsetAndMetadata> offsets, OffsetCommitCallback callback)
focal_class.identifier: commitOffsetsAsync
focal_class.modifiers: public
focal_class.parameters: (final Map<TopicPartition, OffsetAndMetadata> offsets, OffsetCommitCallback callback)
focal_class.return: void
focal_class.signature: void commitOffsetsAsync(final Map<TopicPartition, OffsetAndMetadata> offsets, OffsetCommitCallback callback)
focal_class.class_method_signature: ConsumerCoordinator.commitOffsetsSync(Map<TopicPartition, OffsetAndMetadata> offsets)
focal_class.full_signature: public void commitOffsetsSync(Map<TopicPartition, OffsetAndMetadata> offsets)
focal_class.identifier: commitOffsetsSync
focal_class.modifiers: public
focal_class.parameters: (Map<TopicPartition, OffsetAndMetadata> offsets)
focal_class.return: void
focal_class.signature: void commitOffsetsSync(Map<TopicPartition, OffsetAndMetadata> offsets)
focal_class.class_method_signature: ConsumerCoordinator.maybeAutoCommitOffsetsSync()
focal_class.full_signature: private void maybeAutoCommitOffsetsSync()
focal_class.identifier: maybeAutoCommitOffsetsSync
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void maybeAutoCommitOffsetsSync()
focal_class.class_method_signature: ConsumerCoordinator.sendOffsetCommitRequest(final Map<TopicPartition, OffsetAndMetadata> offsets)
focal_class.full_signature: private RequestFuture<Void> sendOffsetCommitRequest(final Map<TopicPartition, OffsetAndMetadata> offsets)
focal_class.identifier: sendOffsetCommitRequest
focal_class.modifiers: private
focal_class.parameters: (final Map<TopicPartition, OffsetAndMetadata> offsets)
focal_class.return: RequestFuture<Void>
focal_class.signature: RequestFuture<Void> sendOffsetCommitRequest(final Map<TopicPartition, OffsetAndMetadata> offsets)
focal_class.class_method_signature: ConsumerCoordinator.sendOffsetFetchRequest(Set<TopicPartition> partitions)
focal_class.full_signature: private RequestFuture<Map<TopicPartition, OffsetAndMetadata>> sendOffsetFetchRequest(Set<TopicPartition> partitions)
focal_class.identifier: sendOffsetFetchRequest
focal_class.modifiers: private
focal_class.parameters: (Set<TopicPartition> partitions)
focal_class.return: RequestFuture<Map<TopicPartition, OffsetAndMetadata>>
focal_class.signature: RequestFuture<Map<TopicPartition, OffsetAndMetadata>> sendOffsetFetchRequest(Set<TopicPartition> partitions)
focal_class.superclass: extends AbstractCoordinator
focal_method.body: public void commitOffsetsSync(Map<TopicPartition, OffsetAndMetadata> offsets) {
          if (offsets.isEmpty()) {
              return;
          }
  
          while (true) {
              ensureCoordinatorReady();
  
              RequestFuture<Void> future = sendOffsetCommitRequest(offsets);
              client.poll(future);
  
              if (future.succeeded()) {
                  if (interceptors != null) {
                      interceptors.onCommit(offsets);
                  }
                  return;
              }
  
              if (!future.isRetriable()) {
                  throw future.exception();
              }
  
              time.sleep(retryBackoffMs);
          }
      }
focal_method.class_method_signature: ConsumerCoordinator.commitOffsetsSync(Map<TopicPartition, OffsetAndMetadata> offsets)
focal_method.full_signature: public void commitOffsetsSync(Map<TopicPartition, OffsetAndMetadata> offsets)
focal_method.identifier: commitOffsetsSync
focal_method.invocations: isEmpty ensureCoordinatorReady sendOffsetCommitRequest poll succeeded onCommit isRetriable exception sleep
focal_method.modifiers: public
focal_method.parameters: (Map<TopicPartition, OffsetAndMetadata> offsets)
focal_method.return: void
focal_method.signature: void commitOffsetsSync(Map<TopicPartition, OffsetAndMetadata> offsets)