aweisberg commented on code in PR #4118:
URL: https://github.com/apache/cassandra/pull/4118#discussion_r2078023815


##########
src/java/org/apache/cassandra/db/CoordinatorLogBoundaries.java:
##########
@@ -0,0 +1,155 @@
+/*
+ * 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.cassandra.db;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+import org.apache.cassandra.io.IVersionedSerializer;
+import org.apache.cassandra.io.sstable.metadata.StatsMetadata;
+import org.apache.cassandra.io.util.DataInputPlus;
+import org.apache.cassandra.io.util.DataOutputPlus;
+import org.apache.cassandra.net.MessagingService;
+import org.apache.cassandra.replication.CoordinatorLogId;
+import org.apache.cassandra.replication.MutationId;
+import org.apache.cassandra.utils.vint.VIntCoding;
+
+/**
+ * Max mutation ID present in this SSTable for each coordinator log, to 
determine whether an SSTable is reconciled or
+ * not. Once max mutation IDs are reconciled, next compaction can safely mark 
this SSTabled as repaired. Note that peers
+ * may have reconciled all mutations included in an SSTable, but {@link 
StatsMetadata#repairedAt} is dependent on
+ * compaction timing, so "nodetool repair --validate" may report temporary 
disagreements on the repaired set.
+ * <p>
+ * Iterable over {@link CoordinatorLogId}.
+ */
+public abstract class CoordinatorLogBoundaries implements Iterable<Long>
+{
+    public static class Builder

Review Comment:
   This particular class isn't built that often so a wrapper builder isn't a 
big deal, but it is a wasted allocation. Since the boundaries returned is the 
mutable instance anyways it doesn't help with blocking access to mutability 
which is one of the reasons to use a builder.
   
   I know Blake advocated for this approach and it's definitely the idiomatic 
way to do it when you aren't being picky about performance.
   
   Since this is just using the mutable version the builder doesn't really add 
much compared to just using the mutable version directly and then casting it to 
the immutable interface.



-- 
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: pr-unsubscr...@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to