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 */ 018 019package org.apache.hadoop.yarn.api.protocolrecords; 020 021import org.apache.hadoop.classification.InterfaceAudience.Public; 022import org.apache.hadoop.classification.InterfaceStability.Unstable; 023import org.apache.hadoop.yarn.api.ApplicationClientProtocol; 024import org.apache.hadoop.yarn.api.records.ApplicationId; 025import org.apache.hadoop.yarn.api.records.Priority; 026import org.apache.hadoop.yarn.util.Records; 027 028/** 029 * <p> 030 * The request sent by the client to the <code>ResourceManager</code> to set or 031 * update the application priority. 032 * </p> 033 * <p> 034 * The request includes the {@link ApplicationId} of the application and 035 * {@link Priority} to be set for an application 036 * </p> 037 * 038 * @see ApplicationClientProtocol#updateApplicationPriority(UpdateApplicationPriorityRequest) 039 */ 040 041@Public 042@Unstable 043public abstract class UpdateApplicationPriorityRequest { 044 public static UpdateApplicationPriorityRequest newInstance( 045 ApplicationId applicationId, Priority priority) { 046 UpdateApplicationPriorityRequest request = 047 Records.newRecord(UpdateApplicationPriorityRequest.class); 048 request.setApplicationId(applicationId); 049 request.setApplicationPriority(priority); 050 return request; 051 } 052 053 /** 054 * Get the <code>ApplicationId</code> of the application. 055 * 056 * @return <code>ApplicationId</code> of the application 057 */ 058 public abstract ApplicationId getApplicationId(); 059 060 /** 061 * Set the <code>ApplicationId</code> of the application. 062 * 063 * @param applicationId <code>ApplicationId</code> of the application 064 */ 065 public abstract void setApplicationId(ApplicationId applicationId); 066 067 /** 068 * Get the <code>Priority</code> of the application to be set. 069 * 070 * @return <code>Priority</code> of the application to be set. 071 */ 072 public abstract Priority getApplicationPriority(); 073 074 /** 075 * Set the <code>Priority</code> of the application. 076 * 077 * @param priority <code>Priority</code> of the application 078 */ 079 public abstract void setApplicationPriority(Priority priority); 080}