Problem
Several cuvs-lucene KnnVectorsFormat providers resolve optional/version-specific implementations in eager static initializers. Lucene SPI discovery instantiates registered providers, so one initialization failure can poison unrelated codec resolution with ExceptionInInitializerError.
Proposed change
- Defer provider and flat-format construction until
fieldsReader or fieldsWriter is used.
- Safely publish cached instances.
- Preserve the original failure as the cause.
- Add fresh-JVM SPI enumeration and side-effect-free construction coverage.
Keep public names, defaults, and persisted formats unchanged. In particular, the existing binary-quantized provider must retain its released legacy flat-vector layout until migration support is implemented separately.
Related to #2512.
Problem
Several cuvs-lucene
KnnVectorsFormatproviders resolve optional/version-specific implementations in eager static initializers. Lucene SPI discovery instantiates registered providers, so one initialization failure can poison unrelated codec resolution withExceptionInInitializerError.Proposed change
fieldsReaderorfieldsWriteris used.Keep public names, defaults, and persisted formats unchanged. In particular, the existing binary-quantized provider must retain its released legacy flat-vector layout until migration support is implemented separately.
Related to #2512.