Class 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.
    • 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
    • Constructor Detail

      • VectorizationProvider

        VectorizationProvider()
    • 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.
      • getLucene99FlatVectorsScorer

        public abstract FlatVectorsScorer getLucene99FlatVectorsScorer()
        Returns a FlatVectorsScorer that supports the Lucene99 format.
      • lookupVectorModule

        private static java.util.Optional<java.lang.Module> lookupVectorModule()
        Looks up the vector module from Lucene's ModuleLayer 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()