Module org.apache.lucene.core
Class VectorizationProvider
- java.lang.Object
-
- org.apache.lucene.internal.vectorization.VectorizationProvider
-
- Direct Known Subclasses:
DefaultVectorizationProvider
public abstract class VectorizationProvider extends java.lang.Object
A provider of vectorization implementations. Depending on the Java version and availability of vectorization modules in the Java runtime this class provides optimized implementations (using SIMD) of several algorithms used throughout Apache Lucene.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
VectorizationProvider.Holder
This static holder class prevents classloading deadlock.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
LOG
(package private) static boolean
TESTS_FORCE_INTEGER_VECTORS
(package private) static java.util.OptionalInt
TESTS_VECTOR_SIZE
private static java.util.Set<java.lang.String>
VALID_CALLERS
private static java.lang.Runtime.Version
VERSION_JDK8301190_FIXED
The minimal version of Java that has the bugfix for JDK-8301190.
-
Constructor Summary
Constructors Constructor Description VectorizationProvider()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private static void
ensureCaller()
static VectorizationProvider
getInstance()
Returns the default instance of the provider matching vectorization possibilities of actual runtime.abstract VectorUtilSupport
getVectorUtilSupport()
Returns a singleton (stateless)VectorUtilSupport
to support SIMD usage inVectorUtil
.private static boolean
isAffectedByJDK8301190()
Check if runtime is affected by JDK-8301190 (avoids assertion when default language is say "tr").(package private) static VectorizationProvider
lookup(boolean testMode)
private static java.util.Optional<java.lang.Module>
lookupVectorModule()
Looks up the vector module from Lucene'sModuleLayer
or the root layer (if unnamed).
-
-
-
Field Detail
-
TESTS_VECTOR_SIZE
static final java.util.OptionalInt TESTS_VECTOR_SIZE
-
TESTS_FORCE_INTEGER_VECTORS
static final boolean TESTS_FORCE_INTEGER_VECTORS
-
LOG
private static final java.util.logging.Logger LOG
-
VERSION_JDK8301190_FIXED
private static final java.lang.Runtime.Version VERSION_JDK8301190_FIXED
The minimal version of Java that has the bugfix for JDK-8301190.
-
VALID_CALLERS
private static final java.util.Set<java.lang.String> VALID_CALLERS
-
-
Method Detail
-
getInstance
public static VectorizationProvider getInstance()
Returns the default instance of the provider matching vectorization possibilities of actual runtime.- Throws:
java.lang.UnsupportedOperationException
- if the singleton getter is not called from known Lucene classes.
-
getVectorUtilSupport
public abstract VectorUtilSupport getVectorUtilSupport()
Returns a singleton (stateless)VectorUtilSupport
to support SIMD usage inVectorUtil
.
-
lookup
static VectorizationProvider lookup(boolean testMode)
-
lookupVectorModule
private static java.util.Optional<java.lang.Module> lookupVectorModule()
Looks up the vector module from Lucene'sModuleLayer
or the root layer (if unnamed).
-
isAffectedByJDK8301190
private static boolean isAffectedByJDK8301190()
Check if runtime is affected by JDK-8301190 (avoids assertion when default language is say "tr").
-
ensureCaller
private static void ensureCaller()
-
-