masteryhx commented on code in PR #24632:
URL: https://github.com/apache/flink/pull/24632#discussion_r1570103838


##########
flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopDataInputStream.java:
##########
@@ -140,4 +144,43 @@ public void skipFully(long bytes) throws IOException {
             bytes -= fsDataInputStream.skip(bytes);
         }
     }
+
+    @Override
+    public int read(ByteBuffer byteBuffer) throws IOException {
+        // Not all internal stream supports ByteBufferReadable
+        if 
(fsDataInputStream.hasCapability(StreamCapabilities.READBYTEBUFFER)) {
+            return fsDataInputStream.read(byteBuffer);
+        } else {
+            // Fallback to read byte then put

Review Comment:
   Since position read may fallback to just use the method of position read 
with extra byte array in hadoop, I'd prefer to implement this logic without 
extra array overhead.



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

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

Reply via email to