All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest Maven / Gradle / Ivy

There is a newer version: 3.4.0
Show newest version
/**
 * 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.api.protocolrecords;

import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.ApplicationMasterProtocol;
import org.apache.hadoop.yarn.util.Records;

/**
 * 

The request sent by the ApplicationMaster to * ResourceManager on registration.

* *

The registration includes details such as: *

    *
  • Hostname on which the AM is running.
  • *
  • RPC Port
  • *
  • Tracking URL
  • *
*

* * @see ApplicationMasterProtocol#registerApplicationMaster(RegisterApplicationMasterRequest) */ @Public @Stable public abstract class RegisterApplicationMasterRequest { /** * Create a new instance of RegisterApplicationMasterRequest. * If port, trackingUrl is not used, use the following default value: *
    *
  • port: -1
  • *
  • trackingUrl: null
  • *
* The port is allowed to be any integer larger than or equal to -1. * @return the new instance of RegisterApplicationMasterRequest */ @Public @Stable public static RegisterApplicationMasterRequest newInstance(String host, int port, String trackingUrl) { RegisterApplicationMasterRequest request = Records.newRecord(RegisterApplicationMasterRequest.class); request.setHost(host); request.setRpcPort(port); request.setTrackingUrl(trackingUrl); return request; } /** * Get the host on which the ApplicationMaster is * running. * @return host on which the ApplicationMaster is running */ @Public @Stable public abstract String getHost(); /** * Set the host on which the ApplicationMaster is * running. * @param host host on which the ApplicationMaster * is running */ @Public @Stable public abstract void setHost(String host); /** * Get the RPC port on which the ApplicationMaster * is responding. * @return the RPC port on which the ApplicationMaster is * responding */ @Public @Stable public abstract int getRpcPort(); /** * Set the RPC port on which the ApplicationMaster is * responding. * @param port RPC port on which the ApplicationMaster is * responding */ @Public @Stable public abstract void setRpcPort(int port); /** * Get the tracking URL for the ApplicationMaster. * This url if contains scheme then that will be used by resource manager * web application proxy otherwise it will default to http. * @return tracking URL for the ApplicationMaster */ @Public @Stable public abstract String getTrackingUrl(); /** * Set the tracking URLfor the ApplicationMaster while * it is running. This is the web-URL to which ResourceManager or * web-application proxy will redirect client/users while the application and * the ApplicationMaster are still running. *

* If the passed url has a scheme then that will be used by the * ResourceManager and web-application proxy, otherwise the scheme will * default to http. *

*

* Empty, null, "N/A" strings are all valid besides a real URL. In case an url * isn't explicitly passed, it defaults to "N/A" on the ResourceManager. *

* * @param trackingUrl * tracking URLfor the ApplicationMaster */ @Public @Stable public abstract void setTrackingUrl(String trackingUrl); }