apache / apache/lucene

Expose the name or an indication of which VectorizationProvider is being used

Open
#15,292 8 comments 0 reactions 0 assignees View on GitHub
type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

### Description

Given an application that could benefit from using PanamaVectorizationProvider, I would like to be able to detect on startup if the conditions are adequate (`jdk.incubator.vector` module was added, Java is within the right range of versions, etc) so that the application can make a decision based on that (i.e. log a warning, or simply preventing to start at all if conditions aren't met).
Right now, this doesn't seem possible without using some kind of reflection and hacks on the VectorizationProvider class, or by duplicating some of the initialization code on the application side and keeping it in sync with Lucene's.

I was thinking we could have a `public static String getImplementationName()` or something that's allowed to be called from outside of the specific `VALID_CALLERS`.

I understand much of the work around the VectorizationProvider was done to not expose the internals since they are subject to change quickly and without compatibility, but the problem right now is that something such as a java version upgrade could cause unintended perf regressions.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing VectorizationProvider, its initialization conditions, and the VALID_CALLERS restriction described in the issue. Define how an externally callable name or indication should report the selected provider across Java-version and jdk.incubator.vector-module conditions, while preserving the stated compatibility boundaries; done means applications can reliably detect the active provider without reflection or duplicated initialization logic.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.