diff --git a/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/common/SparseFileTracker.java b/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/common/SparseFileTracker.java index 197ab28a81bca..6e6a11fbddc93 100644 --- a/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/common/SparseFileTracker.java +++ b/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/common/SparseFileTracker.java @@ -139,9 +139,10 @@ private long computeLengthOfRanges() { } /** - * Called before reading a range from the file to ensure that this range is present. Returns a list of gaps for the caller to fill. The - * range from the file is defined by {@code range} but the listener is executed as soon as a (potentially smaller) sub range - * {@code subRange} becomes available. + * Called before reading a range from the file to ensure that this range is present. Returns a list of gaps for the caller to fill, + * unless the {@code subRange} is already present in which case the listener is executed immediately without returning gaps. The range + * from the file is defined by {@code range} but the listener is executed as soon as a (potentially smaller) sub range {@code subRange} + * becomes available. * * @param range A ByteRange that contains the (inclusive) start and (exclusive) end of the desired range * @param subRange A ByteRange that contains the (inclusive) start and (exclusive) end of the listener's range