You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2021/07/07 13:15:35 UTC

[GitHub] [cassandra] smiklosovic opened a new pull request #1103: Backport CASSANDRA-7950 (Support long names in nodetool output)

smiklosovic opened a new pull request #1103:
URL: https://github.com/apache/cassandra/pull/1103


   patch by Kurt Greaves; reviewed by Stefan Miklosovic for CASSANDRA-14162


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


[GitHub] [cassandra] ekaterinadimitrova2 commented on a change in pull request #1103: Backport CASSANDRA-7950 (Support long names in nodetool output)

Posted by GitBox <gi...@apache.org>.
ekaterinadimitrova2 commented on a change in pull request #1103:
URL: https://github.com/apache/cassandra/pull/1103#discussion_r666483401



##########
File path: src/java/org/apache/cassandra/tools/nodetool/CompactionHistory.java
##########
@@ -41,19 +46,79 @@ public void execute(NodeProbe probe)
         TabularData tabularData = probe.getCompactionHistory();
         if (tabularData.isEmpty())
         {
-            out.printf("There is no compaction history");
+            out.println("There is no compaction history");
             return;
         }
 
-        String format = "%-41s%-19s%-29s%-26s%-15s%-15s%s%n";
+        TableBuilder table = new TableBuilder();
         List<String> indexNames = tabularData.getTabularType().getIndexNames();
-        out.printf(format, toArray(indexNames, Object.class));
+        table.add(toArray(indexNames, String.class));
 
         Set<?> values = tabularData.keySet();
+        List<CompactionHistoryRow> chr = new ArrayList<>();
         for (Object eachValue : values)
         {
             List<?> value = (List<?>) eachValue;
-            out.printf(format, toArray(value, Object.class));
+            CompactionHistoryRow chc = new CompactionHistoryRow((String)value.get(0),
+                                                                (String)value.get(1),
+                                                                (String)value.get(2),
+                                                                (Long)value.get(3),
+                                                                (Long)value.get(4),
+                                                                (Long)value.get(5),
+                                                                (String)value.get(6));
+            chr.add(chc);
+        }
+        Collections.sort(chr);
+        for (CompactionHistoryRow eachChc : chr)
+        {
+            table.add(eachChc.getAllAsArray());
+        }
+        table.printTo(out);
+    }
+
+    /**
+     * Allows the Compaction History output to be ordered by 'compactedAt' - that is the
+     * time at which compaction finished.
+     */

Review comment:
       Not sure about this new order that we should introduce it here, I think this goes beyond the scope of what we wanted about the formatting




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


[GitHub] [cassandra] smiklosovic commented on a change in pull request #1103: Backport CASSANDRA-7950 (Support long names in nodetool output)

Posted by GitBox <gi...@apache.org>.
smiklosovic commented on a change in pull request #1103:
URL: https://github.com/apache/cassandra/pull/1103#discussion_r666560300



##########
File path: src/java/org/apache/cassandra/tools/nodetool/CompactionHistory.java
##########
@@ -41,19 +46,79 @@ public void execute(NodeProbe probe)
         TabularData tabularData = probe.getCompactionHistory();
         if (tabularData.isEmpty())
         {
-            out.printf("There is no compaction history");
+            out.println("There is no compaction history");
             return;
         }
 
-        String format = "%-41s%-19s%-29s%-26s%-15s%-15s%s%n";
+        TableBuilder table = new TableBuilder();
         List<String> indexNames = tabularData.getTabularType().getIndexNames();
-        out.printf(format, toArray(indexNames, Object.class));
+        table.add(toArray(indexNames, String.class));
 
         Set<?> values = tabularData.keySet();
+        List<CompactionHistoryRow> chr = new ArrayList<>();
         for (Object eachValue : values)
         {
             List<?> value = (List<?>) eachValue;
-            out.printf(format, toArray(value, Object.class));
+            CompactionHistoryRow chc = new CompactionHistoryRow((String)value.get(0),
+                                                                (String)value.get(1),
+                                                                (String)value.get(2),
+                                                                (Long)value.get(3),
+                                                                (Long)value.get(4),
+                                                                (Long)value.get(5),
+                                                                (String)value.get(6));
+            chr.add(chc);
+        }
+        Collections.sort(chr);
+        for (CompactionHistoryRow eachChc : chr)
+        {
+            table.add(eachChc.getAllAsArray());
+        }
+        table.printTo(out);
+    }
+
+    /**
+     * Allows the Compaction History output to be ordered by 'compactedAt' - that is the
+     * time at which compaction finished.
+     */

Review comment:
       @ekaterinadimitrova2  It is trully just backport of the other stuff. Check other branches. I havent changed anything (nor the guy who backported it first)




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


[GitHub] [cassandra] ekaterinadimitrova2 commented on a change in pull request #1103: Backport CASSANDRA-7950 (Support long names in nodetool output)

Posted by GitBox <gi...@apache.org>.
ekaterinadimitrova2 commented on a change in pull request #1103:
URL: https://github.com/apache/cassandra/pull/1103#discussion_r668141069



##########
File path: src/java/org/apache/cassandra/tools/nodetool/CompactionHistory.java
##########
@@ -41,19 +46,79 @@ public void execute(NodeProbe probe)
         TabularData tabularData = probe.getCompactionHistory();
         if (tabularData.isEmpty())
         {
-            out.printf("There is no compaction history");
+            out.println("There is no compaction history");

Review comment:
       I would leave it printf to be consistent as everywhere else. Also, println adds line separator string




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


[GitHub] [cassandra] smiklosovic closed pull request #1103: Backport CASSANDRA-7950 (Support long names in nodetool output)

Posted by GitBox <gi...@apache.org>.
smiklosovic closed pull request #1103:
URL: https://github.com/apache/cassandra/pull/1103


   


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