Skip to content

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
henningandersen committed Jan 24, 2024
1 parent 7348ca5 commit c2ad2c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ boolean tryEvictNoDecRef() {

return false;
}

public boolean forceEvict() {
assert Thread.holdsLock(SharedBlobCacheService.this) : "must hold lock when evicting";
if (evict()) {
Expand Down Expand Up @@ -1434,6 +1435,7 @@ private SharedBytes.IO maybeEvictAndTake(Runnable evictedNotification) {
// give up
return null;
}

/**
* This method tries to evict the least used {@link LFUCacheEntry}. Only entries with the lowest possible frequency are considered
* for eviction.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,7 @@ public void testGetMultiThreaded() throws IOException {
final boolean allowAlreadyClosed = regionCount < threads;
Settings settings = Settings.builder()
.put(NODE_NAME_SETTING.getKey(), "node")
.put(
SharedBlobCacheService.SHARED_CACHE_SIZE_SETTING.getKey(),
ByteSizeValue.ofBytes(size(regionCount * 100L)).getStringRep()
)
.put(SharedBlobCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), ByteSizeValue.ofBytes(size(regionCount * 100L)).getStringRep())
.put(SharedBlobCacheService.SHARED_CACHE_REGION_SIZE_SETTING.getKey(), ByteSizeValue.ofBytes(size(100)).getStringRep())
.put(SharedBlobCacheService.SHARED_CACHE_MIN_TIME_DELTA_SETTING.getKey(), randomFrom("0", "1ms", "10s"))
.put("path.home", createTempDir())
Expand Down Expand Up @@ -360,13 +357,9 @@ public void testGetMultiThreaded() throws IOException {
try {
SharedBlobCacheService<String>.CacheFileRegion cacheFileRegion;
try {
cacheFileRegion = cacheService.get(
cacheKeys[i],
fileLength,
regions[i]
);
cacheFileRegion = cacheService.get(cacheKeys[i], fileLength, regions[i]);
} catch (AlreadyClosedException e) {
assert allowAlreadyClosed || e.getMessage().equals("evicted during free region allocation"): e;
assert allowAlreadyClosed || e.getMessage().equals("evicted during free region allocation") : e;
throw e;
}
if (cacheFileRegion.tryIncRef()) {
Expand Down

0 comments on commit c2ad2c6

Please sign in to comment.