001/**
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.hadoop.yarn.api.protocolrecords;
019
020import org.apache.hadoop.classification.InterfaceAudience.Public;
021import org.apache.hadoop.classification.InterfaceStability.Unstable;
022import org.apache.hadoop.yarn.api.ApplicationClientProtocol;
023import org.apache.hadoop.yarn.api.records.ApplicationId;
024import org.apache.hadoop.yarn.util.Records;
025
026/**
027 * <p>The request sent by the client to the <code>ResourceManager</code>
028 * to move a submitted application to a different queue.</p>
029 * 
030 * <p>The request includes the {@link ApplicationId} of the application to be
031 * moved and the queue to place it in.</p>
032 * 
033 * @see ApplicationClientProtocol#moveApplicationAcrossQueues(MoveApplicationAcrossQueuesRequest)
034 */
035@Public
036@Unstable
037public abstract class MoveApplicationAcrossQueuesRequest {
038  public static MoveApplicationAcrossQueuesRequest newInstance(ApplicationId appId, String queue) {
039    MoveApplicationAcrossQueuesRequest request =
040        Records.newRecord(MoveApplicationAcrossQueuesRequest.class);
041    request.setApplicationId(appId);
042    request.setTargetQueue(queue);
043    return request;
044  }
045  
046  /**
047   * Get the <code>ApplicationId</code> of the application to be moved.
048   * @return <code>ApplicationId</code> of the application to be moved
049   */
050  public abstract ApplicationId getApplicationId();
051  
052  /**
053   * Set the <code>ApplicationId</code> of the application to be moved.
054   * @param appId <code>ApplicationId</code> of the application to be moved
055   */
056  public abstract void setApplicationId(ApplicationId appId);
057  
058  /**
059   * Get the queue to place the application in.
060   * @return the name of the queue to place the application in
061   */
062  public abstract String getTargetQueue();
063
064  /**
065   * Get the queue to place the application in.
066   * @param queue the name of the queue to place the application in
067   */
068  public abstract void setTargetQueue(String queue);
069}