Exemplo n.º 1
0
 public String toString() {
   String r =
       this.getRowkey()
           + " "
           + preparedTaskContainer.toString()
           + " "
           + preparedTask.toString()
           + " "
           + methodName;
   return r;
 }
Exemplo n.º 2
0
  /**
   * builds an ScheduleItem object from a Result object obtained from a Scan or Get in the
   * underlying storage
   *
   * @param result
   * @return
   */
  public static ScheduleItem fromResultObject(Schedule schedule, Result result) {
    ScheduleItem r = ScheduleItem.fromRowKey(schedule, result.getRowKey());

    byte[] stat = result.getValue("bigs", "status");
    if (stat != null) {
      r.setStatusFromString(new String(stat));
    }

    byte[] etime = result.getValue("bigs", "elapsedtime");
    if (etime != null) {
      r.setElapsedTime(new Long(new String(etime)));
    }

    byte[] lastupdate = result.getValue("bigs", "lastupdate");
    if (lastupdate != null) {
      r.setLastUpdateFromString(new String(lastupdate));
    }

    byte[] suuid = result.getValue("bigs", "uuid");
    if (suuid != null) {
      r.setUuidStored(new String(suuid));
    }

    byte[] smethod = result.getValue("scheduling", "method");
    if (smethod != null) {
      r.setMethodName(new String(smethod));
    }

    byte[] shostname = result.getValue("bigs", "hostname");
    if (shostname != null) {
      r.setHostnameStored(new String(shostname));
    }

    String parentsIdsString = new String(result.getValue("scheduling", "parents"));

    if (parentsIdsString != null && !parentsIdsString.trim().isEmpty()) {
      r.parentsRowkeys = Text.parseObjectList(parentsIdsString, " ", String.class);
    }

    r.preparedTask = TaskHelper.fromResultObject(result, "scheduling", "task.class", "task.object");
    r.processState = State.fromResultObject(result, "content", "class", "data");
    r.preparedTaskContainer =
        TaskContainer.fromResultObject(
            result, "scheduling", "task.container.class", "task.container.object");
    if (schedule != null) {
      r.preparedTaskContainer.setPipelineStage(schedule.getPipelineStage());
    }
    r.tags = result.getFamilyMap("tags");

    return r;
  }