mukul1987 commented on a change in pull request #654: HDDS-3150. Implement 
getIfExist in Table and use it in CreateKey/File
URL: https://github.com/apache/hadoop-ozone/pull/654#discussion_r390066571
 
 

 ##########
 File path: 
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBTable.java
 ##########
 @@ -155,6 +155,32 @@ public boolean isExist(byte[] key) throws IOException {
     }
   }
 
+  @Override
+  public byte[] getIfExist(byte[] key) throws IOException {
+    try {
+      // RocksDB#keyMayExist
+      // If the key definitely does not exist in the database, then this
+      // method returns false, else true.
+      rdbMetrics.incNumDBKeyGetIfExistChecks();
+      StringBuilder outValue = new StringBuilder();
+      boolean keyMayExist = db.keyMayExist(handle, key, outValue);
+      if (keyMayExist) {
+        // Not using out value from string builder, as that is causing
+        // IllegalArgumentException during protobuf parsing.
 
 Review comment:
   whats the reason for the illegal arguement exception ? Do we have a stack 
trace? 

----------------------------------------------------------------
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: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to