bharatviswa504 commented on a change in pull request #882: HDDS-1624 : Refactor
operations inside the bucket lock in OM key write.
URL: https://github.com/apache/hadoop/pull/882#discussion_r290362757
##########
File path:
hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/db/TypedTable.java
##########
@@ -79,6 +79,12 @@ public boolean isEmpty() throws IOException {
return rawTable.isEmpty();
}
+ @Override
+ public boolean isExist(KEY key) throws IOException {
+ return cache.get(new CacheKey<>(key)) != null ||
Review comment:
yes, think of a case like where flush to om DB has not happened, it is only
in the cache. so for key exist we need to check the value also in the cache, as
for delete case we set value as Optional.absent().
https://github.com/apache/hadoop/blob/trunk/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketDeleteRequest.java#L103
Can you add a java doc to the method caller should acquire/synchronize
before calling this method.
----------------------------------------------------------------
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]