bharatviswa504 commented on a change in pull request #101: HDDS-2364. Add OM 
metrics to find the false positive rate for the keyMayExist.
URL: https://github.com/apache/hadoop-ozone/pull/101#discussion_r340384007
 
 

 ##########
 File path: 
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/utils/db/RDBTable.java
 ##########
 @@ -125,8 +127,17 @@ public boolean isExist(byte[] key) throws IOException {
       // RocksDB#keyMayExist
       // If the key definitely does not exist in the database, then this
       // method returns false, else true.
-      return db.keyMayExist(handle, key, new StringBuilder())
-          && db.get(handle, key) != null;
+      rdbMetrics.incNumDBKeyMayExistChecks();
+      boolean keyMayExist = db.keyMayExist(handle, key, new StringBuilder());
+      if (!keyMayExist) {
 
 Review comment:
   if (keyMayExist) {
   boolean keyGet = (db.get(handle, key) != null);
           if (!keyGet) {
             rdbMetrics.incNumDBKeyMayExistMisses();
           }
           return keyGet;
   } 
   return false;
   Can we modify the logic as above.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-h...@hadoop.apache.org

Reply via email to