showuon commented on code in PR #14307:
URL: https://github.com/apache/kafka/pull/14307#discussion_r1314623009


##########
storage/src/test/java/org/apache/kafka/tiered/storage/utils/BrokerLocalStorage.java:
##########
@@ -56,7 +56,7 @@ public Integer getBrokerId() {
 
     /**
      * Wait until the first segment offset in Apache Kafka storage for the 
given topic-partition is
-     * equal or greater to the provided offset.
+     * equal to the provided offset.

Review Comment:
   Thanks for the fix.



##########
storage/src/test/java/org/apache/kafka/tiered/storage/integration/DeleteSegmentsByRetentionTimeTest.java:
##########
@@ -0,0 +1,29 @@
+/*
+ * 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 org.apache.kafka.tiered.storage.integration;
+
+import org.apache.kafka.common.config.TopicConfig;
+
+import java.util.Collections;
+import java.util.Map;
+
+public final class DeleteSegmentsByRetentionTimeTest extends 
DeleteSegmentsByRetentionSizeTest {

Review Comment:
   It's surprising the retentionTimeTest extends retentionSizeTest. Could we 
create an abstract `BaseDeleteSegmentsTest` class, and put the test spec there. 
Then we can have retentionTimeTest and retentionSizeTest tests extends the 
`BaseDeleteSegmentsTest`. 



##########
core/src/main/scala/kafka/server/BrokerServer.scala:
##########
@@ -463,17 +463,21 @@ class BrokerServer(
       new KafkaConfig(config.originals(), true)
 
       // Start RemoteLogManager before broker start serving the requests.
-      remoteLogManagerOpt.foreach(rlm => {
+      remoteLogManagerOpt.foreach { rlm =>
         val listenerName = 
config.remoteLogManagerConfig.remoteLogMetadataManagerListenerName()
         if (listenerName != null) {
-          val endpoint = endpoints.stream.filter(e => 
e.listenerName.equals(ListenerName.normalised(listenerName)))
+          val endpoint = endpoints.stream
+            .filter(e =>
+              e.listenerName().isPresent &&
+              
ListenerName.normalised(e.listenerName().get()).equals(ListenerName.normalised(listenerName))
+            )

Review Comment:
   Nice catch! 



##########
storage/src/test/java/org/apache/kafka/tiered/storage/actions/ExpectEmptyRemoteStorageAction.java:
##########
@@ -36,8 +36,8 @@ public ExpectEmptyRemoteStorageAction(TopicPartition 
topicPartition) {
     public void doExecute(TieredStorageTestContext context) throws 
InterruptedException {
         TestUtils.waitForCondition(() -> {
             LocalTieredStorageSnapshot snapshot = 
context.takeTieredStorageSnapshot();
-            return !snapshot.getTopicPartitions().contains(topicPartition) &&
-                    snapshot.getFilesets(topicPartition).isEmpty();
+            // With KAFKA-15166, snapshot should not contain the topicPartition

Review Comment:
   OK, so I think we should add all the explanation into the comment. From the 
current comment, it's not clear to me.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to