You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by jo...@apache.org on 2023/07/12 16:54:55 UTC
[kafka] 01/01: nits
This is an automated email from the ASF dual-hosted git repository.
jolshan pushed a commit to branch kafka-14884-2
in repository https://gitbox.apache.org/repos/asf/kafka.git
commit e9675f1863bf23c5043cc9e8b28b4f3387914c24
Author: Justine <jo...@confluent.io>
AuthorDate: Wed Jul 12 09:54:30 2023 -0700
nits
---
core/src/main/scala/kafka/server/ReplicaManager.scala | 6 +++---
core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala | 5 ++---
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/core/src/main/scala/kafka/server/ReplicaManager.scala b/core/src/main/scala/kafka/server/ReplicaManager.scala
index 95b12160577..aea9adb7212 100644
--- a/core/src/main/scala/kafka/server/ReplicaManager.scala
+++ b/core/src/main/scala/kafka/server/ReplicaManager.scala
@@ -711,9 +711,9 @@ class ReplicaManager(val config: KafkaConfig,
if (transactionStatePartition.isEmpty || !config.transactionPartitionVerificationEnable)
(entriesPerPartition, Map.empty[TopicPartition, MemoryRecords], Map.empty[TopicPartition, Errors])
else {
- val verifiedEntries: mutable.Map[TopicPartition, MemoryRecords] = mutable.Map[TopicPartition, MemoryRecords]()
- val unverifiedEntries: mutable.Map[TopicPartition, MemoryRecords] = mutable.Map[TopicPartition, MemoryRecords]()
- val errorEntries: mutable.Map[TopicPartition, Errors] = mutable.Map[TopicPartition, Errors]()
+ val verifiedEntries = mutable.Map[TopicPartition, MemoryRecords]()
+ val unverifiedEntries = mutable.Map[TopicPartition, MemoryRecords]()
+ val errorEntries = mutable.Map[TopicPartition, Errors]()
partitionEntriesForVerification(verificationGuards, entriesPerPartition, verifiedEntries, unverifiedEntries, errorEntries)
(verifiedEntries.toMap, unverifiedEntries.toMap, errorEntries.toMap)
}
diff --git a/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala b/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
index c2eab118ef4..f14e9dbdc09 100644
--- a/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
+++ b/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
@@ -2341,11 +2341,10 @@ class ReplicaManagerTest {
))
// We should not add these partitions to the manager to verify, but instead throw an error.
- appendRecords(replicaManager, tp0, transactionalRecords, transactionalId = transactionalId, transactionStatePartition = Some(0)).onFire( response => {
+ appendRecords(replicaManager, tp0, transactionalRecords, transactionalId = transactionalId, transactionStatePartition = Some(0)).onFire { response =>
assertEquals(Errors.NOT_LEADER_OR_FOLLOWER, response.error)
- })
+ }
verify(addPartitionsToTxnManager, times(0)).addTxnData(ArgumentMatchers.eq(node), ArgumentMatchers.eq(transactionToAdd), any[AddPartitionsToTxnManager.AppendCallback]())
-
} finally {
replicaManager.shutdown(checkpointHW = false)
}