[ 
https://issues.apache.org/jira/browse/HDDS-1691?focusedWorklogId=267113&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-267113
 ]

ASF GitHub Bot logged work on HDDS-1691:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Jun/19 23:20
            Start Date: 25/Jun/19 23:20
    Worklog Time Spent: 10m 
      Work Description: bharatviswa504 commented on 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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 267113)
    Time Spent: 2h  (was: 1h 50m)

> RDBTable#isExist should use Rocksdb#keyMayExist
> -----------------------------------------------
>
>                 Key: HDDS-1691
>                 URL: https://issues.apache.org/jira/browse/HDDS-1691
>             Project: Hadoop Distributed Data Store
>          Issue Type: Improvement
>            Reporter: Mukul Kumar Singh
>            Assignee: Aravindan Vijayan
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> RDBTable#isExist can use Rocksdb#keyMayExist, this avoids the cost of reading 
> the value for the key.
> Please refer, 
> https://github.com/facebook/rocksdb/blob/7a8d7358bb40b13a06c2c6adc62e80295d89ed05/java/src/main/java/org/rocksdb/RocksDB.java#L2184



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to