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.ApplicationHistoryProtocol;
024 import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
025 import org.apache.hadoop.yarn.util.Records;
026
027 /**
028 * <p>
029 * The request from clients to get a list of container reports, which belong to
030 * an application attempt from the <code>ResourceManager</code>.
031 * </p>
032 *
033 * @see ApplicationHistoryProtocol#getContainers(GetContainersRequest)
034 */
035 @Public
036 @Unstable
037 public abstract class GetContainersRequest {
038 @Public
039 @Unstable
040 public static GetContainersRequest newInstance(
041 ApplicationAttemptId applicationAttemptId) {
042 GetContainersRequest request =
043 Records.newRecord(GetContainersRequest.class);
044 request.setApplicationAttemptId(applicationAttemptId);
045 return request;
046 }
047
048 /**
049 * Get the <code>ApplicationAttemptId</code> of an application attempt.
050 *
051 * @return <code>ApplicationAttemptId</code> of an application attempt
052 */
053 @Public
054 @Unstable
055 public abstract ApplicationAttemptId getApplicationAttemptId();
056
057 /**
058 * Set the <code>ApplicationAttemptId</code> of an application attempt
059 *
060 * @param applicationAttemptId
061 * <code>ApplicationAttemptId</code> of an application attempt
062 */
063 @Public
064 @Unstable
065 public abstract void setApplicationAttemptId(
066 ApplicationAttemptId applicationAttemptId);
067 }