agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/JobRequestQueueProcessor.java
/**
	 * Validates the resource request value provided in the job requets and attempts to select a matching queue. The
	 * queue selection algorithm is as follows.
	 * <ol>
	 * <li>If the user supplies a batch queue name in the job request, that is used.</li>
	 * <li>If the software as specified in the job request has a default queue, that is used.</li>
	 * <li>If the execution system has a default queue, that matches the resources requested, that is used.</li>
	 * <li>The first batch queue on the execution system that satisfies the resources requested is used.</li>
	 * </ol>
	 *
	 * Once a {@link BatchQueue} is selected, it is validated against the resources requested and, if successful, set
	 * as the {@link #matchingBatchQueue}.
	 * 
	 * @param jobRequestMap  the job requet map from which the queue info should be processed
	 * @throws JobProcessingException if a resource constraint is invalid
	 * @throws NoMatchingBatchQueueException if no queue satisfying the constraint can be found.
	 */
Validates the resource request value provided in the job requets and attempts to select a matching queue. The
queue selection algorithm is as follows.

If the user supplies a batch queue name in the job request, that is used.
If the software as specified in the job request has a default queue, that is used.
If the execution system has a default queue, that matches the resources requested, that is used.
The first batch queue on the execution system that satisfies the resources requested is used.


Once a  BatchQueue is selected, it is validated against the resources requested and, if successful, set
as the  #matchingBatchQueue.

@param jobRequestMap  the job requet map from which the queue info should be processed
@throws JobProcessingException if a resource constraint is invalid
@throws NoMatchingBatchQueueException if no queue satisfying the constraint can be found.
Validates the resource request value provided in the job requets and attempts to select a matching queue . The queue selection algorithm is as follows . If the user supplies a batch queue name in the job request that is used . If the software as specified in the job request has a default queue that is used . If the execution system has a default queue that matches the resources requested that is used . The first batch queue on the execution system that satisfies the resources requested is used . Once a BatchQueue is selected it is validated against the resources requested and if successful set as the #matchingBatchQueue . @param jobRequestMap the job requet map from which the queue info should be processed @throws JobProcessingException if a resource constraint is invalid @throws NoMatchingBatchQueueException if no queue satisfying the constraint can be found .
public void process(Map<String, Object> jobRequestMap) throws JobProcessingException, NoMatchingBatchQueueException
	{
		BatchQueue selectedQueue = null;
		parseResourceRequestFromJobRequest(jobRequestMap);
		if (getUserBatchQueue() == null) {
			if (getSoftwareBatchQueue() == null) {
				selectedQueue = findMatching(getResourceRequest());
			} else {
				selectedQueue = getSoftwareBatchQueue();
			}
		} else {
			selectedQueue = getUserBatchQueue();
		}
		if (validateBatchSubmitParameters(selectedQueue, getResourceRequest()))  {
			setMatchingBatchQueue(selectedQueue);
		} else {
			throw new NoMatchingBatchQueueException(String.format("No queue found on execution system %s to support jobs " +
					"requiring %d nodes with %f memmory and %d processors per node, and a max run time of %s.",
					getExecutionSystem().getSystemId(),
					getResourceRequest().getMaxNodes(),
					getResourceRequest().getMaxMemoryPerNode(),
					getResourceRequest().getMaxProcessorsPerNode(),
					getResourceRequest().getMaxRequestedTime()));
		}
	}
public void process ( Map < String , Object > jobRequestMap ) throws JobProcessingException , NoMatchingBatchQueueException { BatchQueue selectedQueue = null ; parseResourceRequestFromJobRequest ( jobRequestMap ) ; if ( getUserBatchQueue ( ) == null ) { if ( getSoftwareBatchQueue ( ) == null ) { selectedQueue = findMatching ( getResourceRequest ( ) ) ; } else { selectedQueue = getSoftwareBatchQueue ( ) ; } } else { selectedQueue = getUserBatchQueue ( ) ; } if ( validateBatchSubmitParameters ( selectedQueue , getResourceRequest ( ) ) ) { setMatchingBatchQueue ( selectedQueue ) ; } else { throw new NoMatchingBatchQueueException ( String . format ( "No queue found on execution system %s to support jobs " + "requiring %d nodes with %f memmory and %d processors per node, and a max run time of %s." , getExecutionSystem ( ) . getSystemId ( ) , getResourceRequest ( ) . getMaxNodes ( ) , getResourceRequest ( ) . getMaxMemoryPerNode ( ) , getResourceRequest ( ) . getMaxProcessorsPerNode ( ) , getResourceRequest ( ) . getMaxRequestedTime ( ) ) ) ; } }
Validates the resource request value provided in the job requets and attempts to select a matching queue.
Validates the resource request value provided in the job requets and attempts to select a matching queue .
// parses all the queue and resource requet info from the job request into ResourceRequest, userBatchQueue // and softwareBatchQueue objects