reallocf commented on a change in pull request #5326:
URL: https://github.com/apache/incubator-pinot/pull/5326#discussion_r419031828



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/data/function/FunctionRegistryFactory.java
##########
@@ -0,0 +1,37 @@
+package org.apache.pinot.core.data.function;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.List;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Factory class to create a {@link FunctionRegistry}
+ */
+public class FunctionRegistryFactory {
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(FunctionRegistryFactory.class);
+
+  private FunctionRegistryFactory() {
+
+  }
+
+  static List<Method> functionsToRegister;
+
+  static {
+    try {
+      functionsToRegister = 
Arrays.asList(DateTimeFunctions.class.getDeclaredMethod("toEpochHours", 
Long.class),
+          DateTimeFunctions.class.getDeclaredMethod("toEpochMinutes", 
Long.class, String.class));
+    } catch (NoSuchMethodException e) {
+      LOGGER.error("Caught exception when registering function", e);
+    }
+  }

Review comment:
       Blech. Any cleaner way to do this? Oh Java... haha




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to