Skip to content

Commit

Permalink
Reorder defs
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveCTurner committed Aug 10, 2020
1 parent c5b65bc commit 974c095
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ protected void readInternal(ByteBuffer b) throws IOException {
// We prefer to use the index cache if the recovery is not done yet
if (directory.isRecoveryDone() == false) {
// We try to use the snapshot blob cache if:
// - we're reading the first N bytes of the file
final boolean isStartOfFile = (position + length <= BlobStoreCacheService.DEFAULT_SIZE);
// - the file is small enough to be fully cached in the blob cache
final boolean canBeFullyCached = fileInfo.length() <= BlobStoreCacheService.DEFAULT_SIZE * 2;
// - we're reading the first N bytes of the file
final boolean isStartOfFile = (position + length <= BlobStoreCacheService.DEFAULT_SIZE);

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

0 comments on commit 974c095

Please sign in to comment.