HDFS-15080. Fix the issue in reading persistent memory cached data with an offset. Contributed by Feilong He.

(cherry picked from commit 7030722e5d)
This commit is contained in:
Rakesh Radhakrishnan 2020-01-08 14:25:17 +05:30
parent c5580af1c4
commit b1eb47865c
1 changed files with 1 additions and 1 deletions

View File

@ -821,7 +821,7 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
if (addr != -1) { if (addr != -1) {
LOG.debug("Get InputStream by cache address."); LOG.debug("Get InputStream by cache address.");
return FsDatasetUtil.getDirectInputStream( return FsDatasetUtil.getDirectInputStream(
addr, info.getBlockDataLength()); addr + seekOffset, info.getBlockDataLength() - seekOffset);
} }
LOG.debug("Get InputStream by cache file path."); LOG.debug("Get InputStream by cache file path.");
return FsDatasetUtil.getInputStreamAndSeek( return FsDatasetUtil.getInputStreamAndSeek(