Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public synchronized void close() {

/**
* Getter/Setter methods for log4j.
*
* @return containerLogDir.
*/

public String getContainerLogDir() {
Expand Down Expand Up @@ -118,6 +120,8 @@ public long getTotalLogFileSize() {
/**
* Setter so that log4j can configure it from the
* configuration(log4j.properties).
*
* @param logSize log size.
*/
public void setTotalLogFileSize(long logSize) {
maxEvents = (int)(logSize / EVENT_SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public void flush() {

/**
* Getter/Setter methods for log4j.
*
* @return containerLogDir.
*/

public String getContainerLogDir() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected T getProxyInternal() {

/**
* Stop the current proxy when performFailover.
* @param currentProxy
* @param currentProxy currentProxy.
*/
@Override
public synchronized void performFailover(T currentProxy) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private ClientRMProxy(){
* @param protocol Client protocol for which proxy is being requested.
* @param <T> Type of proxy.
* @return Proxy to the ResourceManager for the specified client protocol.
* @throws IOException
* @throws IOException io error occur.
*/
public static <T> T createRMProxy(final Configuration configuration,
final Class<T> protocol) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public ProxyInfo<T> getProxy() {

/**
* PerformFailover does nothing in this class.
* @param currentProxy
* @param currentProxy currentProxy.
*/
@Override
public void performFailover(T currentProxy) {
Expand All @@ -89,7 +89,7 @@ public void performFailover(T currentProxy) {

/**
* Close the current proxy.
* @throws IOException
* @throws IOException io error occur.
*/
@Override
public void close() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,20 @@ protected RMProxy() {

/**
* Verify the passed protocol is supported.
*
* @param protocol protocol.
*/
@Private
public void checkAllowedProtocols(Class<?> protocol) {}

/**
* Get the ResourceManager address from the provided Configuration for the
* given protocol.
*
* @param conf configuration.
* @param protocol protocol.
* @return inet socket address.
* @throws IOException io error occur.
*/
@Private
public InetSocketAddress getRMAddress(
Expand All @@ -91,6 +98,13 @@ public InetSocketAddress getRMAddress(
* this is a direct connection to the ResourceManager address. When HA is
* enabled, the proxy handles the failover between the ResourceManagers as
* well.
*
* @param configuration configuration.
* @param protocol protocol.
* @param instance RMProxy instance.
* @param <T> Generic T.
* @return RMProxy.
* @throws IOException io error occur.
*/
@Private
protected static <T> T createRMProxy(final Configuration configuration,
Expand All @@ -108,6 +122,15 @@ protected static <T> T createRMProxy(final Configuration configuration,
* this is a direct connection to the ResourceManager address. When HA is
* enabled, the proxy handles the failover between the ResourceManagers as
* well.
*
* @param configuration configuration.
* @param protocol protocol.
* @param instance RMProxy instance.
* @param retryTime retry Time.
* @param retryInterval retry Interval.
* @param <T> Generic T.
* @return RMProxy.
* @throws IOException io error occur.
*/
@Private
protected static <T> T createRMProxy(final Configuration configuration,
Expand Down Expand Up @@ -136,6 +159,13 @@ private static <T> T newProxyInstance(final YarnConfiguration conf,
/**
* Get a proxy to the RM at the specified address. To be used to create a
* RetryProxy.
*
* @param conf configuration.
* @param protocol protocol.
* @param rmAddress rmAddress.
* @param <T> Generic T.
* @return RM proxy.
* @throws IOException io error occur.
*/
@Private
public <T> T getProxy(final Configuration conf,
Expand Down Expand Up @@ -195,7 +225,11 @@ private <T> RMFailoverProxyProvider<T> createRMFailoverProxyProvider(
}

/**
* Fetch retry policy from Configuration
* Fetch retry policy from Configuration.
*
* @param conf configuration.
* @param isHAEnabled is HA enabled.
* @return RetryPolicy.
*/
@Private
@VisibleForTesting
Expand All @@ -218,6 +252,12 @@ public static RetryPolicy createRetryPolicy(Configuration conf,
/**
* Fetch retry policy from Configuration and create the
* retry policy with specified retryTime and retry interval.
*
* @param conf configuration.
* @param retryTime retry time.
* @param retryInterval retry interval.
* @param isHAEnabled is HA enabled.
* @return RetryPolicy.
*/
protected static RetryPolicy createRetryPolicy(Configuration conf,
long retryTime, long retryInterval, boolean isHAEnabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ public abstract int initiateUpgrade(String appName, String fileName,
*
* @param appName the name of the application.
* @param componentInstances the name of the component instances.
* @return exit code.
* @throws IOException io error occur.
* @throws YarnException exceptions from yarn servers.
*/
@Public
@Unstable
Expand All @@ -267,6 +270,9 @@ public abstract int actionUpgradeInstances(String appName,
*
* @param appName the name of the application.
* @param components the name of the components.
* @return exit code.
* @throws IOException io error occur.
* @throws YarnException exceptions from yarn servers.
*/
@Public
@Unstable
Expand All @@ -279,6 +285,9 @@ public abstract int actionUpgradeComponents(String appName,
* @param appName the name of the application.
* @param userName the name of the user.
* @return exit code
* @throws IOException io error occur.
* @throws YarnException exceptions from yarn servers.
* @throws InterruptedException if interrupted.
*/
@Public
@Unstable
Expand All @@ -297,6 +306,8 @@ public abstract String getInstances(String appName,
* @param appName the name of the application
* @param fileName specification of application upgrade to save.
* @return exit code
* @throws IOException io error occur.
* @throws YarnException exceptions from yarn servers.
*/
@Public
@Unstable
Expand All @@ -308,8 +319,8 @@ public abstract int actionUpgradeExpress(String appName, File fileName)
*
* @param appName the name of the application
* @return exit code
* @throws IOException
* @throws YarnException
* @throws IOException io error occur.
* @throws YarnException exceptions from yarn servers.
*/
@Public
@Unstable
Expand All @@ -321,6 +332,9 @@ public abstract int actionCancelUpgrade(String appName) throws IOException,
*
* @param appName the name of the application.
* @param componentInstances the name of the component instances.
* @throws IOException io error occur.
* @throws YarnException exceptions from yarn servers.
* @return exit code.
*/
@Public
@Unstable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ public abstract TimelinePutResponse putEntities(
*
* @param domain
* an {@link TimelineDomain} object
* @throws IOException
* @throws YarnException
* @throws IOException io error occur.
* @throws YarnException exceptions from yarn servers.
*/
@Public
public abstract void putDomain(
Expand All @@ -133,8 +133,8 @@ public abstract void putDomain(
* @param domain
* an {@link TimelineDomain} object
* @param appAttemptId {@link ApplicationAttemptId}
* @throws IOException
* @throws YarnException
* @throws IOException io error occur.
* @throws YarnException exceptions from yarn servers.
*/
@Public
public abstract void putDomain(ApplicationAttemptId appAttemptId,
Expand All @@ -151,8 +151,8 @@ public abstract void putDomain(ApplicationAttemptId appAttemptId,
* securely talking to the timeline server
* @return a delegation token ({@link Token}) that can be used to talk to the
* timeline server
* @throws IOException
* @throws YarnException
* @throws IOException io error occur.
* @throws YarnException exceptions from yarn servers.
*/
@Public
public abstract Token<TimelineDelegationTokenIdentifier> getDelegationToken(
Expand All @@ -166,8 +166,8 @@ public abstract Token<TimelineDelegationTokenIdentifier> getDelegationToken(
* @param timelineDT
* the delegation token to renew
* @return the new expiration time
* @throws IOException
* @throws YarnException
* @throws IOException io error occur.
* @throws YarnException exceptions from yarn servers.
*/
@Public
public abstract long renewDelegationToken(
Expand All @@ -181,8 +181,8 @@ public abstract long renewDelegationToken(
*
* @param timelineDT
* the delegation token to cancel
* @throws IOException
* @throws YarnException
* @throws IOException io error occur.
* @throws YarnException exceptions from yarn servers.
*/
@Public
public abstract void cancelDelegationToken(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public abstract class TimelineReaderClient extends CompositeService {

/**
* Create a new instance of Timeline Reader Client.
*
* @return instance of Timeline Reader Client.
*/
@InterfaceAudience.Public
public static TimelineReaderClient createTimelineReaderClient() {
Expand All @@ -59,7 +61,7 @@ public TimelineReaderClient(String name) {
* @param fields Fields to be fetched. Defaults to INFO.
* @param filters Filters to be applied while fetching entities.
* @return entity of the application
* @throws IOException
* @throws IOException io error occur.
*/
public abstract TimelineEntity getApplicationEntity(
ApplicationId appId, String fields, Map<String, String> filters)
Expand All @@ -71,7 +73,7 @@ public abstract TimelineEntity getApplicationEntity(
* @param fields Fields to be fetched. Defaults to INFO.
* @param filters Filters to be applied while fetching entities.
* @return entity associated with application attempt
* @throws IOException
* @throws IOException io error occur.
*/
public abstract TimelineEntity getApplicationAttemptEntity(
ApplicationAttemptId appAttemptId, String fields,
Expand All @@ -85,7 +87,7 @@ public abstract TimelineEntity getApplicationAttemptEntity(
* @param limit Number of entities to return.
* @param fromId Retrieve next set of generic ids from given fromId
* @return list of application attempt entities
* @throws IOException
* @throws IOException io error occur.
*/
public abstract List<TimelineEntity> getApplicationAttemptEntities(
ApplicationId appId, String fields, Map<String, String> filters,
Expand All @@ -97,7 +99,7 @@ public abstract List<TimelineEntity> getApplicationAttemptEntities(
* @param fields Fields to be fetched. Defaults to INFO.
* @param filters Filters to be applied while fetching entities.
* @return timeline entity for container
* @throws IOException
* @throws IOException io error occur.
*/
public abstract TimelineEntity getContainerEntity(
ContainerId containerId, String fields, Map<String, String> filters)
Expand All @@ -111,7 +113,7 @@ public abstract TimelineEntity getContainerEntity(
* @param limit Number of entities to return.
* @param fromId Retrieve next set of generic ids from given fromId
* @return list of entities
* @throws IOException
* @throws IOException io error occur.
*/
public abstract List<TimelineEntity> getContainerEntities(
ApplicationId appId, String fields,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,28 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceAudience.LimitedPrivate;
import org.apache.hadoop.ipc.RemoteException;
import org.apache.hadoop.yarn.exceptions.YarnException;

import org.apache.hadoop.thirdparty.protobuf.ServiceException;

@InterfaceAudience.LimitedPrivate({ "MapReduce", "YARN" })
@LimitedPrivate({ "MapReduce", "YARN" })
public class RPCUtil {

/**
* Returns an instance of {@link YarnException}
* Returns an instance of {@link YarnException}.
* @param t instance of Throwable.
* @return instance of YarnException.
*/
public static YarnException getRemoteException(Throwable t) {
return new YarnException(t);
}

/**
* Returns an instance of {@link YarnException}
* Returns an instance of {@link YarnException}.
* @param message yarn exception message.
* @return instance of YarnException.
*/
public static YarnException getRemoteException(String message) {
return new YarnException(message);
Expand Down Expand Up @@ -92,6 +96,8 @@ private static <T extends RuntimeException> T instantiateRuntimeException(
* ServiceException
* @return An instance of the actual exception, which will be a subclass of
* {@link YarnException} or {@link IOException}
* @throws IOException io error occur.
* @throws YarnException exceptions from yarn servers.
*/
public static Void unwrapAndThrowException(ServiceException se)
throws IOException, YarnException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,7 @@ public static void readAContainerLogsForALogType(
* @param logUploadedTime the log uploaded time stamp
* @param logType the given log type
* @throws IOException if we can not read the container logs
* @return If logType contains fileType, return 1, otherwise return 0.
*/
public static int readContainerLogsForALogType(
DataInputStream valueStream, PrintStream out, long logUploadedTime,
Expand All @@ -934,7 +935,9 @@ public static int readContainerLogsForALogType(
* @param out the output print stream
* @param logUploadedTime the log uploaded time stamp
* @param logType the given log type
* @param bytes log bytes.
* @throws IOException if we can not read the container logs
* @return If logType contains fileType, return 1, otherwise return 0.
*/
public static int readContainerLogsForALogType(
DataInputStream valueStream, PrintStream out, long logUploadedTime,
Expand Down
Loading