org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob.State Java Examples

The following examples show how to use org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob.State. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JobControl.java    From hadoop with Apache License 2.0 5 votes vote down vote up
synchronized private List<ControlledJob> getJobsIn(State state) {
  LinkedList<ControlledJob> l = new LinkedList<ControlledJob>();
  for(ControlledJob j: jobsInProgress) {
    if(j.getJobState() == state) {
      l.add(j);
    }
  }
  return l;
}
 
Example #2
Source File: JobControl.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/**
 * Add a new controlled job.
 * @param aJob the new controlled job
 */
synchronized public String addJob(ControlledJob aJob) {
  String id = this.getNextJobID();
  aJob.setJobID(id);
  aJob.setJobState(State.WAITING);
  jobsInProgress.add(aJob);
  return id;	
}
 
Example #3
Source File: JobControl.java    From big-c with Apache License 2.0 5 votes vote down vote up
synchronized private List<ControlledJob> getJobsIn(State state) {
  LinkedList<ControlledJob> l = new LinkedList<ControlledJob>();
  for(ControlledJob j: jobsInProgress) {
    if(j.getJobState() == state) {
      l.add(j);
    }
  }
  return l;
}
 
Example #4
Source File: JobControl.java    From big-c with Apache License 2.0 5 votes vote down vote up
/**
 * Add a new controlled job.
 * @param aJob the new controlled job
 */
synchronized public String addJob(ControlledJob aJob) {
  String id = this.getNextJobID();
  aJob.setJobID(id);
  aJob.setJobState(State.WAITING);
  jobsInProgress.add(aJob);
  return id;	
}
 
Example #5
Source File: PigJobControl.java    From spork with Apache License 2.0 5 votes vote down vote up
private State checkState(ControlledJob j) {
  try {
    return (State)checkState.invoke(j);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
 
Example #6
Source File: PigJobControl.java    From spork with Apache License 2.0 5 votes vote down vote up
private State submit(ControlledJob j) {
  try {
    return (State)submit.invoke(j);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
 
Example #7
Source File: JobControl.java    From hadoop with Apache License 2.0 4 votes vote down vote up
/**
 * @return the jobs in the waiting state
 */
public List<ControlledJob> getWaitingJobList() {
  return getJobsIn(State.WAITING);
}
 
Example #8
Source File: JobControl.java    From hadoop with Apache License 2.0 4 votes vote down vote up
/**
 * @return the jobs in the running state
 */
public List<ControlledJob> getRunningJobList() {
  return getJobsIn(State.RUNNING);
}
 
Example #9
Source File: JobControl.java    From hadoop with Apache License 2.0 4 votes vote down vote up
/**
 * @return the jobs in the ready state
 */
public List<ControlledJob> getReadyJobsList() {
  return getJobsIn(State.READY);
}
 
Example #10
Source File: JobControl.java    From big-c with Apache License 2.0 4 votes vote down vote up
/**
 * @return the jobs in the waiting state
 */
public List<ControlledJob> getWaitingJobList() {
  return getJobsIn(State.WAITING);
}
 
Example #11
Source File: JobControl.java    From big-c with Apache License 2.0 4 votes vote down vote up
/**
 * @return the jobs in the running state
 */
public List<ControlledJob> getRunningJobList() {
  return getJobsIn(State.RUNNING);
}
 
Example #12
Source File: JobControl.java    From big-c with Apache License 2.0 4 votes vote down vote up
/**
 * @return the jobs in the ready state
 */
public List<ControlledJob> getReadyJobsList() {
  return getJobsIn(State.READY);
}