uschindler opened a new pull request, #12410: URL: https://github.com/apache/lucene/pull/12410
This refactors the vectorization support introduced in Lucene 9.7 to allow to plugin vectorization support for more classes except 'VectorUtil': - Move all classes to internal package `org.apache.lucene.internal.vectorization` - Add interface `VectorUtilImpl` for the current `VectorUtil` backing. This allows to add more - Make the main entry point `VectorizationProvider` an abstract class (this was needed as private static methods don't work in interfaces). - The instance of `VectorizationProvider` is only accessble by a fixed list of caller classes (caller sensitive). The package is hidden by module system, but for classpath applications it is still visible, so prevent misuse. This was built like the `TestSecrets` class in the sister package which is only accessible from test framework. The new setup allows: - If we get new implementations like `ForUtil` (see #12396), we can add a new interface and add a getter to get a singleton (like `VectorUtilImpl`) or new instance of `ForUtil` for use by codec (which has state). We can have separate implementations for various versions of the codec (e.g., let's start with the 9.x codec). The original scalar implementation is copied to the internal package, the vectorized implementation is added to the Java 20 source folder. - We can also add a FMA-based VectorUtil implementation in the future if the JDK allows us to check which features are available at runtime. So based on some lookup "does incubator.vector support FMA for current CPU), we could return a different impl. We can change packages and naming a bit. I don't like `*Impl` for interface names. Maybe `VectorUtilSupport` instead? -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org