odps-console-xflow/src/main/java/com/aliyun/openservices/odps/console/xflow/CopyOfflineModelCommand.java [82:104]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private void waitForTerminated(Instance instance, long intervalMs) throws OdpsException {
    try {
      SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
      while (!instance.isTerminated()) {
          Thread.sleep(intervalMs);
          getWriter().writeError(sim.format(new Date()) + "\tCopying");
      }

      if (instance.isSuccessful()) {
        getWriter().writeError("OK");
      } else {
        for (Map.Entry<String, Instance.TaskStatus> e : instance.getTaskStatus().entrySet()) {
          if (e.getValue().getStatus() == Instance.TaskStatus.Status.FAILED) {
            throw new OdpsException(instance.getTaskResults().get(e.getKey()));
          } else if (e.getValue().getStatus() != Instance.TaskStatus.Status.SUCCESS) {
            throw new OdpsException(e.getKey() + ", Status=" + e.getValue().getStatus());
          }
        }
      }
    } catch (InterruptedException e) {
      throw new UserInterruptException(e.getMessage());
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



odps-console-xflow/src/main/java/com/aliyun/openservices/odps/console/xflow/CreateOfflineModelCommand.java [102:124]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private void waitForTerminated(Instance instance, long intervalMs) throws OdpsException {
    try {
      SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
      while (!instance.isTerminated()) {
          Thread.sleep(intervalMs);
          getWriter().writeError(sim.format(new Date()) + "\tCreating");
      }

      if (instance.isSuccessful()) {
        getWriter().writeError("OK");
      } else {
        for (Map.Entry<String, Instance.TaskStatus> e : instance.getTaskStatus().entrySet()) {
          if (e.getValue().getStatus() == Instance.TaskStatus.Status.FAILED) {
            throw new OdpsException(instance.getTaskResults().get(e.getKey()));
          } else if (e.getValue().getStatus() != Instance.TaskStatus.Status.SUCCESS) {
            throw new OdpsException(e.getKey() + ", Status=" + e.getValue().getStatus());
          }
        }
      }
    } catch (InterruptedException e) {
      throw new UserInterruptException(e.getMessage());
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



