Skip to content

Commit f313fd8

Browse files
committed
Drop unbounded cache
1 parent 9b3f2ac commit f313fd8

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

api/incubator/src/main/java/io/opentelemetry/api/incubator/common/ExtendedAttributeKey.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ default AttributeKey<T> asAttributeKey() {
5050
/** Return an ExtendedAttributeKey equivalent to the {@code attributeKey}. */
5151
// TODO (jack-berg): remove once AttributeKey.asExtendedAttributeKey is available
5252
static <T> ExtendedAttributeKey<T> fromAttributeKey(AttributeKey<T> attributeKey) {
53-
return InternalExtendedAttributeKeyImpl.fromAttributeKey(attributeKey);
53+
return InternalExtendedAttributeKeyImpl.toExtendedAttributeKey(attributeKey);
5454
}
5555

5656
/** Returns a new ExtendedAttributeKey for String valued attributes. */

api/incubator/src/main/java/io/opentelemetry/api/incubator/internal/InternalExtendedAttributeKeyImpl.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import io.opentelemetry.api.incubator.common.ExtendedAttributeType;
1212
import io.opentelemetry.api.internal.InternalAttributeKeyImpl;
1313
import java.nio.charset.StandardCharsets;
14-
import java.util.concurrent.ConcurrentHashMap;
1514
import javax.annotation.Nullable;
1615

1716
/**
@@ -20,9 +19,6 @@
2019
*/
2120
public final class InternalExtendedAttributeKeyImpl<T> implements ExtendedAttributeKey<T> {
2221

23-
private static final ConcurrentHashMap<AttributeKey<?>, ExtendedAttributeKey<?>>
24-
ATTRIBUTE_KEY_CACHE = new ConcurrentHashMap<>();
25-
2622
private final ExtendedAttributeType type;
2723
private final String key;
2824
private final int hashCode;
@@ -47,17 +43,6 @@ public static <T> ExtendedAttributeKey<T> create(
4743
return new InternalExtendedAttributeKeyImpl<>(type, key != null ? key : "");
4844
}
4945

50-
/**
51-
* Return an {@link ExtendedAttributeKey} equivalent to the {@code attributeKey}, caching entries
52-
* in {@link #ATTRIBUTE_KEY_CACHE}.
53-
*/
54-
@SuppressWarnings("unchecked")
55-
public static <T> ExtendedAttributeKey<T> fromAttributeKey(AttributeKey<T> attributeKey) {
56-
return (ExtendedAttributeKey<T>)
57-
ATTRIBUTE_KEY_CACHE.computeIfAbsent(
58-
attributeKey, InternalExtendedAttributeKeyImpl::toExtendedAttributeKey);
59-
}
60-
6146
@Override
6247
public ExtendedAttributeType getType() {
6348
return type;

0 commit comments

Comments
 (0)