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:03:15 GMT
Repository: tajo
Updated Branches:
  refs/heads/master 845e7c35a -> 099c2cd83


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

Closes #943


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

Branch: refs/heads/master
Commit: 099c2cd837c71bf0d80a13ddc6e5bff8e5c8e3ae
Parents: 845e7c3
Author: Jinho Kim <jhkim@apache.org>
Authored: Mon Jan 18 11:02:25 2016 +0900
Committer: Jinho Kim <jhkim@apache.org>
Committed: Mon Jan 18 11:02:25 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, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/099c2cd8/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 39b78d2..51bfa62 100644
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,8 @@ Release 0.12.0 - 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/099c2cd8/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 a8a3ff3..4d742c7 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
@@ -35,9 +35,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");
 
@@ -66,6 +66,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/099c2cd8/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/099c2cd8/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 80805d8..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,16 +18,21 @@
 
 package org.apache.tajo.plan.rewrite;
 
-import java.util.ArrayList;
+import com.google.common.collect.Lists;
+
 import java.util.Collection;
 import java.util.List;
 
 public class BaseLogicalPlanPreprocessPhaseProvider extends LogicalPlanPreprocessPhaseProvider
{
-  @Override
-  public Collection<Class<? extends LogicalPlanPreprocessPhase>> getPhases()
{
-    List phases = new ArrayList<>();
+  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()
{
     return phases;
   }
 }

http://git-wip-us.apache.org/repos/asf/tajo/blob/099c2cd8/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 21a0905..fda15ee 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);
 
   private final StorageService storage;
 


Mime
View raw message