You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "smiklosovic (via GitHub)" <gi...@apache.org> on 2023/01/30 12:12:56 UTC

[GitHub] [cassandra] smiklosovic commented on a diff in pull request #1577: CASSANDRA-17561 - only snapshot mismatching ranges on preview repair mismatch

smiklosovic commented on code in PR #1577:
URL: https://github.com/apache/cassandra/pull/1577#discussion_r1090545932


##########
src/java/org/apache/cassandra/repair/consistent/SyncStatSummary.java:
##########
@@ -147,7 +152,22 @@ 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)));
+            if (ranges.size() > 0)
+            {
+                output.append("    Mismatching ranges: ");
+                int i = 0;
+                Iterator<Range<Token>> rangeIterator = ranges.iterator();
+                while (rangeIterator.hasNext() && i < 30)
+                {
+                    Range<Token> r = rangeIterator.next();
+                    output.append('(').append(r.left).append(',').append(r.right).append("],");
+                    i++;
+                }
+                if (i == 30)
+                    output.append("...");
+                output.append('\n');

Review Comment:
   this can be replaced by System.lineSeparator



-- 
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-unsubscribe@cassandra.apache.org

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


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