Skip to content

Commit

Permalink
[improve][offload] Replace usage of shaded class in OffsetsCache (#22683
Browse files Browse the repository at this point in the history
)

(cherry picked from commit 03a4995)
  • Loading branch information
lhotari authored and coderzc committed May 14, 2024
1 parent f8d2cc4 commit 32be893
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import io.grpc.netty.shaded.io.netty.util.concurrent.DefaultThreadFactory;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -49,7 +49,7 @@ public OffsetsCache() {
.build();
cacheEvictionExecutor =
Executors.newSingleThreadScheduledExecutor(
new DefaultThreadFactory("jcloud-offsets-cache-eviction"));
new ThreadFactoryBuilder().setNameFormat("jcloud-offsets-cache-eviction").build());
int period = Math.max(CACHE_TTL_SECONDS / 2, 1);
cacheEvictionExecutor.scheduleAtFixedRate(() -> {
entryOffsetsCache.cleanUp();
Expand Down

0 comments on commit 32be893

Please sign in to comment.