001 /**002 * Licensed to the Apache Software Foundation (ASF) under one003 * or more contributor license agreements. See the NOTICE file004 * distributed with this work for additional information005 * regarding copyright ownership. The ASF licenses this file006 * to you under the Apache License, Version 2.0 (the007 * "License"); you may not use this file except in compliance008 * with the License. You may obtain a copy of the License at009 *010 * http://www.apache.org/licenses/LICENSE-2.0011 *012 * Unless required by applicable law or agreed to in writing, software013 * 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 and016 * limitations under the License.017 */018019 package org.apache.hadoop.yarn.api.protocolrecords;020021 import org.apache.hadoop.classification.InterfaceAudience.Public;022 import org.apache.hadoop.classification.InterfaceStability.Unstable;023 import org.apache.hadoop.yarn.api.records.QueueInfo;024 import org.apache.hadoop.yarn.api.records.ReservationDefinition;025 import org.apache.hadoop.yarn.util.Records;026027 /**028 * {@link ReservationSubmissionRequest} captures the set of requirements the029 * user has to create a reservation.030 * 031 * @see ReservationDefinition032 * 033 */034 @Public035 @Unstable036 public abstract class ReservationSubmissionRequest {037038 @Public039 @Unstable040 public static ReservationSubmissionRequest newInstance(041 ReservationDefinition reservationDefinition, String queueName) {042 ReservationSubmissionRequest request =043 Records.newRecord(ReservationSubmissionRequest.class);044 request.setReservationDefinition(reservationDefinition);045 request.setQueue(queueName);046 return request;047 }048049 /**050 * Get the {@link ReservationDefinition} representing the user constraints for051 * this reservation052 * 053 * @return the reservation definition representing user constraints054 */055 @Public056 @Unstable057 public abstract ReservationDefinition getReservationDefinition();058059 /**060 * Set the {@link ReservationDefinition} representing the user constraints for061 * this reservation062 * 063 * @param reservationDefinition the reservation request representing the064 * reservation065 */066 @Public067 @Unstable068 public abstract void setReservationDefinition(069 ReservationDefinition reservationDefinition);070071 /**072 * Get the name of the {@code Plan} that corresponds to the name of the073 * {@link QueueInfo} in the scheduler to which the reservation will be074 * submitted to.075 * 076 * @return the name of the {@code Plan} that corresponds to the name of the077 * {@link QueueInfo} in the scheduler to which the reservation will be078 * submitted to079 */080 @Public081 @Unstable082 public abstract String getQueue();083084 /**085 * Set the name of the {@code Plan} that corresponds to the name of the086 * {@link QueueInfo} in the scheduler to which the reservation will be087 * submitted to088 * 089 * @param queueName the name of the parent {@code Plan} that corresponds to090 * the name of the {@link QueueInfo} in the scheduler to which the091 * reservation will be submitted to092 */093 @Public094 @Unstable095 public abstract void setQueue(String queueName);096097 }