HDFS-10291 TestShortCircuitLocalRead failing (stevel)

(cherry picked from commit dd64769699)
This commit is contained in:
Steve Loughran 2016-04-18 10:26:35 +01:00 committed by Walter Su
parent b5d4c7dc76
commit 438efc3634
1 changed files with 5 additions and 2 deletions

View File

@ -153,8 +153,11 @@ public class TestShortCircuitLocalRead {
//Read a small number of bytes first. //Read a small number of bytes first.
int nread = stm.read(actual, 0, 3); int nread = stm.read(actual, 0, 3);
nread += stm.read(actual, nread, 2); nread += stm.read(actual, nread, 2);
//Read across chunk boundary int len = 517;
nread += stm.read(actual, nread, 517); if (actual.length - nread >= len) {
//Read across chunk boundary
nread += stm.read(actual, nread, len);
}
checkData(actual, readOffset, expected, nread, "A few bytes"); checkData(actual, readOffset, expected, nread, "A few bytes");
//Now read rest of it //Now read rest of it
while (nread < actual.length) { while (nread < actual.length) {