kkhatua commented on a change in pull request #1483: DRILL-3988: Expose Drill
built-in functions & UDFs in a system table
URL: https://github.com/apache/drill/pull/1483#discussion_r224259705
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolder.java
##########
@@ -161,6 +163,38 @@ public void removeJar(String jarName) {
}
}
+ /**
+ * Retrieves all functions (holders) associated with all the jars
+ * This is read operation, so several users can perform this operation at
the same time.
+ * @return list of all functions, mapped by their sources
+ */
+ public Map<String, List<FunctionHolder>> getAllJarsWithFunctionHolders() {
+ Map<String, List<FunctionHolder>> allFunctionHoldersByJar = new
HashMap<>();
+
+ try (@SuppressWarnings("unused") Closeable lock = readLock.open()) {
+ for (String jarName : jars.keySet()) {
+ //Capture functionHolders here
+ List<FunctionHolder> drillFuncHolderList = new LinkedList<>();
Review comment:
Since the variable is only used to add and remove the function holders, this
seemed most efficient for memory and speed. Some sources (like `built-in`) will
have 2K+ functions, while UDFs will have as little as 1 function.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services