You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by ve...@apache.org on 2015/01/20 07:18:33 UTC
[2/2] drill git commit: DRILL-1699 Make LoadingCache max size
configurable
DRILL-1699 Make LoadingCache max size configurable
Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/2fc9d047
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/2fc9d047
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/2fc9d047
Branch: refs/heads/master
Commit: 2fc9d0471f05da9c40277fa6d372f27c726bdf92
Parents: 49b60ca
Author: Yuliya Feldman <yf...@maprtech.com>
Authored: Thu Jan 15 11:56:54 2015 -0800
Committer: vkorukanti <ve...@gmail.com>
Committed: Mon Jan 19 22:09:06 2015 -0800
----------------------------------------------------------------------
.../src/main/java/org/apache/drill/exec/ExecConstants.java | 1 +
.../main/java/org/apache/drill/exec/compile/CodeCompiler.java | 4 +++-
exec/java-exec/src/main/resources/drill-module.conf | 3 ++-
3 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/drill/blob/2fc9d047/exec/java-exec/src/main/java/org/apache/drill/exec/ExecConstants.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/ExecConstants.java b/exec/java-exec/src/main/java/org/apache/drill/exec/ExecConstants.java
index 35b86d1..190c13f 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/ExecConstants.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/ExecConstants.java
@@ -186,6 +186,7 @@ public interface ExecConstants {
public static final OptionValidator ENABLE_VERBOSE_ERRORS = new BooleanValidator(ENABLE_VERBOSE_ERRORS_KEY, false);
public static final String BOOTSTRAP_STORAGE_PLUGINS_FILE = "bootstrap-storage-plugins.json";
+ public static final String MAX_LOADING_CACHE_SIZE_CONFIG = "drill.exec.compile.cache_max_size";
public static final String DRILL_SYS_FILE_SUFFIX = ".sys.drill";
}
http://git-wip-us.apache.org/repos/asf/drill/blob/2fc9d047/exec/java-exec/src/main/java/org/apache/drill/exec/compile/CodeCompiler.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/compile/CodeCompiler.java b/exec/java-exec/src/main/java/org/apache/drill/exec/compile/CodeCompiler.java
index 5628ea3..7cc350e 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/compile/CodeCompiler.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/compile/CodeCompiler.java
@@ -21,6 +21,7 @@ import java.io.IOException;
import java.util.concurrent.ExecutionException;
import org.apache.drill.common.config.DrillConfig;
+import org.apache.drill.exec.ExecConstants;
import org.apache.drill.exec.exception.ClassTransformationException;
import org.apache.drill.exec.expr.CodeGenerator;
import org.apache.drill.exec.server.options.OptionManager;
@@ -41,9 +42,10 @@ public class CodeCompiler {
public CodeCompiler(DrillConfig config, OptionManager systemOptionManager){
this.transformer = new ClassTransformer();
+ int cacheMaxSize = config.getInt(ExecConstants.MAX_LOADING_CACHE_SIZE_CONFIG);
this.cache = CacheBuilder //
.newBuilder() //
- .maximumSize(1000) //
+ .maximumSize(cacheMaxSize) //
.build(new Loader());
this.systemOptionManager = systemOptionManager;
this.config = config;
http://git-wip-us.apache.org/repos/asf/drill/blob/2fc9d047/exec/java-exec/src/main/resources/drill-module.conf
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/resources/drill-module.conf b/exec/java-exec/src/main/resources/drill-module.conf
index da25761..9e807b0 100644
--- a/exec/java-exec/src/main/resources/drill-module.conf
+++ b/exec/java-exec/src/main/resources/drill-module.conf
@@ -121,7 +121,8 @@ drill.exec: {
compile: {
compiler: "DEFAULT",
debug: true,
- janino_maxsize: 262144
+ janino_maxsize: 262144,
+ cache_max_size: 1000
},
sort: {
purge.threshold : 100,