Skip to content

refactor(datalayer): key AttributeMap by DataKey instead of string - #2190

Draft
satyamg1620 wants to merge 1 commit into
llm-d:mainfrom
satyamg1620:data-prod-cons
Draft

refactor(datalayer): key AttributeMap by DataKey instead of string#2190
satyamg1620 wants to merge 1 commit into
llm-d:mainfrom
satyamg1620:data-prod-cons

Conversation

@satyamg1620

@satyamg1620 satyamg1620 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Plugins declare the data they exchange as DataKey values, but AttributeMap access took a raw string. Nothing tied a plugin's reads and writes to its Produces()/Consumes() declaration — a plugin could declare one key and use
another.

This types AttributeMap by DataKey:

Put(fwkplugin.DataKey, Cloneable)
Get(fwkplugin.DataKey) (Cloneable, bool)
Keys() []fwkplugin.DataKey

An undeclared raw-string key is now a compile error. scheduling.Endpoint restates these methods, so the change reaches every plugin call site.

Custom scalar metrics are named in configuration rather than in code, so attrmetrics.ScalarMetricDataKey derives their key from the configured name, keeping the extractor and its readers on one construction path.

Not covered: the key still isn't checked against the calling plugin's own declaration. That needs a per-plugin scoped accessor and is worth a separate issue.

Which issue(s) this PR fixes:

Fixes #1223

Signed-off-by: satyamg1620 <Satyam.Gupta.3@ibm.com>
@github-actions github-actions Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/cleanup and removed kind/cleanup labels Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data producer/consumer behavior should be enforced with their declaration

1 participant