|
| 1 | +/** |
| 2 | + * Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | + * contributor license agreements. See the NOTICE file distributed with this |
| 4 | + * work for additional information regarding copyright ownership. The ASF |
| 5 | + * licenses this file to you under the Apache License, Version 2.0 (the |
| 6 | + * "License"); you may not use this file except in compliance with the License. |
| 7 | + * You may obtain a copy of the License at |
| 8 | + * <p> |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * <p> |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | + * License for the specific language governing permissions and limitations under |
| 15 | + * the License. |
| 16 | + */ |
| 17 | + |
| 18 | +package org.apache.hadoop.yarn.server.federation.store.records; |
| 19 | + |
| 20 | +import org.apache.hadoop.classification.InterfaceAudience.Private; |
| 21 | +import org.apache.hadoop.classification.InterfaceAudience.Public; |
| 22 | +import org.apache.hadoop.classification.InterfaceStability.Unstable; |
| 23 | +import org.apache.hadoop.yarn.util.Records; |
| 24 | + |
| 25 | +/** |
| 26 | + * <p> |
| 27 | + * The request sent by the <code>Router</code> to |
| 28 | + * <code>Federation state store</code> to update the home subcluster of a newly |
| 29 | + * submitted reservation. |
| 30 | + * |
| 31 | + * <p> |
| 32 | + * The request includes the mapping details, i.e.: |
| 33 | + * <ul> |
| 34 | + * <li>{@code ReservationId}</li> |
| 35 | + * <li>{@code SubClusterId}</li> |
| 36 | + * </ul> |
| 37 | + */ |
| 38 | +@Private |
| 39 | +@Unstable |
| 40 | +public abstract class UpdateReservationHomeSubClusterRequest { |
| 41 | + |
| 42 | + @Private |
| 43 | + @Unstable |
| 44 | + public static UpdateReservationHomeSubClusterRequest newInstance( |
| 45 | + ReservationHomeSubCluster reservationHomeSubCluster) { |
| 46 | + UpdateReservationHomeSubClusterRequest updateReservationRequest = |
| 47 | + Records.newRecord(UpdateReservationHomeSubClusterRequest.class); |
| 48 | + updateReservationRequest |
| 49 | + .setReservationHomeSubCluster(reservationHomeSubCluster); |
| 50 | + return updateReservationRequest; |
| 51 | + } |
| 52 | + |
| 53 | + /** |
| 54 | + * Get the {@link ReservationHomeSubCluster} representing the mapping of the |
| 55 | + * reservation to it's home sub-cluster. |
| 56 | + * |
| 57 | + * @return the mapping of the reservation to it's home sub-cluster. |
| 58 | + */ |
| 59 | + @Public |
| 60 | + @Unstable |
| 61 | + public abstract ReservationHomeSubCluster getReservationHomeSubCluster(); |
| 62 | + |
| 63 | + /** |
| 64 | + * Set the {@link ReservationHomeSubCluster} representing the mapping of the |
| 65 | + * reservation to it's home sub-cluster. |
| 66 | + * |
| 67 | + * @param reservationHomeSubCluster the mapping of the reservation to it's |
| 68 | + * home sub-cluster. |
| 69 | + */ |
| 70 | + @Private |
| 71 | + @Unstable |
| 72 | + public abstract void setReservationHomeSubCluster( |
| 73 | + ReservationHomeSubCluster reservationHomeSubCluster); |
| 74 | +} |
0 commit comments