Gerrrr commented on a change in pull request #1232:
URL: https://github.com/apache/cassandra/pull/1232#discussion_r720711991



##########
File path: src/java/org/apache/cassandra/hints/HintsService.java
##########
@@ -268,6 +269,31 @@ public synchronized void shutdownBlocking() throws 
ExecutionException, Interrupt
         bufferPool.close();
     }
 
+    /**
+     * Returns all pending hints that this node has.
+     *
+     * @return a list of {@link PendingHintsInfo}
+     */
+    public List<PendingHintsInfo> getPendingHintsInfo()
+    {
+        return catalog.stores()
+                      .filter(HintsStore::hasFiles)
+                      .map(HintsStore::getPendingHintsInfo)
+                      .collect(Collectors.toList());
+    }
+
+    /**
+     * Returns all pending hints that this node has.
+     *
+     * @return a list of maps with endpoints' ids, total number of hint files, 
their oldest and newest timestamps.
+     */
+    public List<Map<String, String>> getPendingHints()

Review comment:
       I placed `asMap()` inside `PendingHintsInfo` because the nodetool 
command has to access all keys inside that map, so it is convenient to have 
these keys available as static constants. Check out
   
   
https://github.com/apache/cassandra/blob/af9e91019775d70871f112e2807b91bec44c39d5/src/java/org/apache/cassandra/hints/PendingHintsInfo.java#L52-L55
   
   
https://github.com/apache/cassandra/blob/af9e91019775d70871f112e2807b91bec44c39d5/src/java/org/apache/cassandra/tools/nodetool/ListPendingHints.java#L60-L67
   
   It feels to me that having these constants in the `HintsService` class would 
pollute the namespace. WDYT?




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