Apache9 commented on a change in pull request #581: HBASE-22888 Use separate classe to deal with streaming read and pread URL: https://github.com/apache/hbase/pull/581#discussion_r323545030
########## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java ########## @@ -614,7 +629,11 @@ public static Reader createReader(FileSystem fs, Path path, CacheConfig cacheCon static Reader createReaderFromStream(Path path, FSDataInputStream fsdis, long size, CacheConfig cacheConf, Configuration conf) throws IOException { FSDataInputStreamWrapper wrapper = new FSDataInputStreamWrapper(fsdis); - return openReader(path, wrapper, size, cacheConf, null, true, conf); + Reader preadReader = openReader(path, wrapper, size, cacheConf, null, true, true, conf); Review comment: This is a bit strange, that we create two readers, but only returns one of them, without closing the other one...I know there is no problem, as the resources are in the FSDataInputStream passed in, but still a bit strange ---------------------------------------------------------------- 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