Huang Kuan Hao created HDDS-16350:
-------------------------------------

             Summary: Use isExist instead of a value get for the start-key 
check in RDBTable.getRangeKVs
                 Key: HDDS-16350
                 URL: https://issues.apache.org/jira/browse/HDDS-16350
             Project: Apache Ozone
          Issue Type: Improvement
            Reporter: Huang Kuan Hao
            Assignee: Huang Kuan Hao


RDBTable.getRangeKVs checks whether startKey exists with get(startKey) == null, 
a full point-get that materializes and then discards the value byte[], 
immediately followed by it.seek(startKey).

Current:
if ((prefix == null || startKey.length > prefix.length)
    && get(startKey) == null) {
  // Key not found, return empty list
  return result;
}
it.seek(startKey);

isExist(byte[]) already answers this via keyMayExist (bloom filter) and only 
point-gets when keyMayExist is undecided, so it does not materialize the value 
in the common case and is exact. Fix: use !isExist(startKey). Behavior 
unchanged.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to