Skip to content

feat: add deregister to ObjectStoreRegistry#784

Open
kszucs wants to merge 1 commit into
apache:mainfrom
kszucs:registry-deregister
Open

feat: add deregister to ObjectStoreRegistry#784
kszucs wants to merge 1 commit into
apache:mainfrom
kszucs:registry-deregister

Conversation

@kszucs

@kszucs kszucs commented Jun 30, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

No tracking issue; happy to file one if preferred.

Rationale for this change

ObjectStoreRegistry can register and resolve stores but has no way to remove one. Consumers that register stores dynamically (e.g. per-session) need to deregister them as well.

What changes are included in this PR?

  • Add ObjectStoreRegistry::deregister(&self, url: &Url) -> Option<Arc<dyn ObjectStore>>, the inverse of register, with a default implementation returning None.
  • Implement it for DefaultObjectStoreRegistry: removes the store at the exact scheme/authority/path of url (siblings and longer prefixes are left in place) and prunes emptied tree branches.
  • Tests covering exact removal, sibling/longer-prefix preservation, and unknown URLs.

Are there any user-facing changes?

Yes: a new ObjectStoreRegistry::deregister trait method. It has a default implementation, so existing implementors are unaffected.

Add `ObjectStoreRegistry::deregister`, the inverse of `register`: it removes
the store registered at the exact scheme/authority/path of a URL and returns
it, pruning emptied tree branches. A default implementation returns `None`, so
the addition is non-breaking for existing implementors.
@kszucs kszucs force-pushed the registry-deregister branch from 4cb3324 to adaee28 Compare June 30, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants