Skip to content

Conversation

@XN137
Copy link
Contributor

@XN137 XN137 commented Sep 13, 2025

WIP as currently based on https://github.com/apache/polaris/pull/2555

since PolarisCredentialVendor (a sub-interface of PolarisMetaStoreManager) no longer has
a CallContext parameter we can see a domino effect:

  • StorageCredentialCache no longer needs CallContext
  • TokenBroker no longer needs CallContext
  • FileIOFactory no longer needs CallContext
  • TaskFileIOSupplier no longer needs CallContext
  • TaskHandler and TaskExecutor no longer need CallContext
  • ResolverFactory and ResolutionManifest no longer need CallContext

and eventually PolarisCallContext and CallContext are completely unused and can be
removed or replaced by passing RealmContext and RealmConfig individually.

@github-project-automation github-project-automation bot moved this to PRs In Progress in Basic Kanban Board Sep 13, 2025
@XN137 XN137 force-pushed the remove-CallContext branch 3 times, most recently from 453e3a3 to 9db523a Compare September 15, 2025 14:21
@XN137 XN137 force-pushed the remove-CallContext branch 8 times, most recently from a4ea060 to d1f6dff Compare October 1, 2025 06:23
@XN137 XN137 force-pushed the remove-CallContext branch 4 times, most recently from 8b17318 to 5c80acb Compare October 7, 2025 13:32
@XN137 XN137 force-pushed the remove-CallContext branch 4 times, most recently from 15ea1f1 to cf25520 Compare October 14, 2025 12:48
@XN137 XN137 force-pushed the remove-CallContext branch 3 times, most recently from 114cc94 to 3601564 Compare October 18, 2025 06:37
XN137 added 3 commits October 23, 2025 17:33
the `PolarisMetaStoreManager` interface methods all take a `PolarisCallContext` parameter
because they need access to `PolarisCallContext.getMetaStore` aka the persistence session.
also occasionally the `RealmContext` and `RealmConfig` is needed.

this means `PolarisMetaStoreManager` is only usable within a request-scope.
`MetaStoreManagerFactory.getOrCreateMetaStoreManager` impls suggests that there needs to
be one shared `PolarisMetaStoreManager` instance per realm.
however if we look at the `PolarisMetaStoreManager` impls (`AtomicOperationMetaStoreManager`
and `TransactionalMetaStoreManagerImpl`) we can see that they dont have any state themselves,
the fields only reference application-scoped collaborators.

those 2 observations combined mean that in order to reduce the dependency on
`PolarisCallContext` the `PolarisMetaStoreManager` has to become request-scoped.
note that if custom implementations would need any state sharing for a realm, they are still
free to do so in their custom `MetaStoreManagerFactory` implementations, as they can
initialize the request-scoped `PolarisMetaStoreManager` with whatever data they need.

when `PolarisMetaStoreManager` is request-scoped the `getOrCreateSession` method also becomes
a private implementation detail of the `MetaStoreManagerFactory`.
the `EntityCache` / `InMemoryEntityCache` however can no longer operate on a single
`PolarisMetaStoreManager` and the one from the request needs to be passed as a parameter in
all the methods now.
this avoids `TokenBrokerFactory` impls having to call
`MetaStoreManagerFactory.createMetaStoreManager`
since `PolarisCredentialVendor` (a sub-interface of `PolarisMetaStoreManager`) no longer has
a `CallContext` parameter we can see a domino effect:
- `StorageCredentialCache` no longer needs `CallContext`
- `TokenBroker` no longer needs `CallContext`
- `FileIOFactory` no longer needs `CallContext`
- `TaskFileIOSupplier` no longer needs `CallContext`
- `TaskHandler` and `TaskExecutor` no longer need `CallContext`
- `ResolverFactory` and `ResolutionManifest` no longer need `CallContext`

and eventually `PolarisCallContext` and `CallContext` are completely unused and can be
removed or replaced by passing `RealmContext` and `RealmConfig` individually.
@XN137 XN137 force-pushed the remove-CallContext branch from 3601564 to 1dd1f94 Compare October 23, 2025 15:53
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.

1 participant