Search in sources :

Example 1 with ElectLeadersResponseData

use of org.apache.kafka.common.message.ElectLeadersResponseData in project kafka by apache.

the class ReplicationControlManagerTest method buildElectLeadersResponse.

private ElectLeadersResponseData buildElectLeadersResponse(Errors topLevelError, boolean electAllPartitions, Map<TopicPartition, ApiError> errors) {
    Map<String, List<Map.Entry<TopicPartition, ApiError>>> errorsByTopic = errors.entrySet().stream().collect(Collectors.groupingBy(entry -> entry.getKey().topic()));
    ElectLeadersResponseData response = new ElectLeadersResponseData().setErrorCode(topLevelError.code());
    errorsByTopic.forEach((topic, partitionErrors) -> {
        ReplicaElectionResult electionResult = new ReplicaElectionResult().setTopic(topic);
        electionResult.setPartitionResult(partitionErrors.stream().filter(entry -> !electAllPartitions || entry.getValue().error() != ELECTION_NOT_NEEDED).map(entry -> {
            TopicPartition topicPartition = entry.getKey();
            ApiError error = entry.getValue();
            return new PartitionResult().setPartitionId(topicPartition.partition()).setErrorCode(error.error().code()).setErrorMessage(error.message());
        }).collect(Collectors.toList()));
        response.replicaElectionResults().add(electionResult);
    });
    return response;
}
Also used : MockTime(org.apache.kafka.common.utils.MockTime) TopicPartitionsCollection(org.apache.kafka.common.message.ElectLeadersRequestData.TopicPartitionsCollection) ListPartitionReassignmentsTopics(org.apache.kafka.common.message.ListPartitionReassignmentsRequestData.ListPartitionReassignmentsTopics) ElectLeadersRequestData(org.apache.kafka.common.message.ElectLeadersRequestData) Collections.singletonList(java.util.Collections.singletonList) StaleBrokerEpochException(org.apache.kafka.common.errors.StaleBrokerEpochException) CreatePartitionsTopic(org.apache.kafka.common.message.CreatePartitionsRequestData.CreatePartitionsTopic) PartitionResult(org.apache.kafka.common.message.ElectLeadersResponseData.PartitionResult) Arrays.asList(java.util.Arrays.asList) LogContext(org.apache.kafka.common.utils.LogContext) Map(java.util.Map) TopicData(org.apache.kafka.common.message.AlterIsrRequestData.TopicData) AlterIsrResponseData(org.apache.kafka.common.message.AlterIsrResponseData) Set(java.util.Set) SnapshotRegistry(org.apache.kafka.timeline.SnapshotRegistry) NO_LEADER(org.apache.kafka.metadata.LeaderConstants.NO_LEADER) UNKNOWN_TOPIC_ID(org.apache.kafka.common.protocol.Errors.UNKNOWN_TOPIC_ID) PartitionChangeRecord(org.apache.kafka.common.metadata.PartitionChangeRecord) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Errors(org.apache.kafka.common.protocol.Errors) CreatableTopicResult(org.apache.kafka.common.message.CreateTopicsResponseData.CreatableTopicResult) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) NO_REASSIGNMENT_IN_PROGRESS(org.apache.kafka.common.protocol.Errors.NO_REASSIGNMENT_IN_PROGRESS) BrokerRegistration(org.apache.kafka.metadata.BrokerRegistration) ArrayList(java.util.ArrayList) FENCED_LEADER_EPOCH(org.apache.kafka.common.protocol.Errors.FENCED_LEADER_EPOCH) ElectionType(org.apache.kafka.common.ElectionType) NONE(org.apache.kafka.common.protocol.Errors.NONE) BrokerHeartbeatReply(org.apache.kafka.metadata.BrokerHeartbeatReply) ELECTION_NOT_NEEDED(org.apache.kafka.common.protocol.Errors.ELECTION_NOT_NEEDED) AlterPartitionReassignmentsRequestData(org.apache.kafka.common.message.AlterPartitionReassignmentsRequestData) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) ValueSource(org.junit.jupiter.params.provider.ValueSource) CreatableReplicaAssignment(org.apache.kafka.common.message.CreateTopicsRequestData.CreatableReplicaAssignment) ElectLeadersResponseData(org.apache.kafka.common.message.ElectLeadersResponseData) ReassignablePartition(org.apache.kafka.common.message.AlterPartitionReassignmentsRequestData.ReassignablePartition) BrokerHeartbeatRequestData(org.apache.kafka.common.message.BrokerHeartbeatRequestData) Assertions.assertArrayEquals(org.junit.jupiter.api.Assertions.assertArrayEquals) AtomicLong(java.util.concurrent.atomic.AtomicLong) SEGMENT_BYTES_CONFIG(org.apache.kafka.common.config.TopicConfig.SEGMENT_BYTES_CONFIG) CreatableTopicCollection(org.apache.kafka.common.message.CreateTopicsRequestData.CreatableTopicCollection) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) CreateTopicsRequestData(org.apache.kafka.common.message.CreateTopicsRequestData) RecordTestUtils(org.apache.kafka.metadata.RecordTestUtils) ReassignableTopic(org.apache.kafka.common.message.AlterPartitionReassignmentsRequestData.ReassignableTopic) PartitionRecord(org.apache.kafka.common.metadata.PartitionRecord) PartitionData(org.apache.kafka.common.message.AlterIsrRequestData.PartitionData) CreatePartitionsAssignment(org.apache.kafka.common.message.CreatePartitionsRequestData.CreatePartitionsAssignment) POLICY_VIOLATION(org.apache.kafka.common.protocol.Errors.POLICY_VIOLATION) ConfigRecord(org.apache.kafka.common.metadata.ConfigRecord) LoggerFactory(org.slf4j.LoggerFactory) Assertions.assertNotEquals(org.junit.jupiter.api.Assertions.assertNotEquals) CreatePartitionsTopicResult(org.apache.kafka.common.message.CreatePartitionsResponseData.CreatePartitionsTopicResult) SecurityProtocol(org.apache.kafka.common.security.auth.SecurityProtocol) ELIGIBLE_LEADERS_NOT_AVAILABLE(org.apache.kafka.common.protocol.Errors.ELIGIBLE_LEADERS_NOT_AVAILABLE) ReassignableTopicResponse(org.apache.kafka.common.message.AlterPartitionReassignmentsResponseData.ReassignableTopicResponse) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) ReplicaElectionResult(org.apache.kafka.common.message.ElectLeadersResponseData.ReplicaElectionResult) TopicRecord(org.apache.kafka.common.metadata.TopicRecord) TopicPartition(org.apache.kafka.common.TopicPartition) TopicPartitions(org.apache.kafka.common.message.ElectLeadersRequestData.TopicPartitions) INVALID_PARTITIONS(org.apache.kafka.common.protocol.Errors.INVALID_PARTITIONS) PartitionRegistration(org.apache.kafka.metadata.PartitionRegistration) Collectors(java.util.stream.Collectors) Replicas(org.apache.kafka.metadata.Replicas) Test(org.junit.jupiter.api.Test) List(java.util.List) TopicIdPartition(org.apache.kafka.controller.BrokersToIsrs.TopicIdPartition) Optional(java.util.Optional) CreateTopicsResponseData(org.apache.kafka.common.message.CreateTopicsResponseData) INVALID_TOPIC_EXCEPTION(org.apache.kafka.common.protocol.Errors.INVALID_TOPIC_EXCEPTION) Uuid(org.apache.kafka.common.Uuid) IntStream(java.util.stream.IntStream) ReassignablePartitionResponse(org.apache.kafka.common.message.AlterPartitionReassignmentsResponseData.ReassignablePartitionResponse) ListPartitionReassignmentsResponseData(org.apache.kafka.common.message.ListPartitionReassignmentsResponseData) HashMap(java.util.HashMap) CreatableTopic(org.apache.kafka.common.message.CreateTopicsRequestData.CreatableTopic) OptionalInt(java.util.OptionalInt) ApiError(org.apache.kafka.common.requests.ApiError) HashSet(java.util.HashSet) ConfigResource(org.apache.kafka.common.config.ConfigResource) ApiMessageAndVersion(org.apache.kafka.server.common.ApiMessageAndVersion) PolicyViolationException(org.apache.kafka.common.errors.PolicyViolationException) OngoingPartitionReassignment(org.apache.kafka.common.message.ListPartitionReassignmentsResponseData.OngoingPartitionReassignment) OngoingTopicReassignment(org.apache.kafka.common.message.ListPartitionReassignmentsResponseData.OngoingTopicReassignment) Collections.singletonMap(java.util.Collections.singletonMap) UNKNOWN_TOPIC_OR_PARTITION(org.apache.kafka.common.protocol.Errors.UNKNOWN_TOPIC_OR_PARTITION) Utils(org.apache.kafka.common.utils.Utils) Logger(org.slf4j.Logger) InvalidReplicaAssignmentException(org.apache.kafka.common.errors.InvalidReplicaAssignmentException) PREFERRED_LEADER_NOT_AVAILABLE(org.apache.kafka.common.protocol.Errors.PREFERRED_LEADER_NOT_AVAILABLE) INVALID_REPLICA_ASSIGNMENT(org.apache.kafka.common.protocol.Errors.INVALID_REPLICA_ASSIGNMENT) TimeUnit(java.util.concurrent.TimeUnit) AlterPartitionReassignmentsResponseData(org.apache.kafka.common.message.AlterPartitionReassignmentsResponseData) CreateTopicPolicy(org.apache.kafka.server.policy.CreateTopicPolicy) AlterIsrRequestData(org.apache.kafka.common.message.AlterIsrRequestData) RegisterBrokerRecord(org.apache.kafka.common.metadata.RegisterBrokerRecord) Timeout(org.junit.jupiter.api.Timeout) Collections(java.util.Collections) TopicPartition(org.apache.kafka.common.TopicPartition) ElectLeadersResponseData(org.apache.kafka.common.message.ElectLeadersResponseData) ReplicaElectionResult(org.apache.kafka.common.message.ElectLeadersResponseData.ReplicaElectionResult) Collections.singletonList(java.util.Collections.singletonList) Arrays.asList(java.util.Arrays.asList) ArrayList(java.util.ArrayList) List(java.util.List) ApiError(org.apache.kafka.common.requests.ApiError) PartitionResult(org.apache.kafka.common.message.ElectLeadersResponseData.PartitionResult) Map(java.util.Map) HashMap(java.util.HashMap) Collections.singletonMap(java.util.Collections.singletonMap)

Example 2 with ElectLeadersResponseData

use of org.apache.kafka.common.message.ElectLeadersResponseData in project kafka by apache.

the class QuorumControllerTest method testTimeouts.

/**
 * Test that certain controller operations time out if they stay on the controller
 * queue for too long.
 */
@Test
public void testTimeouts() throws Throwable {
    try (LocalLogManagerTestEnv logEnv = new LocalLogManagerTestEnv(1, Optional.empty())) {
        try (QuorumControllerTestEnv controlEnv = new QuorumControllerTestEnv(logEnv, b -> b.setConfigDefs(CONFIGS))) {
            QuorumController controller = controlEnv.activeController();
            CountDownLatch countDownLatch = controller.pause();
            CompletableFuture<CreateTopicsResponseData> createFuture = controller.createTopics(new CreateTopicsRequestData().setTimeoutMs(0).setTopics(new CreatableTopicCollection(Collections.singleton(new CreatableTopic().setName("foo")).iterator())));
            long now = controller.time().nanoseconds();
            CompletableFuture<Map<Uuid, ApiError>> deleteFuture = controller.deleteTopics(now, Collections.singletonList(Uuid.ZERO_UUID));
            CompletableFuture<Map<String, ResultOrError<Uuid>>> findTopicIdsFuture = controller.findTopicIds(now, Collections.singletonList("foo"));
            CompletableFuture<Map<Uuid, ResultOrError<String>>> findTopicNamesFuture = controller.findTopicNames(now, Collections.singletonList(Uuid.ZERO_UUID));
            CompletableFuture<List<CreatePartitionsTopicResult>> createPartitionsFuture = controller.createPartitions(now, Collections.singletonList(new CreatePartitionsTopic()));
            CompletableFuture<ElectLeadersResponseData> electLeadersFuture = controller.electLeaders(new ElectLeadersRequestData().setTimeoutMs(0).setTopicPartitions(null));
            CompletableFuture<AlterPartitionReassignmentsResponseData> alterReassignmentsFuture = controller.alterPartitionReassignments(new AlterPartitionReassignmentsRequestData().setTimeoutMs(0).setTopics(Collections.singletonList(new ReassignableTopic())));
            CompletableFuture<ListPartitionReassignmentsResponseData> listReassignmentsFuture = controller.listPartitionReassignments(new ListPartitionReassignmentsRequestData().setTopics(null).setTimeoutMs(0));
            while (controller.time().nanoseconds() == now) {
                Thread.sleep(0, 10);
            }
            countDownLatch.countDown();
            assertYieldsTimeout(createFuture);
            assertYieldsTimeout(deleteFuture);
            assertYieldsTimeout(findTopicIdsFuture);
            assertYieldsTimeout(findTopicNamesFuture);
            assertYieldsTimeout(createPartitionsFuture);
            assertYieldsTimeout(electLeadersFuture);
            assertYieldsTimeout(alterReassignmentsFuture);
            assertYieldsTimeout(listReassignmentsFuture);
        }
    }
}
Also used : ReassignableTopic(org.apache.kafka.common.message.AlterPartitionReassignmentsRequestData.ReassignableTopic) ElectLeadersResponseData(org.apache.kafka.common.message.ElectLeadersResponseData) CreateTopicsResponseData(org.apache.kafka.common.message.CreateTopicsResponseData) ListPartitionReassignmentsResponseData(org.apache.kafka.common.message.ListPartitionReassignmentsResponseData) CreatableTopicCollection(org.apache.kafka.common.message.CreateTopicsRequestData.CreatableTopicCollection) CreateTopicsRequestData(org.apache.kafka.common.message.CreateTopicsRequestData) List(java.util.List) LocalLogManagerTestEnv(org.apache.kafka.metalog.LocalLogManagerTestEnv) AlterPartitionReassignmentsRequestData(org.apache.kafka.common.message.AlterPartitionReassignmentsRequestData) CountDownLatch(java.util.concurrent.CountDownLatch) ElectLeadersRequestData(org.apache.kafka.common.message.ElectLeadersRequestData) ListPartitionReassignmentsRequestData(org.apache.kafka.common.message.ListPartitionReassignmentsRequestData) Uuid(org.apache.kafka.common.Uuid) CreatableTopic(org.apache.kafka.common.message.CreateTopicsRequestData.CreatableTopic) AlterPartitionReassignmentsResponseData(org.apache.kafka.common.message.AlterPartitionReassignmentsResponseData) Map(java.util.Map) HashMap(java.util.HashMap) CreatePartitionsTopic(org.apache.kafka.common.message.CreatePartitionsRequestData.CreatePartitionsTopic) Test(org.junit.jupiter.api.Test)

Example 3 with ElectLeadersResponseData

use of org.apache.kafka.common.message.ElectLeadersResponseData in project kafka by apache.

the class QuorumControllerTest method testEarlyControllerResults.

/**
 * Test that certain controller operations finish immediately without putting an event
 * on the controller queue, if there is nothing to do.
 */
@Test
public void testEarlyControllerResults() throws Throwable {
    try (LocalLogManagerTestEnv logEnv = new LocalLogManagerTestEnv(1, Optional.empty())) {
        try (QuorumControllerTestEnv controlEnv = new QuorumControllerTestEnv(logEnv, b -> b.setConfigDefs(CONFIGS))) {
            QuorumController controller = controlEnv.activeController();
            CountDownLatch countDownLatch = controller.pause();
            CompletableFuture<CreateTopicsResponseData> createFuture = controller.createTopics(new CreateTopicsRequestData().setTimeoutMs(120000));
            long deadlineMs = controller.time().nanoseconds() + HOURS.toNanos(1);
            CompletableFuture<Map<Uuid, ApiError>> deleteFuture = controller.deleteTopics(deadlineMs, Collections.emptyList());
            CompletableFuture<Map<String, ResultOrError<Uuid>>> findTopicIdsFuture = controller.findTopicIds(deadlineMs, Collections.emptyList());
            CompletableFuture<Map<Uuid, ResultOrError<String>>> findTopicNamesFuture = controller.findTopicNames(deadlineMs, Collections.emptyList());
            CompletableFuture<List<CreatePartitionsTopicResult>> createPartitionsFuture = controller.createPartitions(deadlineMs, Collections.emptyList());
            CompletableFuture<ElectLeadersResponseData> electLeadersFuture = controller.electLeaders(new ElectLeadersRequestData().setTimeoutMs(120000));
            CompletableFuture<AlterPartitionReassignmentsResponseData> alterReassignmentsFuture = controller.alterPartitionReassignments(new AlterPartitionReassignmentsRequestData().setTimeoutMs(12000));
            createFuture.get();
            deleteFuture.get();
            findTopicIdsFuture.get();
            findTopicNamesFuture.get();
            createPartitionsFuture.get();
            electLeadersFuture.get();
            alterReassignmentsFuture.get();
            countDownLatch.countDown();
        }
    }
}
Also used : LocalLogManagerTestEnv(org.apache.kafka.metalog.LocalLogManagerTestEnv) ElectLeadersResponseData(org.apache.kafka.common.message.ElectLeadersResponseData) AlterPartitionReassignmentsRequestData(org.apache.kafka.common.message.AlterPartitionReassignmentsRequestData) CountDownLatch(java.util.concurrent.CountDownLatch) CreateTopicsResponseData(org.apache.kafka.common.message.CreateTopicsResponseData) ElectLeadersRequestData(org.apache.kafka.common.message.ElectLeadersRequestData) Uuid(org.apache.kafka.common.Uuid) AlterPartitionReassignmentsResponseData(org.apache.kafka.common.message.AlterPartitionReassignmentsResponseData) CreateTopicsRequestData(org.apache.kafka.common.message.CreateTopicsRequestData) List(java.util.List) Map(java.util.Map) HashMap(java.util.HashMap) Test(org.junit.jupiter.api.Test)

Example 4 with ElectLeadersResponseData

use of org.apache.kafka.common.message.ElectLeadersResponseData in project kafka by apache.

the class ReplicationControlManagerTest method testPreferredElectionDoesNotTriggerUncleanElection.

@Test
public void testPreferredElectionDoesNotTriggerUncleanElection() throws Exception {
    ReplicationControlTestContext ctx = new ReplicationControlTestContext();
    ReplicationControlManager replication = ctx.replicationControl;
    ctx.registerBrokers(1, 2, 3, 4);
    ctx.unfenceBrokers(1, 2, 3, 4);
    Uuid fooId = ctx.createTestTopic("foo", new int[][] { new int[] { 1, 2, 3 } }).topicId();
    TopicIdPartition partition = new TopicIdPartition(fooId, 0);
    ctx.fenceBrokers(Utils.mkSet(2, 3));
    ctx.fenceBrokers(Utils.mkSet(1, 2, 3));
    ctx.unfenceBrokers(Utils.mkSet(2));
    assertLeaderAndIsr(replication, partition, NO_LEADER, new int[] { 1 });
    ctx.alterTopicConfig("foo", "unclean.leader.election.enable", "true");
    ElectLeadersRequestData request = buildElectLeadersRequest(ElectionType.PREFERRED, singletonMap("foo", singletonList(0)));
    // No election should be done even though unclean election is available
    ControllerResult<ElectLeadersResponseData> result = replication.electLeaders(request);
    assertEquals(Collections.emptyList(), result.records());
    ElectLeadersResponseData expectedResponse = buildElectLeadersResponse(NONE, false, singletonMap(new TopicPartition("foo", 0), new ApiError(PREFERRED_LEADER_NOT_AVAILABLE)));
    assertEquals(expectedResponse, result.response());
}
Also used : Uuid(org.apache.kafka.common.Uuid) TopicPartition(org.apache.kafka.common.TopicPartition) ElectLeadersResponseData(org.apache.kafka.common.message.ElectLeadersResponseData) TopicIdPartition(org.apache.kafka.controller.BrokersToIsrs.TopicIdPartition) ApiError(org.apache.kafka.common.requests.ApiError) ElectLeadersRequestData(org.apache.kafka.common.message.ElectLeadersRequestData) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) Test(org.junit.jupiter.api.Test)

Example 5 with ElectLeadersResponseData

use of org.apache.kafka.common.message.ElectLeadersResponseData in project kafka by apache.

the class ReplicationControlManagerTest method testElectUncleanLeaders.

@ParameterizedTest
@ValueSource(booleans = { true, false })
public void testElectUncleanLeaders(boolean electAllPartitions) throws Exception {
    ReplicationControlTestContext ctx = new ReplicationControlTestContext();
    ReplicationControlManager replication = ctx.replicationControl;
    ctx.registerBrokers(0, 1, 2, 3, 4);
    ctx.unfenceBrokers(0, 1, 2, 3, 4);
    Uuid fooId = ctx.createTestTopic("foo", new int[][] { new int[] { 1, 2, 3 }, new int[] { 2, 3, 4 }, new int[] { 0, 2, 1 } }).topicId();
    TopicIdPartition partition0 = new TopicIdPartition(fooId, 0);
    TopicIdPartition partition1 = new TopicIdPartition(fooId, 1);
    TopicIdPartition partition2 = new TopicIdPartition(fooId, 2);
    ctx.fenceBrokers(Utils.mkSet(2, 3));
    ctx.fenceBrokers(Utils.mkSet(1, 2, 3));
    assertLeaderAndIsr(replication, partition0, NO_LEADER, new int[] { 1 });
    assertLeaderAndIsr(replication, partition1, 4, new int[] { 4 });
    assertLeaderAndIsr(replication, partition2, 0, new int[] { 0 });
    ElectLeadersRequestData request = buildElectLeadersRequest(ElectionType.UNCLEAN, electAllPartitions ? null : singletonMap("foo", asList(0, 1, 2)));
    // No election can be done yet because no replicas are available for partition 0
    ControllerResult<ElectLeadersResponseData> result1 = replication.electLeaders(request);
    assertEquals(Collections.emptyList(), result1.records());
    ElectLeadersResponseData expectedResponse1 = buildElectLeadersResponse(NONE, electAllPartitions, Utils.mkMap(Utils.mkEntry(new TopicPartition("foo", 0), new ApiError(ELIGIBLE_LEADERS_NOT_AVAILABLE)), Utils.mkEntry(new TopicPartition("foo", 1), new ApiError(ELECTION_NOT_NEEDED)), Utils.mkEntry(new TopicPartition("foo", 2), new ApiError(ELECTION_NOT_NEEDED))));
    assertElectLeadersResponse(expectedResponse1, result1.response());
    // Now we bring 2 back online which should allow the unclean election of partition 0
    ctx.unfenceBrokers(Utils.mkSet(2));
    // Bring 2 back into the ISR for partition 1. This allows us to verify that
    // preferred election does not occur as a result of the unclean election request.
    ctx.alterIsr(partition1, 4, asList(2, 4));
    ControllerResult<ElectLeadersResponseData> result = replication.electLeaders(request);
    assertEquals(1, result.records().size());
    ApiMessageAndVersion record = result.records().get(0);
    assertTrue(record.message() instanceof PartitionChangeRecord);
    PartitionChangeRecord partitionChangeRecord = (PartitionChangeRecord) record.message();
    assertEquals(0, partitionChangeRecord.partitionId());
    assertEquals(2, partitionChangeRecord.leader());
    assertEquals(singletonList(2), partitionChangeRecord.isr());
    ctx.replay(result.records());
    assertLeaderAndIsr(replication, partition0, 2, new int[] { 2 });
    assertLeaderAndIsr(replication, partition1, 4, new int[] { 2, 4 });
    assertLeaderAndIsr(replication, partition2, 0, new int[] { 0 });
    ElectLeadersResponseData expectedResponse = buildElectLeadersResponse(NONE, electAllPartitions, Utils.mkMap(Utils.mkEntry(new TopicPartition("foo", 0), ApiError.NONE), Utils.mkEntry(new TopicPartition("foo", 1), new ApiError(ELECTION_NOT_NEEDED)), Utils.mkEntry(new TopicPartition("foo", 2), new ApiError(ELECTION_NOT_NEEDED))));
    assertElectLeadersResponse(expectedResponse, result.response());
}
Also used : Uuid(org.apache.kafka.common.Uuid) PartitionChangeRecord(org.apache.kafka.common.metadata.PartitionChangeRecord) TopicPartition(org.apache.kafka.common.TopicPartition) ApiMessageAndVersion(org.apache.kafka.server.common.ApiMessageAndVersion) ElectLeadersResponseData(org.apache.kafka.common.message.ElectLeadersResponseData) TopicIdPartition(org.apache.kafka.controller.BrokersToIsrs.TopicIdPartition) ApiError(org.apache.kafka.common.requests.ApiError) ElectLeadersRequestData(org.apache.kafka.common.message.ElectLeadersRequestData) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

ElectLeadersResponseData (org.apache.kafka.common.message.ElectLeadersResponseData)8 Uuid (org.apache.kafka.common.Uuid)7 ElectLeadersRequestData (org.apache.kafka.common.message.ElectLeadersRequestData)6 TopicPartition (org.apache.kafka.common.TopicPartition)5 ApiError (org.apache.kafka.common.requests.ApiError)5 Test (org.junit.jupiter.api.Test)5 HashMap (java.util.HashMap)4 ApiMessageAndVersion (org.apache.kafka.server.common.ApiMessageAndVersion)4 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)4 List (java.util.List)3 Map (java.util.Map)3 AlterPartitionReassignmentsRequestData (org.apache.kafka.common.message.AlterPartitionReassignmentsRequestData)3 AlterPartitionReassignmentsResponseData (org.apache.kafka.common.message.AlterPartitionReassignmentsResponseData)3 CreateTopicsRequestData (org.apache.kafka.common.message.CreateTopicsRequestData)3 CreateTopicsResponseData (org.apache.kafka.common.message.CreateTopicsResponseData)3 PartitionChangeRecord (org.apache.kafka.common.metadata.PartitionChangeRecord)3 TopicIdPartition (org.apache.kafka.controller.BrokersToIsrs.TopicIdPartition)3 ArrayList (java.util.ArrayList)2 Optional (java.util.Optional)2 CountDownLatch (java.util.concurrent.CountDownLatch)2