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    
019    package org.apache.hadoop.yarn.api.protocolrecords;
020    
021    import org.apache.hadoop.classification.InterfaceAudience.Public;
022    import org.apache.hadoop.classification.InterfaceStability.Unstable;
023    import org.apache.hadoop.yarn.api.records.ReservationDefinition;
024    import org.apache.hadoop.yarn.api.records.ReservationId;
025    import org.apache.hadoop.yarn.util.Records;
026    
027    /**
028     * {@link ReservationDeleteRequest} captures the set of requirements the user
029     * has to delete an existing reservation.
030     * 
031     * @see ReservationDefinition
032     * 
033     */
034    @Public
035    @Unstable
036    public abstract class ReservationDeleteRequest {
037    
038      @Public
039      @Unstable
040      public static ReservationDeleteRequest newInstance(ReservationId reservationId) {
041        ReservationDeleteRequest request =
042            Records.newRecord(ReservationDeleteRequest.class);
043        request.setReservationId(reservationId);
044        return request;
045      }
046    
047      /**
048       * Get the {@link ReservationId}, that corresponds to a valid resource
049       * allocation in the scheduler (between start and end time of this
050       * reservation)
051       * 
052       * @return the {@link ReservationId} representing the unique id of the
053       *         corresponding reserved resource allocation in the scheduler
054       */
055      @Public
056      @Unstable
057      public abstract ReservationId getReservationId();
058    
059      /**
060       * Set the {@link ReservationId}, that correspond to a valid resource
061       * allocation in the scheduler (between start and end time of this
062       * reservation)
063       * 
064       * @param reservationId the {@link ReservationId} representing the the unique
065       *          id of the corresponding reserved resource allocation in the
066       *          scheduler
067       */
068      @Public
069      @Unstable
070      public abstract void setReservationId(ReservationId reservationId);
071    
072    }