Skip to content
Draft
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
11 changes: 11 additions & 0 deletions gradle/forbiddenApiFilters/instrumentation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,14 @@ datadog.trace.bootstrap.instrumentation.api.AgentSpan#setServiceName(java.lang.S
# (see datadog.apicontract.Restricted). Instrumentation uses TagMap's checked methods.
@defaultMessage TagMap.internals() is restricted to the tracer core; use TagMap's checked methods instead.
datadog.trace.api.TagMap#internals()

# A span's tag stores, how it gets them from a parent, and the span's view of them skip checks the tracer
# core has already made; they are @Restricted to the core (see datadog.apicontract.Restricted).
# Instrumentation uses TagMap's checked methods.
@defaultMessage Tag stores are restricted to the tracer core; use TagMap's checked methods instead.
datadog.trace.api.HashStore
datadog.trace.api.IdStore
datadog.trace.api.TagMap#readThroughParent(datadog.trace.api.TagMap)
datadog.trace.api.TagMap#viewOf(datadog.trace.api.IdStore,datadog.trace.api.HashStore,boolean)
datadog.trace.api.TagMap#customStore()
datadog.trace.api.TagMap#isCustomStoreBorrowed()
8 changes: 8 additions & 0 deletions internal-api/src/main/java/datadog/trace/api/HashStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ public final class HashStore {
*/
private Set<String> removedFromParent;

/**
* {@code parent}'s custom store, for an owner to borrow read-only until its first custom write,
* or null.
*/
public static HashStore inheritedFrom(TagMap parent) {
return parent == null ? null : parent.nameStore;
}

/**
* A fresh custom store for an owner's first custom write, reading through to {@code borrowed},
* the store it borrowed until now (may be null).
Expand Down
18 changes: 0 additions & 18 deletions internal-api/src/main/java/datadog/trace/api/HashSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -414,24 +414,6 @@ static String toInternalString(Object[] buckets) {
return ledger.toString();
}

/** Whether {@code buckets} holds no entry, checked bucket by bucket. */
static boolean isEmpty(Object[] buckets) {
Object[] thisBuckets = buckets;

for (int i = 0; i < thisBuckets.length; ++i) {
Object curBucket = thisBuckets[i];

if (curBucket instanceof Entry) {
return false;
} else if (curBucket instanceof BucketGroup) {
BucketGroup curGroup = (BucketGroup) curBucket;
if (!curGroup.isEmptyChain()) return false;
}
}

return true;
}

/** Walks a bucket array's raw entries, tombstones included, for an iterator. */
static final class BucketWalker {
private Object[] buckets;
Expand Down
5 changes: 5 additions & 0 deletions internal-api/src/main/java/datadog/trace/api/IdStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ interface Cursor {
EntryReader next();
}

/** A fresh id store reading through to {@code parent}'s known tags (parent may be null). */
public static IdStore create(TagMap parent) {
return IdStoreFactory.Default.INSTANCE.create(parent == null ? null : parent.knownStore);
}

/** Throws for an id that names no known tag. */
static IllegalArgumentException notKnown(long tagId) {
return new IllegalArgumentException("not a known tag id: " + Long.toHexString(tagId));
Expand Down
Loading
Loading