Uploaded image for project: 'Tajo (Retired)'
  1. Tajo (Retired)
  2. TAJO-325

QueryState.NEW and QueryState.INIT should be combined into one state

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.8.0
    • 0.8.0
    • QueryMaster
    • None

    Description

      From the diagram uploaded at TAJO-320, we know that in the beginning of a Query. It first in New state, and instantly become INIT state because QueryMasterTask generate INIT and START event in succession.

            queryTaskContext.getEventHandler().handle(new QueryEvent(queryId,
                QueryEventType.INIT));
            queryTaskContext.getEventHandler().handle(new QueryEvent(queryId,
                QueryEventType.START));
      

      There is no gap between those two event, and the init transition in Query show that that transition will do nothing except log the start time. It couldn't transit to FAILED state since there's no condition to FAILED.

        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;
          }
        }
      

      For simplicity, I suggest combine those two state into one. When I was writing code on TAJO-305, I came across the problem I need to deal with those two state and found that I need to write some useless transitions for one of the two states.

      Attachments

        1. TAJO-325.diff
          4 kB
          Min Zhou

        Activity

          People

            coderplay Min Zhou
            coderplay Min Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: