Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import datadog.communication.serialization.EncodingCache;
import datadog.trace.common.writer.ddagent.SimpleUtf8Cache.CacheEntry;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.nio.charset.StandardCharsets;

/**
Expand Down Expand Up @@ -63,6 +64,10 @@
* calling ValueUtf8Cache#reclibrate will adjust promotion thresholds to
* provide better cache utilization.
*/
@SuppressFBWarnings(
value = "IS2_INCONSISTENT_SYNC",
justification =
"stat updates are deliberately racy - sync is only used to prevent simultaneous bulk updates")
public final class GenerationalUtf8Cache implements EncodingCache {
static final int MAX_EDEN_CAPACITY = 512;
static final int MAX_TENURED_CAPACITY = 1024;
Expand Down Expand Up @@ -156,7 +161,7 @@ public synchronized void recalibrate() {
*
* <p>While still racy this method is synchronized to avoid simultaneous recalibrations
*/
public void recalibrate(long accessTimeMs) {
public synchronized void recalibrate(long accessTimeMs) {
this.accessTimeMs = accessTimeMs;

recalibrate(this.edenEntries);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ public final class SimpleUtf8Cache implements EncodingCache {

private static final int MAX_PROBES = 4;

private final int SIZE = 64;

private final int[] markers;
private final CacheEntry[] entries;

Expand Down