Jackie-Jiang commented on code in PR #13170:
URL: https://github.com/apache/pinot/pull/13170#discussion_r1604084141
##########
pinot-common/src/main/java/org/apache/pinot/common/upsert/hash/UpsertHashFunctionFactory.java:
##########
@@ -0,0 +1,69 @@
+package org.apache.pinot.common.upsert.hash;
+
+import java.lang.reflect.Constructor;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import org.apache.pinot.spi.utils.PinotReflectionUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class UpsertHashFunctionFactory {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(UpsertHashFunctionFactory.class);
+ private static final Map<String, Class<UpsertHashFunction>>
HASH_FUNCTION_MAP = new HashMap<>();
+ private static final Object INIT_LOCK = new Object();
+ private volatile static boolean _isLoaded = false;
+
+ private UpsertHashFunctionFactory() {
+ }
+
+ public static UpsertHashFunction create(String functionName) {
+ if (!_isLoaded) {
Review Comment:
Ideally we want to load all functions upfront to guarantee performance at
ingestion time. It can also simply the locks. See `FunctionRegistry` for
example. We may init it in `ServerInstance`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]