Re: [DISCUSS] Java SPI way of loading custom implementations

2025-08-15 Thread Štefan Miklošovič
Hi Dinesh, I am glad you asked. 1) A node just fails to start. It will print something like this while booting and the whole Cassandra process exits. Exception (org.apache.cassandra.cql3.constraints.InvalidConstraintDefinitionException) encountered during startup: Unrecognized constraint functio

Re: [DISCUSS] Java SPI way of loading custom implementations

2025-08-15 Thread Dinesh Joshi
Stefan - I understand the motivation behind this feature. I totally am for introducing it. I just have a couple questions - 1. What is Cassandra's behavior when custom constraints are used but are missing on disk? I'm imagining a situation where someone failed to include the jar in their deploymen

Re: [DISCUSS] Java SPI way of loading custom implementations

2025-08-15 Thread Štefan Miklošovič
I do not see any more activity on this thread so I will proceed. This does not seem to be controversial as there is already precedent in place and nobody vehemently objects. Regards On Mon, Aug 11, 2025 at 7:57 PM Mick wrote: > > > > > > I have 0 issues with ServiceLoader, but I think the bigge

Re: [DISCUSS] Java SPI way of loading custom implementations

2025-08-11 Thread Mick
> > I have 0 issues with ServiceLoader, but I think the bigger question is “what > is a public api”. Let's also please be clear in separating what are our public SPIs and our public APIs, as compatibility concerns are different for each. We typically refer to both when mentioning API

Re: [DISCUSS] Java SPI way of loading custom implementations

2025-08-11 Thread Štefan Miklošovič
We could also make it so that if we detect that a constraint is not resolvable, we would just skip it. However I am not sure how safe that is and what is worse - to fail to start a node when constraints are not present, or to continue to act as if nothing happened while somebody could put there inv

Re: [DISCUSS] Java SPI way of loading custom implementations

2025-08-11 Thread Štefan Miklošovič
I do not think it is there just for testing. The original patch includes this commit message: Fix sstable formats configuration - refactored sstable format configuration - sstable formats are discovered via ServiceLoader ... So the fact it is explicitly stated like this does not seem to be relat

Re: [DISCUSS] Java SPI way of loading custom implementations

2025-08-11 Thread David Capwell
I have 0 issues with ServiceLoader, but I think the bigger question is “what is a public api”. In #1 I see the first comment is > The `CustomConstraintsProvider` class will create custom constraints. This implies to mean that this is a new public API that must be maintained, and the current p

[DISCUSS] Java SPI way of loading custom implementations

2025-08-11 Thread Štefan Miklošovič
I want to ask what people think about ServiceLoader's (Java SPI) in the context of Cassandra. There is already a precedent with ServiceLoader loader = ServiceLoader.load(SSTableFormat.Factory.class, DatabaseDescriptor.class.getClassLoader()); in DatabaseDescriptor.applySSTableFormats I am askin