chia7712 commented on code in PR #23569:
URL: https://github.com/apache/kafka/pull/23569#discussion_r4121268229


##########
core/src/test/scala/kafka/server/TierStateMachineBuildRemoteLogAuxStateTest.scala:
##########
@@ -0,0 +1,198 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package kafka.server
+
+import kafka.utils.{Logging, TestUtils}
+
+import org.apache.kafka.common.compress.Compression
+import org.apache.kafka.common.config.TopicConfig
+import org.apache.kafka.common.metadata.{FeatureLevelRecord, PartitionRecord, 
TopicRecord}
+import org.apache.kafka.common.metrics.Metrics
+import org.apache.kafka.common.record.internal.{MemoryRecords, SimpleRecord}
+import org.apache.kafka.common.utils.Utils
+import org.apache.kafka.common.{TopicIdPartition, Uuid}
+import org.apache.kafka.image.{MetadataDelta, MetadataImage, 
MetadataProvenance}
+import org.apache.kafka.metadata.KRaftMetadataCache
+import org.apache.kafka.server.LeaderEndPoint
+import org.apache.kafka.server.common.{KRaftVersion, MetadataVersion, 
OffsetAndEpoch}
+import org.apache.kafka.server.log.remote.storage.{RemoteLogManager, 
RemoteLogSegmentMetadata, RemoteStorageException, RemoteStorageManager}
+import 
org.apache.kafka.server.log.remote.storage.RemoteStorageManager.IndexType
+import org.apache.kafka.server.partition.AlterPartitionManager
+import org.apache.kafka.server.quota.QuotaFactory
+import org.apache.kafka.server.quota.QuotaFactory.QuotaManagers
+import org.apache.kafka.server.util.{MockScheduler, MockTime}
+import org.apache.kafka.storage.internals.checkpoint.LeaderEpochCheckpointFile
+import org.apache.kafka.storage.internals.log.{EpochEntry, LogConfig, 
LogDirFailureChannel, UnifiedLog}
+import org.apache.kafka.storage.log.metrics.BrokerTopicStats
+import org.junit.jupiter.api.Assertions._
+import org.junit.jupiter.api.{AfterEach, BeforeEach}
+import org.junit.jupiter.api.function.Executable
+import org.junit.jupiter.params.ParameterizedTest
+import org.junit.jupiter.params.provider.EnumSource
+import org.mockito.ArgumentMatchers.{any, anyInt, anyLong}
+import org.mockito.Mockito.{mock, when}
+
+import java.io.{ByteArrayInputStream, File}
+import java.nio.charset.StandardCharsets
+import java.util.{Optional, Properties}
+import scala.collection.Map
+import scala.jdk.CollectionConverters._
+
+/**
+ * Tests that a failure while building the remote log auxiliary state does not 
leave the follower's
+ * local log and its leader epoch cache in an inconsistent state (KAFKA-17249).
+ */
+class TierStateMachineBuildRemoteLogAuxStateTest extends Logging {

Review Comment:
   Would you mind using Java to rewrite this test? We are dropping Scala code, 
so it would be better to use Java as much as possible.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to