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 b779f4f0f6)
This commit is contained in:
Wangda Tan 2018-04-03 21:06:24 -07:00
parent 1a125dd92f
commit 2f326159f1
1 changed files with 2 additions and 1 deletions

View File

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