[ https://issues.apache.org/jira/browse/HDFS-8943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shradha Revankar updated HDFS-8943: ----------------------------------- Description: With the default Webhdfs server implementation the read apis in ByteRangeInputStream work as expected reading the correct number of bytes for these apis : {{ public int read(long position, byte[] buffer, int offset, int length) throws IOException }} {{public int read(long position, byte[] buffer, int offset, int length)}} But when a custom Webhdfs server implementation is plugged in which uses chunked Transfer-encoding, these apis read only the first chunk. Simple fix would be to loop and read till bytes specified similar to {{readfully()}} was: With the default Webhdfs server implementation the read apis in ByteRangeInputStream work as expected reading the correct number of bytes for these apis : {{public int read(long position, byte[] buffer, int offset, int length) throws IOException }} {{public int read(long position, byte[] buffer, int offset, int length)}} But when a custom Webhdfs server implementation is plugged in which uses chunked Transfer-encoding, these apis read only the first chunk. Simple fix would be to loop and read till bytes specified similar to {{readfully()}} > Read apis in ByteRangeInputStream does not read all the bytes specified when > chunked transfer-encoding is used in the server > ---------------------------------------------------------------------------------------------------------------------------- > > Key: HDFS-8943 > URL: https://issues.apache.org/jira/browse/HDFS-8943 > Project: Hadoop HDFS > Issue Type: Bug > Components: webhdfs > Affects Versions: 2.7.1 > Reporter: Shradha Revankar > Assignee: Shradha Revankar > > With the default Webhdfs server implementation the read apis in > ByteRangeInputStream work as expected reading the correct number of bytes for > these apis : > {{ public int read(long position, byte[] buffer, int offset, int length) > throws IOException }} > {{public int read(long position, byte[] buffer, int offset, int length)}} > But when a custom Webhdfs server implementation is plugged in which uses > chunked Transfer-encoding, these apis read only the first chunk. Simple fix > would be to loop and read till bytes specified similar to {{readfully()}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)