beobal commented on code in PR #2119:
URL: https://github.com/apache/cassandra/pull/2119#discussion_r1109465214


##########
src/java/org/apache/cassandra/repair/consistent/SyncStatSummary.java:
##########
@@ -147,21 +152,36 @@ public String toString()
             }
             StringBuilder output = new StringBuilder();
 
-            output.append(String.format("%s.%s - %s ranges, %s sstables, %s 
bytes\n", keyspace, table, ranges, files, 
FBUtilities.prettyPrintMemory(bytes)));
+            output.append(String.format("%s.%s - %s ranges, %s sstables, %s 
bytes\n", keyspace, table, ranges.size(), files, 
FBUtilities.prettyPrintMemory(bytes)));

Review Comment:
   I'm unclear what the process is for modifying output of nodetool 
subcommands, but this will potentially change the console output of `nodetool 
repair`. IMO external tooling shouldn't be depending on the exact strings that 
nodetool emits, so this is fine with me but are we ok with having no option to 
force it to the old output?



##########
src/java/org/apache/cassandra/utils/RangesSerializer.java:
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.utils;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.cassandra.config.DatabaseDescriptor;
+import org.apache.cassandra.db.TypeSizes;
+import org.apache.cassandra.dht.IPartitioner;
+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.net.MessagingService;
+
+public class RangesSerializer implements 
IVersionedSerializer<Collection<Range<Token>>>
+{
+    public static final RangesSerializer serializer = new RangesSerializer();
+
+    @Override
+    public void serialize(Collection<Range<Token>> ranges, DataOutputPlus out, 
int version) throws IOException
+    {
+        out.writeInt(ranges.size());
+        for (Range<Token> r : ranges)
+        {
+            Token.serializer.serialize(r.left, out, version);
+            Token.serializer.serialize(r.right, out, 
MessagingService.current_version);

Review Comment:
   Not that it currently matters as the token serializer disregards `version` 
but this looks like a mistake?



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