steveloughran commented on a change in pull request #1898: HADOOP-16852: Report
read-ahead error back
URL: https://github.com/apache/hadoop/pull/1898#discussion_r405032853
##########
File path:
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/ReadBufferManager.java
##########
@@ -289,6 +298,27 @@ private ReadBuffer getFromList(final
Collection<ReadBuffer> list, final AbfsInpu
return null;
}
+ /**
+ * Returns buffers that failed or passed from completed queue
+ * @param stream
+ * @param requestedOffset
+ * @return
+ */
+ private ReadBuffer getBufferFromCompletedQueue(final AbfsInputStream stream,
final long requestedOffset) {
+ for (ReadBuffer buffer : completedReadList) {
+ // Buffer is returned if the requestedOffset is at or above buffer's
+ // offset but less than buffer's length or the actual requestedLength
+ if ((buffer.getStream() == stream)
+ && (requestedOffset >= buffer.getOffset())
+ && ((requestedOffset < buffer.getOffset() + buffer.getLength())
Review comment:
Should always be for requested length? That is: we don't care about the
total length of the buffer, only the amount which was requested from the far
end -which may be less?
----------------------------------------------------------------
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]