Github user arina-ielchiieva commented on a diff in the pull request:
https://github.com/apache/drill/pull/843#discussion_r118188385
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionInitializer.java
---
@@ -31,29 +31,25 @@
import org.codehaus.janino.Scanner;
import org.mortbay.util.IO;
-import com.google.common.collect.Maps;
-
/**
* To avoid the cost of initializing all functions up front,
- * this class contains all informations required to initializing a
function when it is used.
+ * this class contains all information required to initializing a function
when it is used.
*/
public class FunctionInitializer {
- static final org.slf4j.Logger logger =
org.slf4j.LoggerFactory.getLogger(FunctionInitializer.class);
+ private static final org.slf4j.Logger logger =
org.slf4j.LoggerFactory.getLogger(FunctionInitializer.class);
private final String className;
private final ClassLoader classLoader;
- private Map<String, CompilationUnit> functionUnits = Maps.newHashMap();
--- End diff --
It was used in `convertToCompilationUnit`. Before loading function body we
checked if it was loaded before in `functionUnits` map. If not - function body
was loaded, if yes - previously loaded compilation unit was returned. With
incorrectly implemented DCL such check prevented us from loading function body
from disk each time, through threads were entering synchronized block anyway.
With correctly implemented DCL we don't need to store this intermediate result.
First thread will load all information about methods and imports, others will
use this information.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---