agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/JobRequestQueueProcessor.java
/**
	 * Finds queue on the {@link #getExecutionSystem()} that supports the {@code resourceRequest}.
	 *
	 * @param resourceRequest a positive integer value or -1 for no limit
	 * @return a BatchQueue matching the given parameters or null if no match can be found
	 * @throws NoMatchingBatchQueueException if no matching queue can be found.
	 */
Finds queue on the  #getExecutionSystem() that supports the  resourceRequest.
@param resourceRequest a positive integer value or -1 for no limit
@return a BatchQueue matching the given parameters or null if no match can be found
@throws NoMatchingBatchQueueException if no matching queue can be found.
Finds queue on the #getExecutionSystem () that supports the resourceRequest . @param resourceRequest a positive integer value or - 1 for no limit @return a BatchQueue matching the given parameters or null if no match can be found @throws NoMatchingBatchQueueException if no matching queue can be found .
protected BatchQueue findMatching(ResourceRequest resourceRequest) throws NoMatchingBatchQueueException 
	{
		if (validateBatchSubmitParameters(getExecutionSystem().getDefaultQueue(), resourceRequest))
		{
			return getExecutionSystem().getDefaultQueue();
		}
		else
		{
			Optional<BatchQueue> matchingQueue = getExecutionSystem().getBatchQueues()
					.stream()
					.sorted()
					.filter(queue -> !queue.isSystemDefault() && validateBatchSubmitParameters(queue, resourceRequest))
					.findFirst();
			if (matchingQueue.isPresent()) {
				return matchingQueue.get();
			} 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(),
						resourceRequest.getMaxNodes(),
						resourceRequest.getMaxMemoryPerNode(),
						resourceRequest.getMaxProcessorsPerNode(),
						resourceRequest.getMaxRequestedTime()));
			}
		}
	}
protected BatchQueue findMatching ( ResourceRequest resourceRequest ) throws NoMatchingBatchQueueException { if ( validateBatchSubmitParameters ( getExecutionSystem ( ) . getDefaultQueue ( ) , resourceRequest ) ) { return getExecutionSystem ( ) . getDefaultQueue ( ) ; } else { Optional < BatchQueue > matchingQueue = getExecutionSystem ( ) . getBatchQueues ( ) . stream ( ) . sorted ( ) . filter ( queue -> ! queue . isSystemDefault ( ) && validateBatchSubmitParameters ( queue , resourceRequest ) ) . findFirst ( ) ; if ( matchingQueue . isPresent ( ) ) { return matchingQueue . get ( ) ; } 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 ( ) , resourceRequest . getMaxNodes ( ) , resourceRequest . getMaxMemoryPerNode ( ) , resourceRequest . getMaxProcessorsPerNode ( ) , resourceRequest . getMaxRequestedTime ( ) ) ) ; } } }
Finds queue on the {@link #getExecutionSystem()} that supports the {@code resourceRequest}.
Finds queue on the { @link #getExecutionSystem () } that supports the { @code resourceRequest } .
//(Long nodes, Double memory, Long processors, String requestedTime) throws NoMatchingBatchQueueException // try the default queue first...because it's the default // filter out all queues that do not match // sort by system owner ordering // filter out any that do not match // return the first match. In the future we could look at some some sort of load balancing algorithm // to distribute jobs across queues, but for now, we'll go with first matching that is not full.