anmolanmol1234 commented on code in PR #8830:
URL: https://github.com/apache/hadoop/pull/8830#discussion_r4523796029
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/ReadBufferManagerV2.java:
##########
@@ -941,13 +1255,19 @@ private ReadBuffer getBufferFromCompletedQueue(final
String eTag,
for (ReadBuffer buffer : getCompletedReadList()) {
// Buffer is returned if the requestedOffset is at or above buffer's
// offset but less than buffer's length or the actual requestedLength
+ ReadBuffer parentBuffer = buffer.getParentBuffer();
if (Objects.equals(eTag, buffer.getETag())
&& (requestedOffset >= buffer.getOffset())
&& ((requestedOffset < buffer.getOffset() + buffer.getLength())
|| (requestedOffset
< buffer.getOffset() + buffer.getRequestedLength()))) {
return buffer;
}
+ else if (parentBuffer != null && eTag.equals(buffer.getETag())
Review Comment:
This will give NPE if eTag is null. Use Objects.equals
--
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]