test_class.declarator: LEADER_URL = "leaderUrl:8083"
test_class.modifier: private static final
test_class.original_string: private static final String LEADER_URL = "leaderUrl:8083";
test_class.type: String
test_class.var_name: LEADER_URL
test_class.declarator: MEMBER_URL = "memberUrl:8083"
test_class.modifier: private static final
test_class.original_string: private static final String MEMBER_URL = "memberUrl:8083";
test_class.type: String
test_class.var_name: MEMBER_URL
test_class.declarator: connectorId = "connector"
test_class.modifier: private
test_class.original_string: private String connectorId = "connector";
test_class.type: String
test_class.var_name: connectorId
test_class.declarator: connectorId2 = "connector2"
test_class.modifier: private
test_class.original_string: private String connectorId2 = "connector2";
test_class.type: String
test_class.var_name: connectorId2
test_class.declarator: taskId0 = new ConnectorTaskId(connectorId, 0)
test_class.modifier: private
test_class.original_string: private ConnectorTaskId taskId0 = new ConnectorTaskId(connectorId, 0);
test_class.type: ConnectorTaskId
test_class.var_name: taskId0
test_class.declarator: taskId1 = new ConnectorTaskId(connectorId, 1)
test_class.modifier: private
test_class.original_string: private ConnectorTaskId taskId1 = new ConnectorTaskId(connectorId, 1);
test_class.type: ConnectorTaskId
test_class.var_name: taskId1
test_class.declarator: taskId2 = new ConnectorTaskId(connectorId2, 0)
test_class.modifier: private
test_class.original_string: private ConnectorTaskId taskId2 = new ConnectorTaskId(connectorId2, 0);
test_class.type: ConnectorTaskId
test_class.var_name: taskId2
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: sessionTimeoutMs = 10
test_class.modifier: private
test_class.original_string: private int sessionTimeoutMs = 10;
test_class.type: int
test_class.var_name: sessionTimeoutMs
test_class.declarator: heartbeatIntervalMs = 2
test_class.modifier: private
test_class.original_string: private int heartbeatIntervalMs = 2;
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: 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("topic", 1)
test_class.modifier: private
test_class.original_string: private Cluster cluster = TestUtils.singletonCluster("topic", 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: 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: configStorage
test_class.modifier: @Mock private
test_class.original_string: @Mock private KafkaConfigBackingStore configStorage;
test_class.type: KafkaConfigBackingStore
test_class.var_name: configStorage
test_class.declarator: coordinator
test_class.modifier: private
test_class.original_string: private WorkerCoordinator coordinator;
test_class.type: WorkerCoordinator
test_class.var_name: coordinator
test_class.declarator: configState1
test_class.modifier: private
test_class.original_string: private ClusterConfigState configState1;
test_class.type: ClusterConfigState
test_class.var_name: configState1
test_class.declarator: configState2
test_class.modifier: private
test_class.original_string: private ClusterConfigState configState2;
test_class.type: ClusterConfigState
test_class.var_name: configState2
test_class.file: connect/runtime/src/test/java/org/apache/kafka/connect/runtime/distributed/WorkerCoordinatorTest.java
test_class.identifier: WorkerCoordinatorTest
test_case.body: @Test
      public void testMetadata() {
          EasyMock.expect(configStorage.snapshot()).andReturn(configState1);
  
          PowerMock.replayAll();
  
          List<ProtocolMetadata> serialized = coordinator.metadata();
          assertEquals(1, serialized.size());
  
          ProtocolMetadata defaultMetadata = serialized.get(0);
          assertEquals(WorkerCoordinator.DEFAULT_SUBPROTOCOL, defaultMetadata.name());
          ConnectProtocol.WorkerState state = ConnectProtocol.deserializeMetadata(defaultMetadata.metadata());
          assertEquals(1, state.offset());
  
          PowerMock.verifyAll();
      }
test_case.class_method_signature: WorkerCoordinatorTest.testMetadata()
test_case.full_signature: @Test public void testMetadata()
test_case.identifier: testMetadata
test_case.invocations: andReturn expect snapshot replayAll metadata assertEquals size get assertEquals name deserializeMetadata metadata assertEquals offset verifyAll
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMetadata()
focal_class.declarator: log = LoggerFactory.getLogger(WorkerCoordinator.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(WorkerCoordinator.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: DEFAULT_SUBPROTOCOL = "default"
focal_class.modifier: public static final
focal_class.original_string: public static final String DEFAULT_SUBPROTOCOL = "default";
focal_class.type: String
focal_class.var_name: DEFAULT_SUBPROTOCOL
focal_class.declarator: restUrl
focal_class.modifier: private final
focal_class.original_string: private final String restUrl;
focal_class.type: String
focal_class.var_name: restUrl
focal_class.declarator: configStorage
focal_class.modifier: private final
focal_class.original_string: private final ConfigBackingStore configStorage;
focal_class.type: ConfigBackingStore
focal_class.var_name: configStorage
focal_class.declarator: assignmentSnapshot
focal_class.modifier: private
focal_class.original_string: private ConnectProtocol.Assignment assignmentSnapshot;
focal_class.type: ConnectProtocol.Assignment
focal_class.var_name: assignmentSnapshot
focal_class.declarator: sensors
focal_class.modifier: private final
focal_class.original_string: private final WorkerCoordinatorMetrics sensors;
focal_class.type: WorkerCoordinatorMetrics
focal_class.var_name: sensors
focal_class.declarator: configSnapshot
focal_class.modifier: private
focal_class.original_string: private ClusterConfigState configSnapshot;
focal_class.type: ClusterConfigState
focal_class.var_name: configSnapshot
focal_class.declarator: listener
focal_class.modifier: private final
focal_class.original_string: private final WorkerRebalanceListener listener;
focal_class.type: WorkerRebalanceListener
focal_class.var_name: listener
focal_class.declarator: leaderState
focal_class.modifier: private
focal_class.original_string: private LeaderState leaderState;
focal_class.type: LeaderState
focal_class.var_name: leaderState
focal_class.declarator: rejoinRequested
focal_class.modifier: private
focal_class.original_string: private boolean rejoinRequested;
focal_class.type: boolean
focal_class.var_name: rejoinRequested
focal_class.file: connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/WorkerCoordinator.java
focal_class.identifier: WorkerCoordinator
focal_class.interfaces: implements Closeable
focal_class.class_method_signature: WorkerCoordinator.WorkerCoordinator(ConsumerNetworkClient client,
                               String groupId,
                               int sessionTimeoutMs,
                               int heartbeatIntervalMs,
                               Metrics metrics,
                               String metricGrpPrefix,
                               Time time,
                               long retryBackoffMs,
                               String restUrl,
                               ConfigBackingStore configStorage,
                               WorkerRebalanceListener listener)
focal_class.full_signature: public  WorkerCoordinator(ConsumerNetworkClient client,
                               String groupId,
                               int sessionTimeoutMs,
                               int heartbeatIntervalMs,
                               Metrics metrics,
                               String metricGrpPrefix,
                               Time time,
                               long retryBackoffMs,
                               String restUrl,
                               ConfigBackingStore configStorage,
                               WorkerRebalanceListener listener)
focal_class.identifier: WorkerCoordinator
focal_class.modifiers: public
focal_class.parameters: (ConsumerNetworkClient client,
                               String groupId,
                               int sessionTimeoutMs,
                               int heartbeatIntervalMs,
                               Metrics metrics,
                               String metricGrpPrefix,
                               Time time,
                               long retryBackoffMs,
                               String restUrl,
                               ConfigBackingStore configStorage,
                               WorkerRebalanceListener listener)
focal_class.signature:  WorkerCoordinator(ConsumerNetworkClient client,
                               String groupId,
                               int sessionTimeoutMs,
                               int heartbeatIntervalMs,
                               Metrics metrics,
                               String metricGrpPrefix,
                               Time time,
                               long retryBackoffMs,
                               String restUrl,
                               ConfigBackingStore configStorage,
                               WorkerRebalanceListener listener)
focal_class.class_method_signature: WorkerCoordinator.requestRejoin()
focal_class.full_signature: public void requestRejoin()
focal_class.identifier: requestRejoin
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void requestRejoin()
focal_class.class_method_signature: WorkerCoordinator.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: WorkerCoordinator.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: WorkerCoordinator.onJoinComplete(int generation, String memberId, String protocol, ByteBuffer memberAssignment)
focal_class.full_signature: @Override protected void onJoinComplete(int generation, String memberId, String protocol, ByteBuffer memberAssignment)
focal_class.identifier: onJoinComplete
focal_class.modifiers: @Override protected
focal_class.parameters: (int generation, String memberId, String protocol, ByteBuffer memberAssignment)
focal_class.return: void
focal_class.signature: void onJoinComplete(int generation, String memberId, String protocol, ByteBuffer memberAssignment)
focal_class.class_method_signature: WorkerCoordinator.performAssignment(String leaderId, String protocol, Map<String, ByteBuffer> allMemberMetadata)
focal_class.full_signature: @Override protected Map<String, ByteBuffer> performAssignment(String leaderId, String protocol, Map<String, ByteBuffer> allMemberMetadata)
focal_class.identifier: performAssignment
focal_class.modifiers: @Override protected
focal_class.parameters: (String leaderId, String protocol, Map<String, ByteBuffer> allMemberMetadata)
focal_class.return: Map<String, ByteBuffer>
focal_class.signature: Map<String, ByteBuffer> performAssignment(String leaderId, String protocol, Map<String, ByteBuffer> allMemberMetadata)
focal_class.class_method_signature: WorkerCoordinator.findMaxMemberConfigOffset(Map<String, ConnectProtocol.WorkerState> allConfigs)
focal_class.full_signature: private long findMaxMemberConfigOffset(Map<String, ConnectProtocol.WorkerState> allConfigs)
focal_class.identifier: findMaxMemberConfigOffset
focal_class.modifiers: private
focal_class.parameters: (Map<String, ConnectProtocol.WorkerState> allConfigs)
focal_class.return: long
focal_class.signature: long findMaxMemberConfigOffset(Map<String, ConnectProtocol.WorkerState> allConfigs)
focal_class.class_method_signature: WorkerCoordinator.ensureLeaderConfig(long maxOffset)
focal_class.full_signature: private Long ensureLeaderConfig(long maxOffset)
focal_class.identifier: ensureLeaderConfig
focal_class.modifiers: private
focal_class.parameters: (long maxOffset)
focal_class.return: Long
focal_class.signature: Long ensureLeaderConfig(long maxOffset)
focal_class.class_method_signature: WorkerCoordinator.performTaskAssignment(String leaderId, long maxOffset, Map<String, ConnectProtocol.WorkerState> allConfigs)
focal_class.full_signature: private Map<String, ByteBuffer> performTaskAssignment(String leaderId, long maxOffset, Map<String, ConnectProtocol.WorkerState> allConfigs)
focal_class.identifier: performTaskAssignment
focal_class.modifiers: private
focal_class.parameters: (String leaderId, long maxOffset, Map<String, ConnectProtocol.WorkerState> allConfigs)
focal_class.return: Map<String, ByteBuffer>
focal_class.signature: Map<String, ByteBuffer> performTaskAssignment(String leaderId, long maxOffset, Map<String, ConnectProtocol.WorkerState> allConfigs)
focal_class.class_method_signature: WorkerCoordinator.fillAssignmentsAndSerialize(Collection<String> members,
                                                                  short error,
                                                                  String leaderId,
                                                                  String leaderUrl,
                                                                  long maxOffset,
                                                                  Map<String, List<String>> connectorAssignments,
                                                                  Map<String, List<ConnectorTaskId>> taskAssignments)
focal_class.full_signature: private Map<String, ByteBuffer> fillAssignmentsAndSerialize(Collection<String> members,
                                                                  short error,
                                                                  String leaderId,
                                                                  String leaderUrl,
                                                                  long maxOffset,
                                                                  Map<String, List<String>> connectorAssignments,
                                                                  Map<String, List<ConnectorTaskId>> taskAssignments)
focal_class.identifier: fillAssignmentsAndSerialize
focal_class.modifiers: private
focal_class.parameters: (Collection<String> members,
                                                                  short error,
                                                                  String leaderId,
                                                                  String leaderUrl,
                                                                  long maxOffset,
                                                                  Map<String, List<String>> connectorAssignments,
                                                                  Map<String, List<ConnectorTaskId>> taskAssignments)
focal_class.return: Map<String, ByteBuffer>
focal_class.signature: Map<String, ByteBuffer> fillAssignmentsAndSerialize(Collection<String> members,
                                                                  short error,
                                                                  String leaderId,
                                                                  String leaderUrl,
                                                                  long maxOffset,
                                                                  Map<String, List<String>> connectorAssignments,
                                                                  Map<String, List<ConnectorTaskId>> taskAssignments)
focal_class.class_method_signature: WorkerCoordinator.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: WorkerCoordinator.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: WorkerCoordinator.memberId()
focal_class.full_signature: public String memberId()
focal_class.identifier: memberId
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String memberId()
focal_class.class_method_signature: WorkerCoordinator.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: WorkerCoordinator.isLeader()
focal_class.full_signature: private boolean isLeader()
focal_class.identifier: isLeader
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isLeader()
focal_class.class_method_signature: WorkerCoordinator.ownerUrl(String connector)
focal_class.full_signature: public String ownerUrl(String connector)
focal_class.identifier: ownerUrl
focal_class.modifiers: public
focal_class.parameters: (String connector)
focal_class.return: String
focal_class.signature: String ownerUrl(String connector)
focal_class.class_method_signature: WorkerCoordinator.ownerUrl(ConnectorTaskId task)
focal_class.full_signature: public String ownerUrl(ConnectorTaskId task)
focal_class.identifier: ownerUrl
focal_class.modifiers: public
focal_class.parameters: (ConnectorTaskId task)
focal_class.return: String
focal_class.signature: String ownerUrl(ConnectorTaskId task)
focal_class.class_method_signature: WorkerCoordinator.sorted(Collection<T> members)
focal_class.full_signature: private static List<T> sorted(Collection<T> members)
focal_class.identifier: sorted
focal_class.modifiers: private static
focal_class.parameters: (Collection<T> members)
focal_class.return: List<T>
focal_class.signature: List<T> sorted(Collection<T> members)
focal_class.class_method_signature: WorkerCoordinator.invertAssignment(Map<K, List<V>> assignment)
focal_class.full_signature: private static Map<V, K> invertAssignment(Map<K, List<V>> assignment)
focal_class.identifier: invertAssignment
focal_class.modifiers: private static
focal_class.parameters: (Map<K, List<V>> assignment)
focal_class.return: Map<V, K>
focal_class.signature: Map<V, K> invertAssignment(Map<K, List<V>> assignment)
focal_class.superclass: extends AbstractCoordinator
focal_method.body: @Override
      public List<ProtocolMetadata> metadata() {
          configSnapshot = configStorage.snapshot();
          ConnectProtocol.WorkerState workerState = new ConnectProtocol.WorkerState(restUrl, configSnapshot.offset());
          ByteBuffer metadata = ConnectProtocol.serializeMetadata(workerState);
          return Collections.singletonList(new ProtocolMetadata(DEFAULT_SUBPROTOCOL, metadata));
      }
focal_method.class_method_signature: WorkerCoordinator.metadata()
focal_method.full_signature: @Override public List<ProtocolMetadata> metadata()
focal_method.identifier: metadata
focal_method.invocations: snapshot offset serializeMetadata singletonList
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: List<ProtocolMetadata>
focal_method.signature: List<ProtocolMetadata> metadata()