Java Code Examples for org.apache.hadoop.yarn.api.records.QueueState#RUNNING

The following examples show how to use org.apache.hadoop.yarn.api.records.QueueState#RUNNING . 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: ParentQueue.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Override
public void submitApplication(ApplicationId applicationId, String user,
    String queue) throws AccessControlException {
  
  synchronized (this) {
    // Sanity check
    if (queue.equals(queueName)) {
      throw new AccessControlException("Cannot submit application " +
          "to non-leaf queue: " + queueName);
    }
    
    if (state != QueueState.RUNNING) {
      throw new AccessControlException("Queue " + getQueuePath() +
          " is STOPPED. Cannot accept submission of application: " +
          applicationId);
    }

    addApplication(applicationId, user);
  }
  
  // Inform the parent queue
  if (parent != null) {
    try {
      parent.submitApplication(applicationId, user, queue);
    } catch (AccessControlException ace) {
      LOG.info("Failed to submit application to parent-queue: " + 
          parent.getQueuePath(), ace);
      removeApplication(applicationId, user);
      throw ace;
    }
  }
}
 
Example 2
Source File: ParentQueue.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Override
public void submitApplication(ApplicationId applicationId, String user,
    String queue) throws AccessControlException {
  
  synchronized (this) {
    // Sanity check
    if (queue.equals(queueName)) {
      throw new AccessControlException("Cannot submit application " +
          "to non-leaf queue: " + queueName);
    }
    
    if (state != QueueState.RUNNING) {
      throw new AccessControlException("Queue " + getQueuePath() +
          " is STOPPED. Cannot accept submission of application: " +
          applicationId);
    }

    addApplication(applicationId, user);
  }
  
  // Inform the parent queue
  if (parent != null) {
    try {
      parent.submitApplication(applicationId, user, queue);
    } catch (AccessControlException ace) {
      LOG.info("Failed to submit application to parent-queue: " + 
          parent.getQueuePath(), ace);
      removeApplication(applicationId, user);
      throw ace;
    }
  }
}
 
Example 3
Source File: CapacitySchedulerConfiguration.java    From hadoop with Apache License 2.0 4 votes vote down vote up
public QueueState getState(String queue) {
  String state = get(getQueuePrefix(queue) + STATE);
  return (state != null) ? 
      QueueState.valueOf(StringUtils.toUpperCase(state)) : QueueState.RUNNING;
}
 
Example 4
Source File: CapacitySchedulerConfiguration.java    From big-c with Apache License 2.0 4 votes vote down vote up
public QueueState getState(String queue) {
  String state = get(getQueuePrefix(queue) + STATE);
  return (state != null) ? 
      QueueState.valueOf(StringUtils.toUpperCase(state)) : QueueState.RUNNING;
}