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

The following examples show how to use org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob.State. These examples are extracted from open source projects. 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 Project: hadoop   Source File: JobControl.java    License: 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 Project: hadoop   Source File: JobControl.java    License: 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 Project: big-c   Source File: JobControl.java    License: 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 Project: big-c   Source File: JobControl.java    License: 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 Project: spork   Source File: PigJobControl.java    License: 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 Project: spork   Source File: PigJobControl.java    License: 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 Project: hadoop   Source File: JobControl.java    License: 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 Project: hadoop   Source File: JobControl.java    License: 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 Project: hadoop   Source File: JobControl.java    License: 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 Project: big-c   Source File: JobControl.java    License: 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 Project: big-c   Source File: JobControl.java    License: 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 Project: big-c   Source File: JobControl.java    License: 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);
}