steveloughran commented on code in PR #5832:
URL: https://github.com/apache/hadoop/pull/5832#discussion_r1280864279


##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/prefetch/S3ARemoteInputStream.java:
##########
@@ -339,49 +367,67 @@ public int read(byte[] buffer, int offset, int len) 
throws IOException {
       numBytesRemaining -= bytesToRead;
       numBytesRead += bytesToRead;
     }
-
     return numBytesRead;
   }
 
-  protected S3ARemoteObject getFile() {
+  /**
+   * Forward to superclass after updating the read fully IOStatistics
+   * {@inheritDoc}
+   */
+  @Override
+  public void readFully(final long position,
+      final byte[] buffer,
+      final int offset,
+      final int length) throws IOException {
+    throwIfClosed();
+    validatePositionedReadArgs(position, buffer, offset, length);
+    streamStatistics.readFullyOperationStarted(position, length);
+    super.readFully(position, buffer, offset, length);
+  }
+
+  protected final S3ARemoteObject getRemoteObject() {
     return remoteObject;
   }
 
-  protected S3ARemoteObjectReader getReader() {
+  protected final S3ARemoteObjectReader getReader() {
     return reader;
   }
 
-  protected S3ObjectAttributes getS3ObjectAttributes() {
+  protected final S3ObjectAttributes getS3ObjectAttributes() {
     return s3Attributes;
   }
 
-  protected FilePosition getFilePosition() {
+  protected final FilePosition getFilePosition() {
     return fpos;
   }
 
-  protected String getName() {
+  protected final String getName() {
     return name;
   }
 
-  protected boolean isClosed() {
-    return closed;
+  protected final boolean isClosed() {
+    return closed.get();
+  }
+
+  protected final boolean underlyingResourcesClosed() {
+    return underlyingResourcesClosed.get();
   }
 
-  protected long getNextReadPos() {
+  protected final long getNextReadPos() {
     return nextReadPos;
   }
 
-  protected BlockData getBlockData() {
+  protected final BlockData getBlockData() {
     return blockData;
   }
 
-  protected S3AReadOpContext getContext() {
+  protected final S3AReadOpContext getContext() {
     return context;
   }
 
   private void incrementBytesRead(int bytesRead) {
     if (bytesRead > 0) {
-      streamStatistics.bytesRead(bytesRead);
+      streamStatistics.bytesReadFromBuffer(bytesRead);

Review Comment:
   trying to differentiate bytes we read remotely vs bytes which were returned 
from cached data. 



-- 
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]

Reply via email to