public void executionFinishedWithLocking(boolean wasError) {
    lock();
    try {
      if (!isDestroyed()) {
        driverState = wasError ? State.ERROR : State.EXECUTED;
      }
    } finally {
      unlock();
    }
  }
Enumeration of the potential driver states.
ql/src/java/org/apache/hadoop/hive/ql/DriverState.java