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


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/VectoredReadUtils.java:
##########
@@ -133,26 +172,42 @@ private static void 
readNonByteBufferPositionedReadable(PositionedReadable strea
   /**
    * Read bytes from stream into a byte buffer using an
    * intermediate byte array.
-   * @param length number of bytes to read.
+   *   <pre>
+   *     (position, buffer, buffer-offset, length): Void
+   *     position:= the position within the file to read data.
+   *     buffer := a buffer to read fully `length` bytes into.
+   *     buffer-offset := the offset within the buffer to write data
+   *     length := the number of bytes to read.
+   *   </pre>
+   * The passed in function MUST block until the required length of
+   * data is read, or an exception is thrown.
+   * @param range range to read
    * @param buffer buffer to fill.
    * @param operation operation to use for reading data.
    * @throws IOException any IOE.
    */
-  public static void readInDirectBuffer(int length,
-                                        ByteBuffer buffer,
-                                        Function4RaisingIOE<Integer, byte[], 
Integer,
-                                                Integer, Void> operation) 
throws IOException {
+  public static void readInDirectBuffer(FileRange range,
+      ByteBuffer buffer,
+      Function4RaisingIOE<Long, byte[], Integer, Integer, Void> operation)
+      throws IOException {
+
+    LOG.debug("Reading {} into a direct buffer", range);
+    validateRangeRequest(range);

Review Comment:
   because it is a public method called by the filesystems, and I'm just being 
rigorous. it is a low cost probe



-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to