YARN-8106. Update LogAggregationIndexedFileController to use readFull instead read to avoid IOException while loading log meta. (Prabhu Joseph via wangda)

Change-Id: I63a65f73f8d1636e2c99ed9c8c2bbd05efcff80f
(cherry picked from commit b779f4f0f614fe47e05bc2be5494cf3cbcf6f63c)
This commit is contained in:
Wangda Tan 2018-04-03 21:06:24 -07:00
parent 1a125dd92f
commit 2f326159f1

View File

@ -865,7 +865,8 @@ public IndexedLogsMeta loadIndexedLogsMeta(Path remoteLogPath, long end,
byte[] array = new byte[offset];
fsDataIStream.seek(
fileLength - offset - Integer.SIZE/ Byte.SIZE - UUID_LENGTH);
int actual = fsDataIStream.read(array);
fsDataIStream.readFully(array);
int actual = array.length;
if (actual != offset) {
throw new IOException("Error on loading log meta from "
+ remoteLogPath);