tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hyun...@apache.org
Subject git commit: TAJO-325: QueryState.NEW and QueryState.INIT should be combined into one state. (Min Zhou via hyunsik)
Date Mon, 25 Nov 2013 07:06:01 GMT
Updated Branches:
  refs/heads/master 83d402904 -> 6565d2bf1


TAJO-325: QueryState.NEW and QueryState.INIT should be combined into one state. (Min Zhou
via 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/6565d2bf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tajo/tree/6565d2bf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tajo/diff/6565d2bf

Branch: refs/heads/master
Commit: 6565d2bf1e0f9170a318e06553b4c5c70ee0b642
Parents: 83d4029
Author: Hyunsik Choi <hyunsik@apache.org>
Authored: Mon Nov 25 16:04:09 2013 +0900
Committer: Hyunsik Choi <hyunsik@apache.org>
Committed: Mon Nov 25 16:04:09 2013 +0900

----------------------------------------------------------------------
 CHANGES.txt                                       |  3 +++
 .../java/org/apache/tajo/client/TajoClient.java   |  1 -
 .../apache/tajo/master/event/QueryEventType.java  |  1 -
 .../org/apache/tajo/master/querymaster/Query.java | 18 ++----------------
 .../tajo/master/querymaster/QueryMasterTask.java  |  2 --
 5 files changed, 5 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/6565d2bf/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index ec2e704..ea7cf8d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -17,6 +17,9 @@ Release 0.8.0 - unreleased
 
   IMPROVEMENTS
 
+    TAJO-325: QueryState.NEW and QueryState.INIT should be combined into one
+    state. (Min Zhou via hyunsik)
+
     TAJO-313: Support deprecated variables in CatalogConstants. (jaehwa)
 
     TAJO-310: Make the DataLocation class as a separate class and move it to 

http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/6565d2bf/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/client/TajoClient.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/client/TajoClient.java
b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/client/TajoClient.java
index 91a8196..29e3199 100644
--- a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/client/TajoClient.java
+++ b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/client/TajoClient.java
@@ -216,7 +216,6 @@ public class TajoClient {
 
   private static boolean isQueryRunnning(QueryState state) {
     return state == QueryState.QUERY_NEW ||
-        state == QueryState.QUERY_INIT ||
         state == QueryState.QUERY_RUNNING ||
         state == QueryState.QUERY_MASTER_LAUNCHED ||
         state == QueryState.QUERY_MASTER_INIT ||

http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/6565d2bf/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/event/QueryEventType.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/event/QueryEventType.java
b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/event/QueryEventType.java
index e286d70..c767df1 100644
--- a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/event/QueryEventType.java
+++ b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/event/QueryEventType.java
@@ -19,7 +19,6 @@
 package org.apache.tajo.master.event;
 
 public enum QueryEventType {
-  INIT,
   START,
   INIT_COMPLETED,
   INTERNAL_ERROR,

http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/6565d2bf/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/Query.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/Query.java
b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/Query.java
index 34b2892..49e670b 100644
--- a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/Query.java
+++ b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/Query.java
@@ -88,11 +88,7 @@ public class Query implements EventHandler<QueryEvent> {
       new StateMachineFactory<Query, QueryState, QueryEventType, QueryEvent>
           (QueryState.QUERY_NEW)
 
-      .addTransition(QueryState.QUERY_NEW,
-          EnumSet.of(QueryState.QUERY_INIT, QueryState.QUERY_FAILED),
-          QueryEventType.INIT, new InitTransition())
-
-      .addTransition(QueryState.QUERY_INIT, QueryState.QUERY_RUNNING,
+      .addTransition(QueryState.QUERY_NEW, QueryState.QUERY_RUNNING,
           QueryEventType.START, new StartTransition())
 
       .addTransition(QueryState.QUERY_RUNNING, QueryState.QUERY_RUNNING,
@@ -259,22 +255,12 @@ public class Query implements EventHandler<QueryEvent> {
     return cursor;
   }
 
-  static class InitTransition
-      implements MultipleArcTransition<Query, QueryEvent, QueryState> {
-
-    @Override
-    public QueryState transition(Query query, QueryEvent queryEvent) {
-      query.setStartTime();
-      //query.context.setState(QueryState.QUERY_INIT);
-      return QueryState.QUERY_INIT;
-    }
-  }
-
   public static class StartTransition
       implements SingleArcTransition<Query, QueryEvent> {
 
     @Override
     public void transition(Query query, QueryEvent queryEvent) {
+      query.setStartTime();
       SubQuery subQuery = new SubQuery(query.context, query.getPlan(),
           query.getExecutionBlockCursor().nextBlock(), query.sm);
       subQuery.setPriority(query.priority--);

http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/6565d2bf/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/QueryMasterTask.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/QueryMasterTask.java
b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/QueryMasterTask.java
index 3fb4ac0..5b23fb2 100644
--- a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/QueryMasterTask.java
+++ b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/QueryMasterTask.java
@@ -300,8 +300,6 @@ public class QueryMasterTask extends CompositeService {
       dispatcher.register(QueryEventType.class, query);
 
       queryTaskContext.getEventHandler().handle(new QueryEvent(queryId,
-          QueryEventType.INIT));
-      queryTaskContext.getEventHandler().handle(new QueryEvent(queryId,
           QueryEventType.START));
     } catch (Exception e) {
       LOG.error(e.getMessage(), e);


Mime
View raw message