[GitHub] [hadoop-ozone] jojochuang commented on a change in pull request #345: HDDS-2703. OzoneFSInputStream to support ByteBufferReadable
jojochuang commented on a change in pull request #345: HDDS-2703. OzoneFSInputStream to support ByteBufferReadable URL: https://github.com/apache/hadoop-ozone/pull/345#discussion_r357386990 ## File path: hadoop-ozone/ozonefs/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java ## @@ -76,4 +79,21 @@ public boolean seekToNewSource(long targetPos) throws IOException { public int available() throws IOException { return inputStream.available(); } + + /** + * @param buf the ByteBuffer to receive the results of the read operation. + * @return the number of bytes read, possibly zero. Review comment: According to the ByteBufferReadable javadoc, it should return -1 if end of file. 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: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org
[GitHub] [hadoop-ozone] jojochuang commented on a change in pull request #345: HDDS-2703. OzoneFSInputStream to support ByteBufferReadable
jojochuang commented on a change in pull request #345: HDDS-2703. OzoneFSInputStream to support ByteBufferReadable URL: https://github.com/apache/hadoop-ozone/pull/345#discussion_r357315867 ## File path: hadoop-ozone/ozonefs/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSInputStream.java ## @@ -134,4 +135,20 @@ public void testO3FSMultiByteRead() throws IOException { Assert.assertTrue(Arrays.equals(value, data)); inputStream.close(); } + + @Test + public void testO3FSByteBufferRead() throws IOException { +FSDataInputStream inputStream = fs.open(filePath); Review comment: i would really love to see this wrapped in a try with block to ensure resource is closed properly. But I see that all test cases in the file follows the same pattern so maybe we can have a separate jira to correct that. 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: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org