Browse Source

MINOR: fix typos for metadata (#13889)

Reviewers: Divij Vaidya <diviv@amazon.com>, Deqi Hu <deqi.hu@shopee.com>
pull/13894/head
minjian.cai 1 year ago committed by GitHub
parent
commit
ba5e1acdfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java
  2. 10
      metadata/src/main/java/org/apache/kafka/metadata/migration/KRaftMigrationZkWriter.java
  3. 2
      metadata/src/test/java/org/apache/kafka/controller/FeatureControlManagerTest.java

6
metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java

@ -1490,10 +1490,10 @@ public class ReplicationControlManager { @@ -1490,10 +1490,10 @@ public class ReplicationControlManager {
ControllerResult<Boolean> maybeBalancePartitionLeaders() {
List<ApiMessageAndVersion> records = new ArrayList<>();
boolean rescheduleImmidiately = false;
boolean rescheduleImmediately = false;
for (TopicIdPartition topicPartition : imbalancedPartitions) {
if (records.size() >= maxElectionsPerImbalance) {
rescheduleImmidiately = true;
rescheduleImmediately = true;
break;
}
@ -1521,7 +1521,7 @@ public class ReplicationControlManager { @@ -1521,7 +1521,7 @@ public class ReplicationControlManager {
builder.build().ifPresent(records::add);
}
return ControllerResult.of(records, rescheduleImmidiately);
return ControllerResult.of(records, rescheduleImmediately);
}
ControllerResult<List<CreatePartitionsTopicResult>> createPartitions(

10
metadata/src/main/java/org/apache/kafka/metadata/migration/KRaftMigrationZkWriter.java

@ -66,7 +66,7 @@ public class KRaftMigrationZkWriter { @@ -66,7 +66,7 @@ public class KRaftMigrationZkWriter {
private static final String CREATE_TOPIC = "CreateTopic";
private static final String UPDATE_TOPIC = "UpdateTopic";
private static final String DELETE_TOPIC = "DeleteTopic";
private static final String UPDATE_PARTITON = "UpdatePartition";
private static final String UPDATE_PARTITION = "UpdatePartition";
private static final String DELETE_PARTITION = "DeletePartition";
private static final String UPDATE_BROKER_CONFIG = "UpdateBrokerConfig";
private static final String DELETE_BROKER_CONFIG = "DeleteBrokerConfig";
@ -232,7 +232,7 @@ public class KRaftMigrationZkWriter { @@ -232,7 +232,7 @@ public class KRaftMigrationZkWriter {
newPartitions.forEach((topicId, partitionMap) -> {
TopicImage topic = topicsImage.getTopic(topicId);
operationConsumer.accept(
UPDATE_PARTITON,
UPDATE_PARTITION,
"Creating additional partitions for Topic " + topic.name() + ", ID " + topicId,
migrationState -> migrationClient.topicClient().updateTopicPartitions(
Collections.singletonMap(topic.name(), partitionMap),
@ -242,7 +242,7 @@ public class KRaftMigrationZkWriter { @@ -242,7 +242,7 @@ public class KRaftMigrationZkWriter {
changedPartitions.forEach((topicId, partitionMap) -> {
TopicImage topic = topicsImage.getTopic(topicId);
operationConsumer.accept(
UPDATE_PARTITON,
UPDATE_PARTITION,
"Updating Partitions for Topic " + topic.name() + ", ID " + topicId,
migrationState -> migrationClient.topicClient().updateTopicPartitions(
Collections.singletonMap(topic.name(), partitionMap),
@ -295,7 +295,7 @@ public class KRaftMigrationZkWriter { @@ -295,7 +295,7 @@ public class KRaftMigrationZkWriter {
Map<Integer, PartitionRegistration> changedPartitions = topicDelta.partitionChanges();
if (!newPartitions.isEmpty()) {
operationConsumer.accept(
UPDATE_PARTITON,
UPDATE_PARTITION,
"Create new partitions for Topic " + topicDelta.name() + ", ID " + topicId,
migrationState -> migrationClient.topicClient().createTopicPartitions(
Collections.singletonMap(topicDelta.name(), newPartitions),
@ -306,7 +306,7 @@ public class KRaftMigrationZkWriter { @@ -306,7 +306,7 @@ public class KRaftMigrationZkWriter {
// Need a final for the lambda
final Map<Integer, PartitionRegistration> finalChangedPartitions = changedPartitions;
operationConsumer.accept(
UPDATE_PARTITON,
UPDATE_PARTITION,
"Updating Partitions for Topic " + topicDelta.name() + ", ID " + topicId,
migrationState -> migrationClient.topicClient().updateTopicPartitions(
Collections.singletonMap(topicDelta.name(), finalChangedPartitions),

2
metadata/src/test/java/org/apache/kafka/controller/FeatureControlManagerTest.java

@ -369,7 +369,7 @@ public class FeatureControlManagerTest { @@ -369,7 +369,7 @@ public class FeatureControlManagerTest {
}
@Test
public void testCanotDowngradeBefore3_3_IV0() {
public void testCannotDowngradeBefore3_3_IV0() {
FeatureControlManager manager = new FeatureControlManager.Builder().
setQuorumFeatures(features(MetadataVersion.FEATURE_NAME,
MetadataVersion.IBP_3_0_IV0.featureLevel(), MetadataVersion.IBP_3_3_IV3.featureLevel())).

Loading…
Cancel
Save