|
@@ -207,7 +207,7 @@ class BlockSender implements java.io.Closeable, FSConstants {
|
|
|
* close opened files.
|
|
|
*/
|
|
|
public void close() throws IOException {
|
|
|
- if (blockInFd != null && shouldDropCacheBehindRead) {
|
|
|
+ if (blockInFd != null && shouldDropCacheBehindRead && isLongRead()) {
|
|
|
// drop the last few MB of the file from cache
|
|
|
try {
|
|
|
NativeIO.posixFadviseIfPossible(blockInFd, lastCacheDropOffset, offset
|