bharatviswa504 commented on a change in pull request #1013: HDDS-1691 : 
RDBTable#isExist should use Rocksdb#keyMayExist
URL: https://github.com/apache/hadoop/pull/1013#discussion_r297431352
 
 

 ##########
 File path: 
hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/db/RDBTable.java
 ##########
 @@ -122,7 +122,11 @@ public boolean isEmpty() throws IOException {
   @Override
   public boolean isExist(byte[] key) throws IOException {
     try {
-      return db.get(handle, key) != null;
+      // 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())
 
 Review comment:
   As discussed offline, can we add some tests with proto objects and see will 
it cause any issues.
   
   As our data in DB is byteArray of proto-objects. 

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