当前位置: 首页>>代码示例>>Java>>正文


Java Session.FAILED属性代码示例

本文整理汇总了Java中org.ggf.drmaa.Session.FAILED属性的典型用法代码示例。如果您正苦于以下问题:Java Session.FAILED属性的具体用法?Java Session.FAILED怎么用?Java Session.FAILED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.ggf.drmaa.Session的用法示例。


在下文中一共展示了Session.FAILED属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: statustoString

public String statustoString(int jobstatus) {
    switch (jobstatus) {
        case Session.QUEUED_ACTIVE:
            return "Job is pending";
        case Session.SYSTEM_ON_HOLD:
            return "Job is on hold by system.";
        case Session.USER_ON_HOLD:
            return "Job is on hold by user.";
        case Session.USER_SYSTEM_ON_HOLD:
            return "Job is on hold by system or user.";
        case Session.RUNNING:
            return "Job is running";
        case Session.SYSTEM_SUSPENDED:
            return "Job is suspended by system.";
        case Session.USER_SUSPENDED:
            return "Job is suspended by user.";
        case Session.USER_SYSTEM_SUSPENDED:
            return "Job is suspended by system or user.";
        case Session.DONE:
            return "Job has completed";
        case Session.FAILED:
            return "Job has failed.";
    }
    return "Job status is unknown";
}
 
开发者ID:BiBiServ,项目名称:jobproxy,代码行数:25,代码来源:DRMAA.java

示例2: getCompletedInstances

@Override
public int getCompletedInstances() {
  int comp = 0;
  try {
    for (String job : jobs) {
      int status = session.getJobProgramStatus(job);

      //if( status == session.FAILED )
      //System.err.println( "[" + job + "] failed." );

      if (status == Session.DONE || status == Session.FAILED) {
        comp += 1;
      }
    }
  } catch (DrmaaException e) {
    return 0;
  }

  return comp;
}
 
开发者ID:teanalab,项目名称:demidovii,代码行数:20,代码来源:DRMAAStageExecutor.java

示例3: getRunningInstances

@Override
public int getRunningInstances() {
  int comp = 0;
  try {
    for (String job : jobs) {
      int status = session.getJobProgramStatus(job);

      comp += 1;

      //if( status == session.FAILED )
      //System.err.println( "[" + job + "] failed." );

      if (status == Session.QUEUED_ACTIVE || status == Session.DONE || status == Session.FAILED) {
        comp -= 1;
      }
    }
  } catch (DrmaaException e) {
    return 0;
  }

  return comp;
}
 
开发者ID:teanalab,项目名称:demidovii,代码行数:22,代码来源:DRMAAStageExecutor.java

示例4: getRunTimes

@Override
public synchronized List<Double> getRunTimes() {
  ArrayList<Double> times = new ArrayList<>();
  long current;
  if (startTimes != null) {
    for (String jobid : startTimes.keySet()) {
      try {
        int status = session.getJobProgramStatus(jobid);
        long start = startTimes.get(jobid);
        if (status == Session.DONE || status == Session.FAILED) {
          if (!stopTimes.containsKey(jobid)) {
            stopTimes.put(jobid, System.currentTimeMillis());
          }
          current = stopTimes.get(jobid);
        } else {
          current = System.currentTimeMillis();
        }
        double diff = (current - start + 0.0) / 1000.0;
        times.add(diff);
      } catch (DrmaaException e) {
        logger.log(Level.WARNING, e.getMessage(), e);
      }
    }
  }
  return times;
}
 
开发者ID:teanalab,项目名称:demidovii,代码行数:26,代码来源:DRMAAStageExecutor.java

示例5: checkJob

private void checkJob(FailAction fail, JobSpecification js) throws DrmaaException {
	String id = js.getJobId();
	int status = session.getJobProgramStatus(id);
	if (status == Session.DONE) {
		JobInfo info = session.wait(id, Session.TIMEOUT_NO_WAIT);
		if (info.wasAborted()) {
			logger.warning(js.getJobMessage("was aborted"));
			fail(fail, js);
			return;
		}
		if (info.hasSignaled()) {
			logger.warning(js.getJobMessage("signalled " + info.getTerminatingSignal()));
			fail(fail, js);
			return;
		}
		if (info.getExitStatus() != 0) {
			logger.warning(js.getJobMessage("exited with status " + info.getExitStatus()));
			fail(fail, js);
			return;
		}
		logger.info(js.getJobMessage("is done"));
		currentJobs.remove(id);
		return;
	}
	if (status == Session.FAILED) {
		logger.warning(js.getJobMessage("failed somehow"));
		fail(fail, js);
	}
}
 
开发者ID:Bibliome,项目名称:bibliome-java-utils,代码行数:29,代码来源:JobPool.java

示例6: getExceptions

@Override
public ArrayList<Exception> getExceptions() {

  for (String job : jobs) {
    try {
      int status = session.getJobProgramStatus(job);

      if (status == Session.FAILED) {
        exceptions.add(new Exception("[" + job + "] failed -- see stderr folder."));
        System.err.println("[" + job + "] failed -- see stderr folder.");

      } else if (status == Session.DONE) {

        // check for X.complete
        File checkpoint = jobCheckpoints.get(job);
        boolean exists = false;
        int count = 0;
        do {
          if (checkpoint.exists()) {
            exists = true;
            break;
          }
          try {
            Thread.sleep(1000); // wait 1 second
          } catch (InterruptedException ignored) {
            // Don't care about interruption errors
          }
        } while (count++ < 60); // 1 min timeout

        // if the job finished over a minute ago, and the checkpoint still doesn't exist - it probably errored.
        if (!exists) {
          // add an exception.
          exceptions.add(new Exception("[" + job + "] failed -- checkpoint does not exist."));
          System.err.println("[" + job + "] failed -- checkpoint does not exist.");
        }
        
        
      }
    } catch (DrmaaException e) {
      System.err.println("Could not error check the drmaa session!");
    }
  }

  return exceptions;
}
 
开发者ID:teanalab,项目名称:demidovii,代码行数:45,代码来源:DRMAAStageExecutor.java

示例7: getJobProgramStatus

@Override
public int getJobProgramStatus(String jobId) throws DrmaaException {
    Job job = parseJobs(jobId).get(0);

    /**
     * PBS Professional S The job's state:
     *
     * B Array job has at least one subjob running.
     *
     * E Job is exiting after having run.
     *
     * F Job is finished.
     *
     * H Job is held.
     *
     * M Job was moved to another server.
     *
     * Q Job is queued.
     *
     * R Job is running.
     *
     * S Job is suspended.
     *
     * T Job is being moved to new location.
     *
     * U Cycle-harvesting job is suspended due to keyboard activity.
     *
     * W Job is waiting for its submitter-assigned start time to be reached.
     *
     * X Subjob has completed execution or has been deleted.
     *
     */
    String state = job.getState();
    LOGGER.finest("state : " + state);
    switch (state) {
    case "B":
        return Session.RUNNING;
    case "E":
        return Session.RUNNING;
    case "F":
        return job.getExitStatus() == 0 ? Session.DONE : Session.FAILED;
    case "H":
        return Session.SUSPEND;
    case "M":
        return Session.RUNNING;
    case "Q":
        return Session.QUEUED_ACTIVE;
    case "R":
        return Session.RUNNING;
    case "S":
        return Session.SUSPEND;
    case "T":
        return Session.RUNNING;
    case "U":
        return Session.SUSPEND;
    case "W":
        return Session.QUEUED_ACTIVE;
    case "X":
        return job.getExitStatus() == 0 ? Session.DONE : Session.FAILED;
    }
    return Session.UNDETERMINED;
}
 
开发者ID:biouno,项目名称:drmaa-pbs,代码行数:62,代码来源:SessionImpl.java

示例8: failed

@Override
public boolean failed() throws IOException, DrmaaException {
	int status = session.getJobProgramStatus(jobID);
	return status == Session.FAILED;
}
 
开发者ID:mgarber,项目名称:scriptureV2,代码行数:5,代码来源:OGSJob.java


注:本文中的org.ggf.drmaa.Session.FAILED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。