String vertexStatus(VertexStatus vertexStatus) {
      // To get vertex status we can use DAGClient.getVertexStatus(), but it will be expensive to
      // get status from AM for every refresh of the UI. Lets infer the state from task counts.
      // Only if DAG is FAILED or KILLED the vertex status is fetched from AM.
      VertexStatus.State vertexState = VertexStatus.State.INITIALIZING;
      if (totalTaskCount > 0) {
        vertexState = VertexStatus.State.INITED;
      }

      // RUNNING state
      if (isRunning()) {
        vertexState = VertexStatus.State.RUNNING;
      }

      // SUCCEEDED state
      if (succeededTaskCount == totalTaskCount) {
        vertexState = VertexStatus.State.SUCCEEDED;
      }

      // DAG might have been killed, lets try to get vertex state from AM before dying
      // KILLED or FAILED state
      if (dagState == KILLED) {
        if (vertexStatus != null) {
          vertexState = vertexStatus.getState();
        }
      }
      return vertexState.toString();
    }
Try to get most the data required from dagClient in the constructor itself so that even after
the tez job has finished this object can be used for later use.s
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/monitoring/TezProgressMonitor.java