You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tajo.apache.org by hy...@apache.org on 2014/09/17 18:11:42 UTC

git commit: TAJO-1048: Missed use of session variables in GlobalPlanner.

Repository: tajo
Updated Branches:
  refs/heads/master 1a8a67ceb -> 745131ee9


TAJO-1048: Missed use of session variables in GlobalPlanner.

Closes #146


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

Branch: refs/heads/master
Commit: 745131ee996b8d468479145de2069c4d34d6ffa0
Parents: 1a8a67c
Author: Hyunsik Choi <hy...@apache.org>
Authored: Thu Sep 18 00:20:46 2014 +0900
Committer: Hyunsik Choi <hy...@apache.org>
Committed: Thu Sep 18 00:56:21 2014 +0900

----------------------------------------------------------------------
 CHANGES                                              |  3 +++
 .../org/apache/tajo/master/querymaster/SubQuery.java | 15 ++++++++-------
 2 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/745131ee/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index d1002b3..d35041b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -141,6 +141,9 @@ Release 0.9.0 - unreleased
 
   BUG FIXES
 
+    TAJO-1048: Missed use of session variables in GlobalPlanner.
+    (hyunsik)
+
     TAJO-1037: KillQuery hang in subquery init state. (jinho)
 
     TAJO-1024: RpcConnectionPool::getConnection can cause NPE at 

http://git-wip-us.apache.org/repos/asf/tajo/blob/745131ee/tajo-core/src/main/java/org/apache/tajo/master/querymaster/SubQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/master/querymaster/SubQuery.java b/tajo-core/src/main/java/org/apache/tajo/master/querymaster/SubQuery.java
index 92ef9f9..1931300 100644
--- a/tajo-core/src/main/java/org/apache/tajo/master/querymaster/SubQuery.java
+++ b/tajo-core/src/main/java/org/apache/tajo/master/querymaster/SubQuery.java
@@ -58,6 +58,7 @@ import org.apache.tajo.master.event.QueryUnitAttemptScheduleEvent.QueryUnitAttem
 import org.apache.tajo.master.querymaster.QueryUnit.IntermediateEntry;
 import org.apache.tajo.storage.AbstractStorageManager;
 import org.apache.tajo.storage.fragment.FileFragment;
+import org.apache.tajo.unit.StorageUnit;
 import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.worker.FetchImpl;
 
@@ -774,7 +775,7 @@ public class SubQuery implements EventHandler<SubQueryEvent> {
         LOG.info(subQuery.getId() + ", Bigger Table's volume is approximately " + mb + " MB");
 
         int taskNum = (int) Math.ceil((double) mb /
-            conf.getIntVar(ConfVars.$DIST_QUERY_JOIN_PARTITION_VOLUME));
+            masterPlan.getContext().getInt(SessionVars.JOIN_PER_SHUFFLE_SIZE));
 
         int totalMem = getClusterTotalMemory(subQuery);
         LOG.info(subQuery.getId() + ", Total memory of cluster is " + totalMem + " MB");
@@ -782,8 +783,8 @@ public class SubQuery implements EventHandler<SubQueryEvent> {
         // determine the number of task
         taskNum = Math.min(taskNum, slots);
 
-        if (conf.getIntVar(ConfVars.$TEST_MIN_TASK_NUM) > 0) {
-          taskNum = conf.getIntVar(ConfVars.$TEST_MIN_TASK_NUM);
+        if (masterPlan.getContext().containsKey(SessionVars.TEST_MIN_TASK_NUM)) {
+          taskNum = masterPlan.getContext().getInt(SessionVars.TEST_MIN_TASK_NUM);
           LOG.warn("!!!!! TESTCASE MODE !!!!!");
         }
 
@@ -823,11 +824,11 @@ public class SubQuery implements EventHandler<SubQueryEvent> {
         } else {
           long volume = getInputVolume(subQuery.masterPlan, subQuery.context, subQuery.block);
 
-          int mb = (int) Math.ceil((double) volume / 1048576);
-          LOG.info(subQuery.getId() + ", Table's volume is approximately " + mb + " MB");
+          int volumeByMB = (int) Math.ceil((double) volume / StorageUnit.MB);
+          LOG.info(subQuery.getId() + ", Table's volume is approximately " + volumeByMB + " MB");
           // determine the number of task
-          int taskNumBySize = (int) Math.ceil((double) mb /
-              conf.getIntVar(ConfVars.$DIST_QUERY_GROUPBY_PARTITION_VOLUME));
+          int taskNumBySize = (int) Math.ceil((double) volumeByMB /
+              masterPlan.getContext().getInt(SessionVars.GROUPBY_PER_SHUFFLE_SIZE));
 
           int totalMem = getClusterTotalMemory(subQuery);