saxenapranav commented on code in PR #6699:
URL: https://github.com/apache/hadoop/pull/6699#discussion_r1569997020
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsInputStream.java:
##########
@@ -285,13 +335,23 @@ public synchronized int read(final byte[] b, final int
off, final int len) throw
return totalReadBytes > 0 ? totalReadBytes : lastReadBytes;
}
- private boolean shouldReadFully() {
+ private boolean shouldReadFully(int lengthToRead) {
Review Comment:
Have added comment in the new if block.
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsInputStream.java:
##########
@@ -285,13 +335,23 @@ public synchronized int read(final byte[] b, final int
off, final int len) throw
return totalReadBytes > 0 ? totalReadBytes : lastReadBytes;
}
- private boolean shouldReadFully() {
+ private boolean shouldReadFully(int lengthToRead) {
+ if (!fileStatusInformationPresent.get()) {
+ return (lengthToRead + fCursor) <= this.bufferSize
+ && this.firstRead && this.context.readSmallFilesCompletely();
+ }
+
return this.firstRead && this.context.readSmallFilesCompletely()
- && this.contentLength <= this.bufferSize;
+ && getContentLength() <= this.bufferSize;
}
- private boolean shouldReadLastBlock() {
- long footerStart = max(0, this.contentLength - FOOTER_SIZE);
+ private boolean shouldReadLastBlock(int lengthToRead) {
+ if (!fileStatusInformationPresent.get()) {
Review Comment:
Have added comment in the new if block.
--
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]