Skip to content

Commit 974c095

Browse files
committed
Reorder defs
1 parent c5b65bc commit 974c095

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/index/store/cache/CachedBlobContainerIndexInput.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ protected void readInternal(ByteBuffer b) throws IOException {
161161
// We prefer to use the index cache if the recovery is not done yet
162162
if (directory.isRecoveryDone() == false) {
163163
// We try to use the snapshot blob cache if:
164-
// - we're reading the first N bytes of the file
165-
final boolean isStartOfFile = (position + length <= BlobStoreCacheService.DEFAULT_SIZE);
166164
// - the file is small enough to be fully cached in the blob cache
167165
final boolean canBeFullyCached = fileInfo.length() <= BlobStoreCacheService.DEFAULT_SIZE * 2;
166+
// - we're reading the first N bytes of the file
167+
final boolean isStartOfFile = (position + length <= BlobStoreCacheService.DEFAULT_SIZE);
168168

169169
if (canBeFullyCached || isStartOfFile) {
170170
final CachedBlob cachedBlob = directory.getCachedBlob(fileInfo.physicalName(), 0L, length);

0 commit comments

Comments
 (0)