Deprecate TagMap.create(int) — its size hint is a no-op#11978
Draft
dougqh wants to merge 1 commit into
Draft
Conversation
create(int) ignores its size (returns new OptimizedTagMap()); TagMap's storage can't honor a size hint without compromising its other optimizations. Mark it @deprecated pointing at create(), and migrate the two TagMap-internal callers (fromMap, Ledger.build) off it. The external callers (CoreTracer, DDSpanContext, TagContext) are left -- their deprecation warnings flag the sites a future dedicated sizing mechanism will convert (DDSpanContext especially). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
🎯 Code Coverage (details) 🔗 Commit SHA: 9ee448a | Docs | Datadog PR Page | Give us feedback! |
Contributor
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
TagMap.create(int size)ignores itssize— the body is justreturn new OptimizedTagMap();. TagMap's storage can't honor a size hint without compromising its other optimizations, so the size arg is vestigial and misleading (callers think they're pre-sizing; they aren't).create(int)@Deprecated, pointing atcreate(), with a javadoc explaining the size is ignored.fromMapandLedger.build()— since those components already knowcreatedoes nothing with the size.Deliberately left
The three external callers keep using it for now:
CoreTracer,DDSpanContext, andTagContext. Their deprecation warnings are a useful to-do list — a dedicated sizing mechanism is being developed separately (for the upcoming dense storage), andDDSpanContextin particular is its main target, so those sites will be converted there rather than churned here.Notes
create(int)andcreate()are identical today, so the migrated calls change nothing at runtime.Ledger.estimateSize()stays (uncalled internally now, but plausibly a future sizing-hint input).tag: ai generated
tag: no release note
🤖 Generated with Claude Code