Store.gather / Store.defrag: limit them to items of the given namespace - #232
Merged
Merged
Conversation
All items (and the defrag target) must be in the given namespace: item names are given without the namespace and a "/" in an item name now raises ValueError. Such a name could address an item in a deeper namespace, with other nesting levels and another cache policy. As all ranges are in one namespace, they all have the same cache policy, so gather either reads all ranges via the cache path or gathers all of them from the backend with one call. This removes the per-range policy lookup and the merging of cached and backend ranges. gather and defrag share the validation and name mapping code (_find_sources). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Follow-up to #231.
Store.gatherandStore.defragnow require all items (and the defrag target) to be in the given namespace: item names are given without the namespace, and a/in an item name raisesValueError. A name with a/could address an item in a deeper namespace (e.g.sub/xin namespacedatabelongs todata/sub/if that is configured), with other nesting levels and another cache policy.This simplifies
Store.gather: all ranges are in one namespace, so they all have the same cache policy. gather now either reads all ranges via the cache path (writethrough / mirror namespace) or gathers all of them from the backend with one call. The per-range cache policy lookup and the merging of cached and backend ranges are gone._find_sources: shared by gather and defrag - validates the sources, rejects/in item names, maps the names to nested backend names (onefindper distinct name).gather/defragare unchanged (they get full backend names).defragwithnamespace="packs"and plain hex names.🤖 Generated with Claude Code