tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jh...@apache.org
Subject tajo git commit: TAJO-2057: Remove redundant class loading in plan optimizer.
Date Mon, 18 Jan 2016 02:07:28 GMT
Repository: tajo
Updated Branches:
  refs/heads/branch-0.11.1 fcf1ae1a1 -> b1e014942


TAJO-2057: Remove redundant class loading in plan optimizer.


Project: http://git-wip-us.apache.org/repos/asf/tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/b1e01494
Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/b1e01494
Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/b1e01494

Branch: refs/heads/branch-0.11.1
Commit: b1e0149421b6a520e3f636d922a69688e99979c9
Parents: fcf1ae1
Author: Jinho Kim <jhkim@apache.org>
Authored: Mon Jan 18 11:07:04 2016 +0900
Committer: Jinho Kim <jhkim@apache.org>
Committed: Mon Jan 18 11:07:04 2016 +0900

----------------------------------------------------------------------
 CHANGES                                                |  2 ++
 .../tajo/plan/exprrewrite/EvalTreeOptimizer.java       |  7 +++++--
 .../plan/rewrite/BaseLogicalPlanPreprocessEngine.java  |  2 +-
 .../BaseLogicalPlanPreprocessPhaseProvider.java        | 13 ++++++++-----
 .../plan/rewrite/BaseLogicalPlanRewriteEngine.java     |  2 +-
 5 files changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/b1e01494/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index fee113d..7ecc713 100644
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,8 @@ Release 0.11.1 - unreleased
 
   IMPROVEMENT
 
+    TAJO-2057: Remove redundant class loading in plan optimizer. (jinho)
+
     TAJO-2032: Change tajo.rest.service.port to be the general style in TAJO.
     (Byunghwa Yun via jihoon)
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/b1e01494/tajo-plan/src/main/java/org/apache/tajo/plan/exprrewrite/EvalTreeOptimizer.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/exprrewrite/EvalTreeOptimizer.java
b/tajo-plan/src/main/java/org/apache/tajo/plan/exprrewrite/EvalTreeOptimizer.java
index 680600a..7a8deb2 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/exprrewrite/EvalTreeOptimizer.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/exprrewrite/EvalTreeOptimizer.java
@@ -36,9 +36,9 @@ import java.util.Set;
 public class EvalTreeOptimizer {
   private static final Log LOG = LogFactory.getLog(EvalTreeOptimizer.class);
 
-  private List<EvalTreeOptimizationRule> rules = Lists.newArrayList();
+  private static List<EvalTreeOptimizationRule> rules = Lists.newArrayList();
 
-  public EvalTreeOptimizer() {
+  static {
     Set<Class> functionClasses = ClassUtil.findClasses(EvalTreeOptimizationRule.class,
         EvalTreeOptimizationRule.class.getPackage().getName() + ".rules");
 
@@ -67,6 +67,9 @@ public class EvalTreeOptimizer {
     });
   }
 
+  public EvalTreeOptimizer() {
+  }
+
   public EvalNode optimize(LogicalPlanner.PlanContext context, EvalNode node) {
     Preconditions.checkNotNull(node);
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/b1e01494/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/BaseLogicalPlanPreprocessEngine.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/BaseLogicalPlanPreprocessEngine.java
b/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/BaseLogicalPlanPreprocessEngine.java
index f02faef..93ba8ea 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/BaseLogicalPlanPreprocessEngine.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/BaseLogicalPlanPreprocessEngine.java
@@ -42,7 +42,7 @@ public class BaseLogicalPlanPreprocessEngine implements LogicalPlanPreprocessEng
   }
 
   /** class logger */
-  private Log LOG = LogFactory.getLog(BaseLogicalPlanPreprocessEngine.class);
+  private static Log LOG = LogFactory.getLog(BaseLogicalPlanPreprocessEngine.class);
 
   /** a map for pre-process phases */
   private Map<String, LogicalPlanPreprocessPhase> preprocessPhases = new LinkedHashMap<>();

http://git-wip-us.apache.org/repos/asf/tajo/blob/b1e01494/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/BaseLogicalPlanPreprocessPhaseProvider.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/BaseLogicalPlanPreprocessPhaseProvider.java
b/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/BaseLogicalPlanPreprocessPhaseProvider.java
index 3f64ae6..2259b34 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/BaseLogicalPlanPreprocessPhaseProvider.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/BaseLogicalPlanPreprocessPhaseProvider.java
@@ -18,18 +18,21 @@
 
 package org.apache.tajo.plan.rewrite;
 
-import org.apache.tajo.util.TUtil;
+import com.google.common.collect.Lists;
 
 import java.util.Collection;
 import java.util.List;
 
 public class BaseLogicalPlanPreprocessPhaseProvider extends LogicalPlanPreprocessPhaseProvider
{
+  private static List<Class<? extends LogicalPlanPreprocessPhase>> phases = Lists.newArrayList();
+
+  static {
+    phases.add(BaseSchemaBuildPhase.class);
+    phases.add(SelfDescSchemaBuildPhase.class);
+  }
+
   @Override
   public Collection<Class<? extends LogicalPlanPreprocessPhase>> getPhases()
{
-    List phases = TUtil.newList(
-        BaseSchemaBuildPhase.class,
-        SelfDescSchemaBuildPhase.class
-    );
     return phases;
   }
 }

http://git-wip-us.apache.org/repos/asf/tajo/blob/b1e01494/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/BaseLogicalPlanRewriteEngine.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/BaseLogicalPlanRewriteEngine.java
b/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/BaseLogicalPlanRewriteEngine.java
index 35ec85c..3e30e3f 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/BaseLogicalPlanRewriteEngine.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/BaseLogicalPlanRewriteEngine.java
@@ -34,7 +34,7 @@ import java.util.Map.Entry;
  */
 public class BaseLogicalPlanRewriteEngine implements LogicalPlanRewriteEngine {
   /** class logger */
-  private Log LOG = LogFactory.getLog(BaseLogicalPlanRewriteEngine.class);
+  private static Log LOG = LogFactory.getLog(BaseLogicalPlanRewriteEngine.class);
 
   /** a map for query rewrite rules  */
   private Map<String, LogicalPlanRewriteRule> rewriteRules = new LinkedHashMap<>();


Mime
View raw message