Skip to content

Commit 162b3a1

Browse files
authored
MINOR: Fix various typos and formatting issues across multiple modules (#22177)
This is done via a script I wrote to report typos based on statistical analysis and after I checked them manually, I applied the correct ones. No AI was used. I know it's not a very useful PR but I hope it's fine. Thank you! Reviewers: Murali Basani <muralidhar.basani@aiven.io>, Pratyaksh Sharma <pratyaksh13@gmail.com>, Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
1 parent c72fcda commit 162b3a1

24 files changed

Lines changed: 53 additions & 53 deletions

File tree

clients/src/test/java/org/apache/kafka/clients/FetchSessionHandlerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ private static void assertMapEquals(Map<TopicPartition, FetchRequest.PartitionDa
124124
if (!actualIter.hasNext()) {
125125
fail("Element " + i + " not found.");
126126
}
127-
Map.Entry<TopicPartition, FetchRequest.PartitionData> actuaLEntry = actualIter.next();
128-
assertEquals(expectedEntry.getKey(), actuaLEntry.getKey(), "Element " + i +
127+
Map.Entry<TopicPartition, FetchRequest.PartitionData> actualEntry = actualIter.next();
128+
assertEquals(expectedEntry.getKey(), actualEntry.getKey(), "Element " + i +
129129
" had a different TopicPartition than expected.");
130-
assertEquals(expectedEntry.getValue(), actuaLEntry.getValue(), "Element " + i +
130+
assertEquals(expectedEntry.getValue(), actualEntry.getValue(), "Element " + i +
131131
" had different PartitionData than expected.");
132132
i++;
133133
}

clients/src/test/java/org/apache/kafka/clients/consumer/internals/CompletedFetchTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ record = records.get(0);
9292
@Test
9393
public void testAbortedTransactionRecordsRemoved() {
9494
int numRecords = 10;
95-
Records rawRecords = newTranscactionalRecords(ControlRecordType.ABORT, numRecords);
95+
Records rawRecords = newTransactionalRecords(ControlRecordType.ABORT, numRecords);
9696

9797
FetchResponseData.PartitionData partitionData = new FetchResponseData.PartitionData()
9898
.setRecords(rawRecords)
@@ -114,7 +114,7 @@ public void testAbortedTransactionRecordsRemoved() {
114114
@Test
115115
public void testCommittedTransactionRecordsIncluded() {
116116
int numRecords = 10;
117-
Records rawRecords = newTranscactionalRecords(ControlRecordType.COMMIT, numRecords);
117+
Records rawRecords = newTransactionalRecords(ControlRecordType.COMMIT, numRecords);
118118
FetchResponseData.PartitionData partitionData = new FetchResponseData.PartitionData()
119119
.setRecords(rawRecords);
120120
CompletedFetch completedFetch = newCompletedFetch(0, partitionData);
@@ -258,7 +258,7 @@ private Records newRecords(long baseOffset, int count, long firstMessageId) {
258258
}
259259
}
260260

261-
private Records newTranscactionalRecords(ControlRecordType controlRecordType, int numRecords) {
261+
private Records newTransactionalRecords(ControlRecordType controlRecordType, int numRecords) {
262262
Time time = new MockTime();
263263
ByteBuffer buffer = ByteBuffer.allocate(1024);
264264

core/src/test/java/kafka/server/share/SharePartitionTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5278,7 +5278,7 @@ public void testReleaseAcquiredRecordsWithAnotherMemberAndSubsetAcknowledged() {
52785278
// Ack subset of records by "member-2".
52795279
sharePartition.acknowledge("member-2",
52805280
List.of(new ShareAcknowledgementBatch(5, 5, List.of(AcknowledgeType.ACCEPT.id))));
5281-
// After the acknowledgements, the startOffset will be upadated to 6, since offset 5 is Terminal. Hence
5281+
// After the acknowledgements, the startOffset will be updated to 6, since offset 5 is Terminal. Hence
52825282
// deliveryCompleteCount will remain 9.
52835283
assertEquals(9, sharePartition.deliveryCompleteCount());
52845284

@@ -5465,7 +5465,7 @@ public void testMaxDeliveryCountLimitExceededForRecordsSubsetCacheCleared() {
54655465
)));
54665466

54675467
// After acknowledgements, since offsets 10 -> 12 are at the start of the caches state and are in Terminal state,
5468-
// the start offset will be updated to 13. From the remaining offstes in flight, only records (17 -> 19) are in Terminal state.
5468+
// the start offset will be updated to 13. From the remaining offsets in flight, only records (17 -> 19) are in Terminal state.
54695469
assertEquals(3, sharePartition.deliveryCompleteCount());
54705470

54715471
// Send next batch from offset 13, only 2 records should be acquired.
@@ -9709,7 +9709,7 @@ public void testAcquisitionLockTimeoutWithConcurrentAcknowledgement() throws Int
97099709
TimerTask timerTask2 = sharePartition.cachedState().get(5L).batchAcquisitionLockTimeoutTask();
97109710

97119711
// Acknowledge 1 offset in first batch as Accept to create offset tracking, accept complete
9712-
// sencond batch. And mark offset 0 as release so cached state do not move ahead.
9712+
// second batch. And mark offset 0 as release so cached state do not move ahead.
97139713
sharePartition.acknowledge(MEMBER_ID, List.of(
97149714
new ShareAcknowledgementBatch(0, 0, List.of(AcknowledgeType.RELEASE.id)),
97159715
new ShareAcknowledgementBatch(1, 1, List.of(AcknowledgeType.ACCEPT.id)),

group-coordinator/src/test/java/org/apache/kafka/coordinator/group/GroupMetadataManagerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5805,7 +5805,7 @@ public void testStaticMembersJoinGroupWithMaxSize() {
58055805
assertEquals(groupMaxSize, group.numAwaitingJoinResponse());
58065806
assertTrue(group.isInState(PREPARING_REBALANCE));
58075807

5808-
// Advance clock by group initial rebalance delay to complete first inital delayed join.
5808+
// Advance clock by group initial rebalance delay to complete first initial delayed join.
58095809
// This will extend the initial rebalance as new members have joined.
58105810
GroupMetadataManagerTestContext.assertNoOrEmptyResult(context.sleep(50));
58115811
// Advance clock by group initial rebalance delay to complete second inital delayed join.

group-coordinator/src/test/java/org/apache/kafka/coordinator/group/modern/TargetAssignmentBuilderTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ private MemberSubscriptionAndAssignmentImpl newMemberSubscriptionAndAssignment(
217217
}
218218

219219
public TargetAssignmentBuilder.TargetAssignmentResult build() {
220-
CoordinatorMetadataImage cooridnatorMetadataImage = new KRaftCoordinatorMetadataImage(metadataImageBuilder.build());
221-
TopicIds.TopicResolver topicResolver = new TopicIds.CachedTopicResolver(cooridnatorMetadataImage);
220+
CoordinatorMetadataImage coordinatorMetadataImage = new KRaftCoordinatorMetadataImage(metadataImageBuilder.build());
221+
TopicIds.TopicResolver topicResolver = new TopicIds.CachedTopicResolver(coordinatorMetadataImage);
222222
// Prepare expected member specs.
223223
Map<String, MemberSubscriptionAndAssignmentImpl> memberSubscriptions = new HashMap<>();
224224

@@ -256,7 +256,7 @@ public TargetAssignmentBuilder.TargetAssignmentResult build() {
256256
});
257257

258258
// Prepare the expected subscription topic metadata.
259-
SubscribedTopicDescriberImpl subscribedTopicMetadata = new SubscribedTopicDescriberImpl(cooridnatorMetadataImage);
259+
SubscribedTopicDescriberImpl subscribedTopicMetadata = new SubscribedTopicDescriberImpl(coordinatorMetadataImage);
260260
SubscriptionType subscriptionType = HOMOGENEOUS;
261261

262262
// Prepare the member assignments per topic partition.
@@ -284,7 +284,7 @@ public TargetAssignmentBuilder.TargetAssignmentResult build() {
284284
.withSubscriptionType(subscriptionType)
285285
.withTargetAssignment(targetAssignment)
286286
.withInvertedTargetAssignment(invertedTargetAssignment)
287-
.withMetadataImage(cooridnatorMetadataImage)
287+
.withMetadataImage(coordinatorMetadataImage)
288288
.withResolvedRegularExpressions(resolvedRegularExpressions);
289289

290290
// Add the updated members or delete the deleted members.

raft/src/main/java/org/apache/kafka/raft/internals/KafkaRaftLog.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,10 +563,10 @@ private boolean cleanSnapshots(Function<OffsetAndEpoch, Optional<SnapshotDeletio
563563
}
564564

565565
boolean didClean = false;
566-
List<OffsetAndEpoch> epoches = new ArrayList<>(snapshots.keySet());
567-
for (int i = 0; i < epoches.size() - 1; i++) {
568-
OffsetAndEpoch epoch = epoches.get(i);
569-
OffsetAndEpoch nextEpoch = epoches.get(i + 1);
566+
List<OffsetAndEpoch> epochs = new ArrayList<>(snapshots.keySet());
567+
for (int i = 0; i < epochs.size() - 1; i++) {
568+
OffsetAndEpoch epoch = epochs.get(i);
569+
OffsetAndEpoch nextEpoch = epochs.get(i + 1);
570570
Optional<SnapshotDeletionReason> reason = predicate.apply(epoch);
571571
if (reason.isPresent()) {
572572
boolean deleted = deleteBeforeSnapshot(nextEpoch, reason.get());

streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/IQv2StoreIntegrationTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,7 +1823,7 @@ public <V> void shouldHandleWindowKeyQuery(
18231823
final Integer key,
18241824
final Instant timeFrom,
18251825
final Instant timeTo,
1826-
final Function<V, Integer> valueExtactor,
1826+
final Function<V, Integer> valueExtractor,
18271827
final Set<Integer> expectedValues) {
18281828

18291829
final WindowKeyQuery<Integer, V> query = WindowKeyQuery.withKeyAndWindowStartRange(
@@ -1864,7 +1864,7 @@ public <V> void shouldHandleWindowKeyQuery(
18641864

18651865
try (final WindowStoreIterator<V> iterator = queryResult.get(partition).getResult()) {
18661866
while (iterator.hasNext()) {
1867-
actualValues.add(valueExtactor.apply(iterator.next().value));
1867+
actualValues.add(valueExtractor.apply(iterator.next().value));
18681868
}
18691869
}
18701870
assertThat(queryResult.get(partition).getExecutionInfo(), is(empty()));
@@ -1877,7 +1877,7 @@ public <V> void shouldHandleWindowKeyQuery(
18771877
public <V> void shouldHandleWindowRangeQuery(
18781878
final Instant timeFrom,
18791879
final Instant timeTo,
1880-
final Function<V, Integer> valueExtactor,
1880+
final Function<V, Integer> valueExtractor,
18811881
final Set<Integer> expectedValues) {
18821882

18831883
final WindowRangeQuery<Integer, V> query = WindowRangeQuery.withWindowStartRange(timeFrom, timeTo);
@@ -1914,7 +1914,7 @@ public <V> void shouldHandleWindowRangeQuery(
19141914

19151915
try (final KeyValueIterator<Windowed<Integer>, V> iterator = queryResult.get(partition).getResult()) {
19161916
while (iterator.hasNext()) {
1917-
actualValues.add(valueExtactor.apply(iterator.next().value));
1917+
actualValues.add(valueExtractor.apply(iterator.next().value));
19181918
}
19191919
}
19201920
assertThat(queryResult.get(partition).getExecutionInfo(), is(empty()));
@@ -2057,4 +2057,4 @@ private static Properties streamsConfiguration(final boolean cache, final boolea
20572057
StreamsTestUtils.maybeSetDslStoreFormatHeaders(config, withHeaders);
20582058
return config;
20592059
}
2060-
}
2060+
}

streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/KafkaStreamsCloseOptionsIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public void before(final TestInfo testName) throws Exception {
115115
streamsConfig.put(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, 100);
116116
streamsConfig.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
117117
// In this test, we set the SESSION_TIMEOUT_MS_CONFIG high in order to show that the call to
118-
// `close(CloseOptions)` can remove the application from the Consumder Groups successfully.
118+
// `close(CloseOptions)` can remove the application from the Consumer Groups successfully.
119119
streamsConfig.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, Integer.MAX_VALUE);
120120
streamsConfig.putAll(commonClientConfig);
121121

streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/SuppressionDurabilityIntegrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public void shouldRecoverBufferAfterShutdown(final boolean withHeaders, final Te
158158
try {
159159
// start by putting some stuff in the buffer
160160
// note, we send all input records to partition 0
161-
// to make sure that supppress doesn't erroneously send records to other partitions.
161+
// to make sure that suppress doesn't erroneously send records to other partitions.
162162
produceSynchronouslyToPartitionZero(
163163
input,
164164
asList(
@@ -316,4 +316,4 @@ private static void produceSynchronouslyToPartitionZero(final String topic, fina
316316
));
317317
IntegrationTestUtils.produceSynchronously(producerConfig, false, topic, Optional.of(0), toProduce);
318318
}
319-
}
319+
}

streams/src/main/java/org/apache/kafka/streams/kstream/KStream.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ <KOut> KGroupedStream<KOut, V> groupBy(final KeyValueMapper<? super K, ? super V
757757
* <p>You can retrieve all generated internal topic names via {@link Topology#describe()}.
758758
* To explicitly set key/value serdes, to customize the names of the repartition and changelog topic, or to
759759
* customize the used state store, use {@link #join(KStream, ValueJoiner, JoinWindows, StreamJoined)}.
760-
* For more control over the repartitioning, use {@link #repartition(Repartitioned)} on eiter input before {@code join()}.
760+
* For more control over the repartitioning, use {@link #repartition(Repartitioned)} on either input before {@code join()}.
761761
*
762762
* @param rightStream
763763
* the {@code KStream} to be joined with this stream
@@ -1592,4 +1592,4 @@ <VOut> KStream<K, VOut> processValues(
15921592
final Named named,
15931593
final String... stateStoreNames
15941594
);
1595-
}
1595+
}

0 commit comments

Comments
 (0)