uschindler commented on code in PR #12410:
URL: https://github.com/apache/lucene/pull/12410#discussion_r1250445083


##########
lucene/core/src/java/org/apache/lucene/internal/vectorization/VectorizationProvider.java:
##########
@@ -15,79 +15,97 @@
  * limitations under the License.
  */
 
-package org.apache.lucene.util;
+package org.apache.lucene.internal.vectorization;
 
 import java.lang.Runtime.Version;
+import java.lang.StackWalker.StackFrame;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Locale;
 import java.util.Objects;
 import java.util.logging.Logger;
+import java.util.stream.Stream;
+import org.apache.lucene.util.SuppressForbidden;
+import org.apache.lucene.util.VectorUtil;
+
+/**
+ * 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.
+ *
+ * @lucene.internal
+ */
+public abstract class VectorizationProvider {

Review Comment:
   I thought about the same. I was not too happy about it because it moves a 
lot if/else code back to the original package. Because you need to implement 
the scalar code anyways as interface. It also makes testing hard because I am 
at moment working for a BaseVectorizationTest case that allows to write compare 
impls like `TestVectorUtilSupport`. This only works in a generic way if the 
code is easy to locate and uses same interfaces.
   
   I think keeping the code that should do the same together is preferable (at 
least to me). From what I figured out: Most of the code affected is in 
`oal.util` anyways. The special case with ForUtil is different. At moment I am 
not fully sure if the code really differs in Lucene 5, Lucene 8 and Lucene 9 
codecs and ForUtil can move to utils package?
   
   About the name: I leave the name for now.



-- 
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

Reply via email to