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 2013/08/28 14:30:07 UTC
git commit: TAJO-136: Broadcast join should be enabled. (hyunsik)
Updated Branches:
refs/heads/master c027cd271 -> a09ac15ca
TAJO-136: Broadcast join should be enabled. (hyunsik)
Project: http://git-wip-us.apache.org/repos/asf/incubator-tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tajo/commit/a09ac15c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tajo/tree/a09ac15c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tajo/diff/a09ac15c
Branch: refs/heads/master
Commit: a09ac15ca326928ed4aa36af25fc85a603fdd05c
Parents: c027cd2
Author: Hyunsik Choi <hy...@apache.org>
Authored: Wed Aug 28 21:29:22 2013 +0900
Committer: Hyunsik Choi <hy...@apache.org>
Committed: Wed Aug 28 21:29:49 2013 +0900
----------------------------------------------------------------------
CHANGES.txt | 2 ++
.../org/apache/tajo/master/GlobalPlanner.java | 21 ++++++++++----------
.../tajo/master/querymaster/Repartitioner.java | 5 ++---
tajo-dist/src/main/bin/start-tajo.sh | 2 +-
tajo-dist/src/main/bin/tajo-daemons.sh | 0
tajo-dist/src/main/conf/tajo-env.sh | 1 +
6 files changed, 17 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/a09ac15c/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index c6b3f84..03dfaf3 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -15,6 +15,8 @@ Release 0.2.0 - unreleased
IMPROVEMENTS
+ TAJO-136: Broadcast join should be enabled. (hyunsik)
+
TAJO-127: Implement Tajo Resource Manager. (hyoungjunkim via hyunsik)
TAJO-84: Task scheduling with considering disk load balance. (jinho)
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/a09ac15c/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/GlobalPlanner.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/GlobalPlanner.java b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/GlobalPlanner.java
index 14c8bfd..d58d4db 100644
--- a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/GlobalPlanner.java
+++ b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/GlobalPlanner.java
@@ -41,9 +41,12 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import static org.apache.tajo.conf.TajoConf.ConfVars;
+
public class GlobalPlanner {
private static Log LOG = LogFactory.getLog(GlobalPlanner.class);
+ private TajoConf conf;
private StorageManager sm;
private QueryId queryId;
@@ -51,6 +54,7 @@ public class GlobalPlanner {
final StorageManager sm,
final EventHandler eventHandler)
throws IOException {
+ this.conf = conf;
this.sm = sm;
}
@@ -137,17 +141,14 @@ public class GlobalPlanner {
// the first phase of two-phase join can be any logical nodes
JoinNode join = (JoinNode) node;
- /*
- if (join.getOuterNode().getType() == ExprType.SCAN &&
- join.getInnerNode().getType() == ExprType.SCAN) {
- ScanNode outerScan = (ScanNode) join.getOuterNode();
- ScanNode innerScan = (ScanNode) join.getInnerNode();
+ if (join.getRightChild().getType() == NodeType.SCAN &&
+ join.getLeftChild().getType() == NodeType.SCAN) {
+ ScanNode outerScan = (ScanNode) join.getRightChild();
+ ScanNode innerScan = (ScanNode) join.getLeftChild();
- TableMeta outerMeta =
- catalog.getTableDesc(outerScan.getTableId()).getMeta();
- TableMeta innerMeta =
- catalog.getTableDesc(innerScan.getTableId()).getMeta();
+ TableMeta outerMeta = outerScan.getFromTable().getTableDesc().getMeta();
+ TableMeta innerMeta = innerScan.getFromTable().getTableDesc().getMeta();
long threshold = conf.getLongVar(ConfVars.BROADCAST_JOIN_THRESHOLD);
@@ -193,7 +194,7 @@ public class GlobalPlanner {
if (outerScan.isBroadcast() || innerScan.isBroadcast()) {
return;
}
- } */
+ }
// insert stores for the first phase
if (join.getLeftChild().getType() != NodeType.UNION &&
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/a09ac15c/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/Repartitioner.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/Repartitioner.java b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/Repartitioner.java
index a9b0e4b..7dbc37d 100644
--- a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/Repartitioner.java
+++ b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/Repartitioner.java
@@ -72,8 +72,10 @@ public class Repartitioner {
TableDesc tableDesc = subQuery.getContext().getTableDescMap().get(scans[i].getFromTable().getTableName());
if (scans[i].getTableId().startsWith(ExecutionBlockId.EB_ID_PREFIX)) {
tablePath = subQuery.getStorageManager().getTablePath(scans[i].getTableId());
+ stats[i] = subQuery.getChildQuery(scans[i]).getTableStat();
} else {
tablePath = tableDesc.getPath();
+ stats[i] = tableDesc.getMeta().getStat();
}
if (scans[i].isLocal()) { // it only requires a dummy fragment.
@@ -84,9 +86,6 @@ public class Repartitioner {
tableDesc.getMeta(),
new Path(tablePath, "data")).get(0);
}
-
- // Getting a table stat for each scan
- stats[i] = subQuery.getChildQuery(scans[i]).getTableStat();
}
// Assigning either fragments or fetch urls to query units
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/a09ac15c/tajo-dist/src/main/bin/start-tajo.sh
----------------------------------------------------------------------
diff --git a/tajo-dist/src/main/bin/start-tajo.sh b/tajo-dist/src/main/bin/start-tajo.sh
index 3d2ad6a..8952b4a 100755
--- a/tajo-dist/src/main/bin/start-tajo.sh
+++ b/tajo-dist/src/main/bin/start-tajo.sh
@@ -32,5 +32,5 @@ if [ -f "${TAJO_CONF_DIR}/tajo-env.sh" ]; then
fi
if [ "$TAJO_WORKER_STANDBY_MODE" = "true" ]; then
- exec "$bin/tajo-daemons.sh" cd "$TAJO_HOME" \; "$bin/tajo-daemon.sh" start worker
+ exec "$bin/tajo-daemons.sh" cd "$TAJO_HOME" \; "$bin/tajo-daemon.sh" start worker standby
fi
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/a09ac15c/tajo-dist/src/main/bin/tajo-daemons.sh
----------------------------------------------------------------------
diff --git a/tajo-dist/src/main/bin/tajo-daemons.sh b/tajo-dist/src/main/bin/tajo-daemons.sh
old mode 100644
new mode 100755
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/a09ac15c/tajo-dist/src/main/conf/tajo-env.sh
----------------------------------------------------------------------
diff --git a/tajo-dist/src/main/conf/tajo-env.sh b/tajo-dist/src/main/conf/tajo-env.sh
index bca6d2b..2abc448 100755
--- a/tajo-dist/src/main/conf/tajo-env.sh
+++ b/tajo-dist/src/main/conf/tajo-env.sh
@@ -52,5 +52,6 @@ export TAJO_OPTS=-XX:+PrintGCTimeStamps
# The scheduling priority for daemon processes. See 'man nice'.
# export TAJO_NICENESS=10
+# Tajo Distributed Execution Mode
export TAJO_WORKER_STANDBY_MODE=true