jsancio commented on code in PR #20707:
URL: https://github.com/apache/kafka/pull/20707#discussion_r2765508477
##########
raft/src/main/java/org/apache/kafka/raft/RaftClient.java:
##########
@@ -62,13 +62,26 @@ interface Listener<T> {
*/
void handleLoadSnapshot(SnapshotReader<T> reader);
+ /**
+ * Callback which is invoked when the Listener needs to load bootstrap
metadata.
+ * Bootstrap snapshots are uncommitted and only used for initial
cluster state.
+ *
+ * The default implementation delegates to {@link
#handleLoadSnapshot(SnapshotReader)}.
+ *
+ * @param reader snapshot reader instance which must be iterated and
closed
+ */
+ default void handleLoadBootstrap(SnapshotReader<T> reader) {
+ handleLoadSnapshot(reader);
+ }
Review Comment:
Please remove this default implementation. Again, `handleLoadSnapshot`
should only receive committed snapshots. `handleLoadBootstrap` should only
receive uncommitted snapshots.
##########
raft/src/main/java/org/apache/kafka/snapshot/SnapshotReader.java:
##########
@@ -57,6 +57,12 @@ public interface SnapshotReader<T> extends AutoCloseable,
Iterator<Batch<T>> {
*/
long lastContainedLogTimestamp();
+ /**
+ * Returns true if the snapshot has been committed.
+ * Uncommitted bootstrap snapshots return false.
+ */
+ boolean isCommittedSnapshot();
+
Review Comment:
Let's just remove this new method.
##########
core/src/test/scala/unit/kafka/server/KafkaRaftServerTest.scala:
##########
@@ -22,6 +22,12 @@ import java.util.{Optional, Properties}
import org.apache.kafka.common.{KafkaException, Uuid}
import org.apache.kafka.common.utils.Utils
import org.apache.kafka.metadata.bootstrap.{BootstrapDirectory,
BootstrapMetadata}
+
+import java.nio.file.Path
+
+import org.apache.kafka.common.internals.Topic.CLUSTER_METADATA_TOPIC_PARTITION
Review Comment:
Please remove the extra newline. Fix the import order. Does this pass AK's
import checker?
This comment applies to a few files in this PR.
--
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]