maedhroz commented on code in PR #4696:
URL: https://github.com/apache/cassandra/pull/4696#discussion_r3024226549


##########
src/java/org/apache/cassandra/repair/messages/MutationTrackingSyncResponse.java:
##########
@@ -0,0 +1,110 @@
+/*
+ * 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.repair.messages;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.Objects;
+
+import org.apache.cassandra.dht.AbstractBounds;
+import org.apache.cassandra.dht.Range;
+import org.apache.cassandra.dht.Token;
+import org.apache.cassandra.io.IVersionedSerializer;
+import org.apache.cassandra.io.util.DataInputPlus;
+import org.apache.cassandra.io.util.DataOutputPlus;
+import org.apache.cassandra.replication.CoordinatorLogId;
+import org.apache.cassandra.replication.Offsets;
+import org.apache.cassandra.repair.RepairJobDesc;
+import org.apache.cassandra.utils.CollectionSerializers;
+
+/**
+ * Response from a participant to a {@link MutationTrackingSyncRequest}. 
Contains the
+ * participant's current witnessed offsets for each shard overlapping the 
requested ranges.
+ * These offsets are captured after the request is received, establishing a 
happens-before
+ * relationship with the repair start.
+ */
+public class MutationTrackingSyncResponse extends RepairMessage
+{
+    /** Per-shard witnessed offsets: shard range -> (logId -> offsets) */
+    public final Map<Range<Token>, Map<CoordinatorLogId, Offsets.Immutable>> 
offsetsByShard;
+
+    public MutationTrackingSyncResponse(RepairJobDesc desc,
+                                        Map<Range<Token>, 
Map<CoordinatorLogId, Offsets.Immutable>> offsetsByShard)
+    {
+        super(desc);
+        Objects.requireNonNull(offsetsByShard);
+        this.offsetsByShard = offsetsByShard;
+    }
+
+    @Override
+    public boolean equals(Object o)
+    {
+        if (!(o instanceof MutationTrackingSyncResponse))
+            return false;
+        MutationTrackingSyncResponse other = (MutationTrackingSyncResponse) o;
+        return Objects.equals(desc, other.desc)
+               && Objects.equals(offsetsByShard, other.offsetsByShard);
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return Objects.hash(desc, offsetsByShard);
+    }

Review Comment:
   nit: Do we ever actually put `MutationTrackingSyncResponse` in a collection?



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to