smengcl commented on a change in pull request #1164: HDDS-1829 On OM 
reload/restart OmMetrics#numKeys should be updated
URL: https://github.com/apache/hadoop/pull/1164#discussion_r307904383
 
 

 ##########
 File path: 
hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/db/RDBTable.java
 ##########
 @@ -183,4 +183,14 @@ public String getName() throws IOException {
   public void close() throws Exception {
     // Nothing do for a Column Family.
   }
+
+  @Override
+  public long getEstimatedKeyCount() throws IOException {
+    try {
+      return db.getLongProperty(handle, "rocksdb.estimate-num-keys");
+    } catch (RocksDBException e) {
+      throw new IOException(
+          "Failed to get estimated key count of the table.");
 
 Review comment:
   Sure! Done.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to