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 committed May 9, 2024
1 parent bfa7263 commit f88a413
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 f88a413

Please sign in to comment.