diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/HistoryReader.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/HistoryReader.java new file mode 100644 index 0000000..48fa249 --- /dev/null +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/HistoryReader.java @@ -0,0 +1,84 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.yarn.server.applicationhistoryservice; + +import java.util.Map; + +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; +import org.apache.hadoop.yarn.api.records.ApplicationId; +import org.apache.hadoop.yarn.api.records.ContainerId; +import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp; +import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttempt; +import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainer; + +@InterfaceAudience.Public +@InterfaceStability.Unstable +public interface HistoryReader { + + /** + * This method returns Application {@link RMApp} for the specified + * {@link ApplicationId}. + * + * @return {@link RMApp} for the ApplicationId. + */ + RMApp getApplication(ApplicationId appId); + + /** + * This method returns all Application {@link RMApp}s + * + * @return {@link RMApp}s. + */ + Map getAllApplications(); + + /** + * {@link RMApp} can have multiple application attempts {@link RMAppAttempt}. + * This method returns the all {@link RMAppAttempt}s for the RMApp. + * + * @return all {@link RMAppAttempt}s for the RMApp. + */ + Map getAppAttempts(ApplicationId appId); + + /** + * This method returns {@link RMAppAttempt} for specified + * {@link ApplicationId}. + * + * @param {@link ApplicationAttemptId} + * @return {@link RMAppAttempt} for ApplicationAttemptId + */ + RMAppAttempt getApplicationAttempt(ApplicationAttemptId appAttemptId); + + /** + * This method returns {@link RMContainer} for specified {@link ContainerId}. + * + * @param {@link ContainerId} + * @return {@link RMContainer} for ContainerId + */ + RMContainer getContainer(ContainerId containerId); + + /** + * This method returns {@link RMContainer} for specified + * {@link ApplicationAttemptId}. + * + * @param {@link ApplicationAttemptId} + * @return {@link RMContainer} for ApplicationAttemptId + */ + RMContainer getContainer(ApplicationAttemptId appAttemptId); +}