hanishakoneru commented on a change in pull request #3034:
URL: https://github.com/apache/ozone/pull/3034#discussion_r812328316
##########
File path:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainer.java
##########
@@ -667,6 +689,47 @@ public long getBlockCommitSequenceId() {
return containerData.getBlockCommitSequenceId();
}
+ /**
+ * Return whether the given localID of a block is present in the
+ * pendingPutBlockCache or not.
+ */
+ public boolean isBlockInPendingPutBlockCache(long localID) {
+ if (pendingPutBlockCache != null) {
+ return pendingPutBlockCache.contains(localID);
+ } else {
+ pendingPutBlockCache = new ArrayList<>();
Review comment:
In BlockManagerImpl#persistPutBlock, when we call
isBlockInPendingPutBlockCache() and it returns false, it later on calls
addToPendingPutBlockCache() to add the block to the cache.
In the good scenario, we should not call isBlockInPendingPutBlockCache() on
a closed container. But I just added this check here to not introduce a
NullPointerException in a highly unlikely exception corner case.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]