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 java.util.Set;
022    
023    import org.apache.hadoop.classification.InterfaceAudience.Private;
024    import org.apache.hadoop.classification.InterfaceAudience.Public;
025    import org.apache.hadoop.classification.InterfaceStability.Stable;
026    import org.apache.hadoop.classification.InterfaceStability.Unstable;
027    import org.apache.hadoop.yarn.api.ApplicationClientProtocol;
028    import org.apache.hadoop.yarn.util.Records;
029    
030    /**
031     * <p>The request from clients to get a report of Applications
032     * in the cluster from the <code>ResourceManager</code>.</p>
033     *
034     *
035     * @see ApplicationClientProtocol#getApplications(GetApplicationsRequest)
036     */
037    @Public
038    @Stable
039    public abstract class GetApplicationsRequest {
040      @Public
041      @Stable
042      public static GetApplicationsRequest newInstance() {
043        GetApplicationsRequest request =
044            Records.newRecord(GetApplicationsRequest.class);
045        return request;
046      }
047    
048      @Public
049      @Stable
050      public static GetApplicationsRequest newInstance(
051          Set<String> applicationTypes) {
052        GetApplicationsRequest request =
053            Records.newRecord(GetApplicationsRequest.class);
054        request.setApplicationTypes(applicationTypes);
055        return request;
056      }
057    
058      /**
059       * Get the application types to filter applications on
060       *
061       * @return Set of Application Types to filter on
062       */
063      @Public
064      @Stable
065      public abstract Set<String> getApplicationTypes();
066    
067      /**
068       * Set the application types to filter applications on
069       *
070       * @param applicationTypes
071       * A Set of Application Types to filter on.
072       * If not defined, match all applications
073       */
074      @Private
075      @Unstable
076      public abstract void
077          setApplicationTypes(Set<String> applicationTypes);
078    }