|
@@ -69,6 +69,14 @@ public class FadvisedFileRegion extends DefaultFileRegion {
|
|
|
if (readaheadRequest != null) {
|
|
|
readaheadRequest.cancel();
|
|
|
}
|
|
|
+ super.releaseExternalResources();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Call when the transfer completes successfully so we can advise the OS that
|
|
|
+ * we don't need the region to be cached anymore.
|
|
|
+ */
|
|
|
+ public void transferSuccessful() {
|
|
|
if (manageOsCache && getCount() > 0) {
|
|
|
try {
|
|
|
NativeIO.POSIX.posixFadviseIfPossible(identifier,
|
|
@@ -78,6 +86,5 @@ public class FadvisedFileRegion extends DefaultFileRegion {
|
|
|
LOG.warn("Failed to manage OS cache for " + identifier, t);
|
|
|
}
|
|
|
}
|
|
|
- super.releaseExternalResources();
|
|
|
}
|
|
|
}
|