Browse Source

MAPREDUCE-6678. Allow ShuffleHandler readahead without drop-behind. Contributed by Nathan Roberts.

Eric Payne 9 years ago
parent
commit
cd35b692de

+ 1 - 1
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/FadvisedFileRegion.java

@@ -74,7 +74,7 @@ public class FadvisedFileRegion extends DefaultFileRegion {
   @Override
   public long transferTo(WritableByteChannel target, long position)
       throws IOException {
-    if (manageOsCache && readaheadPool != null) {
+    if (readaheadPool != null && readaheadLength > 0) {
       readaheadRequest = readaheadPool.readaheadStream(identifier, fd,
           getPosition() + position, readaheadLength,
           getPosition() + getCount(), readaheadRequest);