dimas-b commented on code in PR #3803:
URL: https://github.com/apache/polaris/pull/3803#discussion_r2996291490
##########
runtime/service/src/main/java/org/apache/polaris/service/config/ServiceProducers.java:
##########
@@ -217,6 +219,20 @@ public MetaStoreManagerFactory metaStoreManagerFactory(
return
metaStoreManagerFactories.select(Identifier.Literal.of(config.type())).get();
}
+ @Produces
+ @ApplicationScoped
+ public IdempotencyStoreFactory idempotencyStoreFactory(
+ PersistenceConfiguration config,
+ @Any Instance<IdempotencyStoreFactory> idempotencyFactories) {
+ return
idempotencyFactories.select(Identifier.Literal.of(config.type())).get();
+ }
+
+ @Produces
+ @ApplicationScoped
+ public IdempotencyStore idempotencyStore(IdempotencyStoreFactory factory) {
+ return factory.create();
Review Comment:
Sorry for late reply.
As I commented above, I do not see much value in adding a new factory
interface for `IdempotencyStore` to `polaris-core`.
I see value in having uniform producer code for `IdempotencyStore`
implementations in `runtime/service`, though.
So, I'd propose removing the `IdempotencyStoreFactory` from `polaris-core`
and instead:
1) Annotate `RelationalJdbcIdempotencyStore` with
`@Identifier("relational-jdbc")`
2) Add a new class for `InMemoryIdempotencyStore` in `runtime/service` and
have its producer method annotated with `@ApplicationScoped` and
`@Identifier("in-memory")`
3) this `idempotencyStore` should be able to select from `@Any
Instance<IdempotencyStore` (similar to `idempotencyStoreFactory`).
My rationale is to reduce the SPI surface in `polaris-core`, while keeping
the same level of configurability.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]