YARN-11203. Fix typo in hadoop-yarn-server-router module. (#4510). Contributed by fanshilun.
Reviewed-by: Fei Hui <feihui.ustc@gmail.com> Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
This commit is contained in:
parent
2c96357051
commit
63db1a85e3
|
@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
|
|||
/**
|
||||
* Implements the {@link ClientRequestInterceptor} interface and provides common
|
||||
* functionality which can can be used and/or extended by other concrete
|
||||
* intercepter classes.
|
||||
* interceptor classes.
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractClientRequestInterceptor
|
||||
|
|
|
@ -22,14 +22,14 @@ import org.apache.hadoop.conf.Configurable;
|
|||
import org.apache.hadoop.yarn.api.ApplicationClientProtocol;
|
||||
|
||||
/**
|
||||
* Defines the contract to be implemented by the request intercepter classes,
|
||||
* Defines the contract to be implemented by the request interceptor classes,
|
||||
* that can be used to intercept and inspect messages sent from the client to
|
||||
* the resource manager.
|
||||
*/
|
||||
public interface ClientRequestInterceptor
|
||||
extends ApplicationClientProtocol, Configurable {
|
||||
/**
|
||||
* This method is called for initializing the intercepter. This is guaranteed
|
||||
* This method is called for initializing the interceptor. This is guaranteed
|
||||
* to be called only once in the lifetime of this instance.
|
||||
*
|
||||
* @param user the name of the client
|
||||
|
@ -37,28 +37,28 @@ public interface ClientRequestInterceptor
|
|||
void init(String user);
|
||||
|
||||
/**
|
||||
* This method is called to release the resources held by the intercepter.
|
||||
* This method is called to release the resources held by the interceptor.
|
||||
* This will be called when the application pipeline is being destroyed. The
|
||||
* concrete implementations should dispose the resources and forward the
|
||||
* request to the next intercepter, if any.
|
||||
* request to the next interceptor, if any.
|
||||
*/
|
||||
void shutdown();
|
||||
|
||||
/**
|
||||
* Sets the next intercepter in the pipeline. The concrete implementation of
|
||||
* Sets the next interceptor in the pipeline. The concrete implementation of
|
||||
* this interface should always pass the request to the nextInterceptor after
|
||||
* inspecting the message. The last intercepter in the chain is responsible to
|
||||
* inspecting the message. The last interceptor in the chain is responsible to
|
||||
* send the messages to the resource manager service and so the last
|
||||
* intercepter will not receive this method call.
|
||||
* interceptor will not receive this method call.
|
||||
*
|
||||
* @param nextInterceptor the ClientRequestInterceptor to set in the pipeline
|
||||
*/
|
||||
void setNextInterceptor(ClientRequestInterceptor nextInterceptor);
|
||||
|
||||
/**
|
||||
* Returns the next intercepter in the chain.
|
||||
* Returns the next interceptor in the chain.
|
||||
*
|
||||
* @return the next intercepter in the chain
|
||||
* @return the next interceptor in the chain
|
||||
*/
|
||||
ClientRequestInterceptor getNextInterceptor();
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ import org.apache.hadoop.classification.VisibleForTesting;
|
|||
* Extends the {@code AbstractRequestInterceptorClient} class and provides an
|
||||
* implementation for federation of YARN RM and scaling an application across
|
||||
* multiple YARN SubClusters. All the federation specific implementation is
|
||||
* encapsulated in this class. This is always the last intercepter in the chain.
|
||||
* encapsulated in this class. This is always the last interceptor in the chain.
|
||||
*/
|
||||
public class FederationClientInterceptor
|
||||
extends AbstractClientRequestInterceptor {
|
||||
|
@ -662,7 +662,7 @@ public class FederationClientInterceptor
|
|||
* Router: the Client will timeout and resubmit the request.
|
||||
*
|
||||
* ResourceManager: the Router calls each Yarn RM in parallel. In case a
|
||||
* Yarn RM fails, a single call will timeout. However the Router will
|
||||
* Yarn RM fails, a single call will timeout. However, the Router will
|
||||
* merge the ApplicationReports it got, and provides a partial list to
|
||||
* the client.
|
||||
*
|
||||
|
|
|
@ -202,10 +202,10 @@ public class RouterClientRMService extends AbstractService
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the comma separated intercepter class names from the configuration.
|
||||
* Returns the comma separated interceptor class names from the configuration.
|
||||
*
|
||||
* @param conf
|
||||
* @return the intercepter class names as an instance of ArrayList
|
||||
* @return the interceptor class names as an instance of ArrayList
|
||||
*/
|
||||
private List<String> getInterceptorClassNames(Configuration conf) {
|
||||
String configuredInterceptorClassNames =
|
||||
|
@ -489,9 +489,9 @@ public class RouterClientRMService extends AbstractService
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the Request intercepter chains for all the users.
|
||||
* Gets the Request interceptor chains for all the users.
|
||||
*
|
||||
* @return the request intercepter chains.
|
||||
* @return the request interceptor chains.
|
||||
*/
|
||||
@VisibleForTesting
|
||||
protected Map<String, RequestInterceptorChainWrapper> getPipelines() {
|
||||
|
@ -499,10 +499,10 @@ public class RouterClientRMService extends AbstractService
|
|||
}
|
||||
|
||||
/**
|
||||
* This method creates and returns reference of the first intercepter in the
|
||||
* chain of request intercepter instances.
|
||||
* This method creates and returns reference of the first interceptor in the
|
||||
* chain of request interceptor instances.
|
||||
*
|
||||
* @return the reference of the first intercepter in the chain
|
||||
* @return the reference of the first interceptor in the chain
|
||||
*/
|
||||
@VisibleForTesting
|
||||
protected ClientRequestInterceptor createRequestInterceptorChain() {
|
||||
|
@ -548,7 +548,7 @@ public class RouterClientRMService extends AbstractService
|
|||
}
|
||||
|
||||
/**
|
||||
* Initializes the request intercepter pipeline for the specified application.
|
||||
* Initializes the request interceptor pipeline for the specified application.
|
||||
*
|
||||
* @param user
|
||||
*/
|
||||
|
@ -600,9 +600,9 @@ public class RouterClientRMService extends AbstractService
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the root request intercepter.
|
||||
* Gets the root request interceptor.
|
||||
*
|
||||
* @return the root request intercepter
|
||||
* @return the root request interceptor
|
||||
*/
|
||||
public synchronized ClientRequestInterceptor getRootInterceptor() {
|
||||
return rootInterceptor;
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.apache.hadoop.conf.Configuration;
|
|||
/**
|
||||
* Implements the {@link RMAdminRequestInterceptor} interface and provides
|
||||
* common functionality which can can be used and/or extended by other concrete
|
||||
* intercepter classes.
|
||||
* interceptor classes.
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractRMAdminRequestInterceptor
|
||||
|
|
|
@ -22,14 +22,14 @@ import org.apache.hadoop.conf.Configurable;
|
|||
import org.apache.hadoop.yarn.server.api.ResourceManagerAdministrationProtocol;
|
||||
|
||||
/**
|
||||
* Defines the contract to be implemented by the request intercepter classes,
|
||||
* Defines the contract to be implemented by the request interceptor classes,
|
||||
* that can be used to intercept and inspect messages sent from the client to
|
||||
* the resource manager.
|
||||
*/
|
||||
public interface RMAdminRequestInterceptor
|
||||
extends ResourceManagerAdministrationProtocol, Configurable {
|
||||
/**
|
||||
* This method is called for initializing the intercepter. This is guaranteed
|
||||
* This method is called for initializing the interceptor. This is guaranteed
|
||||
* to be called only once in the lifetime of this instance.
|
||||
*
|
||||
* @param user the name of the client
|
||||
|
@ -37,28 +37,28 @@ public interface RMAdminRequestInterceptor
|
|||
void init(String user);
|
||||
|
||||
/**
|
||||
* This method is called to release the resources held by the intercepter.
|
||||
* This method is called to release the resources held by the interceptor.
|
||||
* This will be called when the application pipeline is being destroyed. The
|
||||
* concrete implementations should dispose the resources and forward the
|
||||
* request to the next intercepter, if any.
|
||||
* request to the next interceptor, if any.
|
||||
*/
|
||||
void shutdown();
|
||||
|
||||
/**
|
||||
* Sets the next intercepter in the pipeline. The concrete implementation of
|
||||
* Sets the next interceptor in the pipeline. The concrete implementation of
|
||||
* this interface should always pass the request to the nextInterceptor after
|
||||
* inspecting the message. The last intercepter in the chain is responsible to
|
||||
* inspecting the message. The last interceptor in the chain is responsible to
|
||||
* send the messages to the resource manager service and so the last
|
||||
* intercepter will not receive this method call.
|
||||
* interceptor will not receive this method call.
|
||||
*
|
||||
* @param nextInterceptor the RMAdminRequestInterceptor to set in the pipeline
|
||||
*/
|
||||
void setNextInterceptor(RMAdminRequestInterceptor nextInterceptor);
|
||||
|
||||
/**
|
||||
* Returns the next intercepter in the chain.
|
||||
* Returns the next interceptor in the chain.
|
||||
*
|
||||
* @return the next intercepter in the chain
|
||||
* @return the next interceptor in the chain
|
||||
*/
|
||||
RMAdminRequestInterceptor getNextInterceptor();
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ import org.apache.hadoop.classification.VisibleForTesting;
|
|||
* messages from client to the cluster resource manager. It listens
|
||||
* {@code ResourceManagerAdministrationProtocol} messages from the client and
|
||||
* creates a request intercepting pipeline instance for each client. The
|
||||
* pipeline is a chain of intercepter instances that can inspect and modify the
|
||||
* pipeline is a chain of interceptor instances that can inspect and modify the
|
||||
* request/response as needed. The main difference with AMRMProxyService is the
|
||||
* protocol they implement.
|
||||
*/
|
||||
|
@ -165,10 +165,10 @@ public class RouterRMAdminService extends AbstractService
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the comma separated intercepter class names from the configuration.
|
||||
* Returns the comma separated interceptor class names from the configuration.
|
||||
*
|
||||
* @param conf
|
||||
* @return the intercepter class names as an instance of ArrayList
|
||||
* @return the interceptor class names as an instance of ArrayList
|
||||
*/
|
||||
private List<String> getInterceptorClassNames(Configuration conf) {
|
||||
String configuredInterceptorClassNames =
|
||||
|
@ -197,9 +197,9 @@ public class RouterRMAdminService extends AbstractService
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the Request intercepter chains for all the users.
|
||||
* Gets the Request interceptor chains for all the users.
|
||||
*
|
||||
* @return the request intercepter chains.
|
||||
* @return the request interceptor chains.
|
||||
*/
|
||||
@VisibleForTesting
|
||||
protected Map<String, RequestInterceptorChainWrapper> getPipelines() {
|
||||
|
@ -207,10 +207,10 @@ public class RouterRMAdminService extends AbstractService
|
|||
}
|
||||
|
||||
/**
|
||||
* This method creates and returns reference of the first intercepter in the
|
||||
* chain of request intercepter instances.
|
||||
* This method creates and returns reference of the first interceptor in the
|
||||
* chain of request interceptor instances.
|
||||
*
|
||||
* @return the reference of the first intercepter in the chain
|
||||
* @return the reference of the first interceptor in the chain
|
||||
*/
|
||||
@VisibleForTesting
|
||||
protected RMAdminRequestInterceptor createRequestInterceptorChain() {
|
||||
|
@ -257,7 +257,7 @@ public class RouterRMAdminService extends AbstractService
|
|||
}
|
||||
|
||||
/**
|
||||
* Initializes the request intercepter pipeline for the specified user.
|
||||
* Initializes the request interceptor pipeline for the specified user.
|
||||
*
|
||||
* @param user
|
||||
*/
|
||||
|
@ -308,9 +308,9 @@ public class RouterRMAdminService extends AbstractService
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the root request intercepter.
|
||||
* Gets the root request interceptor.
|
||||
*
|
||||
* @return the root request intercepter
|
||||
* @return the root request interceptor
|
||||
*/
|
||||
public synchronized RMAdminRequestInterceptor getRootInterceptor() {
|
||||
return rootInterceptor;
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.apache.hadoop.conf.Configuration;
|
|||
|
||||
/**
|
||||
* Extends the RequestInterceptor class and provides common functionality which
|
||||
* can be used and/or extended by other concrete intercepter classes.
|
||||
* can be used and/or extended by other concrete interceptor classes.
|
||||
*/
|
||||
public abstract class AbstractRESTRequestInterceptor
|
||||
implements RESTRequestInterceptor {
|
||||
|
|
|
@ -111,7 +111,7 @@ import org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ThreadFact
|
|||
* Extends the {@code AbstractRESTRequestInterceptor} class and provides an
|
||||
* implementation for federation of YARN RM and scaling an application across
|
||||
* multiple YARN SubClusters. All the federation specific implementation is
|
||||
* encapsulated in this class. This is always the last intercepter in the chain.
|
||||
* encapsulated in this class. This is always the last interceptor in the chain.
|
||||
*/
|
||||
public class FederationInterceptorREST extends AbstractRESTRequestInterceptor {
|
||||
|
||||
|
@ -406,7 +406,7 @@ public class FederationInterceptorREST extends AbstractRESTRequestInterceptor {
|
|||
if (newApp == null || newApp.getApplicationId() == null) {
|
||||
routerMetrics.incrAppsFailedSubmitted();
|
||||
String errMsg = "Missing ApplicationSubmissionContextInfo or "
|
||||
+ "applicationSubmissionContex information.";
|
||||
+ "applicationSubmissionContext information.";
|
||||
return Response
|
||||
.status(Status.BAD_REQUEST)
|
||||
.entity(errMsg)
|
||||
|
@ -667,7 +667,7 @@ public class FederationInterceptorREST extends AbstractRESTRequestInterceptor {
|
|||
* <p>
|
||||
* ResourceManager: the Router calls each YARN RM in parallel by using one
|
||||
* thread for each YARN RM. In case a YARN RM fails, a single call will
|
||||
* timeout. However the Router will merge the ApplicationReports it got, and
|
||||
* timeout. However, the Router will merge the ApplicationReports it got, and
|
||||
* provides a partial list to the client.
|
||||
* <p>
|
||||
* State Store: the Router will timeout and it will retry depending on the
|
||||
|
@ -942,7 +942,7 @@ public class FederationInterceptorREST extends AbstractRESTRequestInterceptor {
|
|||
* <p>
|
||||
* ResourceManager: the Router calls each YARN RM in parallel by using one
|
||||
* thread for each YARN RM. In case a YARN RM fails, a single call will
|
||||
* timeout. However the Router will use the NodesInfo it got, and provides a
|
||||
* timeout. However, the Router will use the NodesInfo it got, and provides a
|
||||
* partial list to the client.
|
||||
* <p>
|
||||
* State Store: the Router will timeout and it will retry depending on the
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.apache.hadoop.yarn.server.webapp.dao.ContainerInfo;
|
|||
import org.apache.hadoop.yarn.server.webapp.dao.ContainersInfo;
|
||||
|
||||
/**
|
||||
* Defines the contract to be implemented by the request intercepter classes,
|
||||
* Defines the contract to be implemented by the request interceptor classes,
|
||||
* that can be used to intercept and inspect messages sent from the client to
|
||||
* the resource manager server.
|
||||
*
|
||||
|
@ -42,7 +42,7 @@ public interface RESTRequestInterceptor
|
|||
extends RMWebServiceProtocol, Configurable {
|
||||
|
||||
/**
|
||||
* This method is called for initializing the intercepter. This is guaranteed
|
||||
* This method is called for initializing the interceptor. This is guaranteed
|
||||
* to be called only once in the lifetime of this instance.
|
||||
*
|
||||
* @param user the name of the client
|
||||
|
@ -50,28 +50,28 @@ public interface RESTRequestInterceptor
|
|||
void init(String user);
|
||||
|
||||
/**
|
||||
* This method is called to release the resources held by the intercepter.
|
||||
* This method is called to release the resources held by the interceptor.
|
||||
* This will be called when the application pipeline is being destroyed. The
|
||||
* concrete implementations should dispose the resources and forward the
|
||||
* request to the next intercepter, if any.
|
||||
* request to the next interceptor, if any.
|
||||
*/
|
||||
void shutdown();
|
||||
|
||||
/**
|
||||
* Sets the next intercepter in the pipeline. The concrete implementation of
|
||||
* Sets the next interceptor in the pipeline. The concrete implementation of
|
||||
* this interface should always pass the request to the nextInterceptor after
|
||||
* inspecting the message. The last intercepter in the chain is responsible to
|
||||
* inspecting the message. The last interceptor in the chain is responsible to
|
||||
* send the messages to the resource manager service and so the last
|
||||
* intercepter will not receive this method call.
|
||||
* interceptor will not receive this method call.
|
||||
*
|
||||
* @param nextInterceptor the RESTRequestInterceptor to set in the pipeline
|
||||
*/
|
||||
void setNextInterceptor(RESTRequestInterceptor nextInterceptor);
|
||||
|
||||
/**
|
||||
* Returns the next intercepter in the chain.
|
||||
* Returns the next interceptor in the chain.
|
||||
*
|
||||
* @return the next intercepter in the chain
|
||||
* @return the next interceptor in the chain
|
||||
*/
|
||||
RESTRequestInterceptor getNextInterceptor();
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ public final class RouterWebServiceUtil {
|
|||
/**
|
||||
* Creates and performs a REST call to a specific WebService.
|
||||
*
|
||||
* @param webApp the address of the remote webap
|
||||
* @param webApp the address of the remote webapp
|
||||
* @param hsr the servlet request
|
||||
* @param returnType the return type of the REST call
|
||||
* @param <T> Type of return object.
|
||||
|
@ -170,7 +170,7 @@ public final class RouterWebServiceUtil {
|
|||
|
||||
/**
|
||||
* Performs an invocation of a REST call on a remote RMWebService.
|
||||
* @param webApp the address of the remote webap
|
||||
* @param webApp the address of the remote webapp
|
||||
* @param path to add to the webapp address
|
||||
* @param method the HTTP method of the REST call
|
||||
* @param additionalPath the servlet request path
|
||||
|
@ -280,7 +280,7 @@ public final class RouterWebServiceUtil {
|
|||
|
||||
/**
|
||||
* Merges a list of AppInfo grouping by ApplicationId. Our current policy is
|
||||
* to merge the application reports from the reacheable SubClusters. Via
|
||||
* to merge the application reports from the reachable SubClusters. Via
|
||||
* configuration parameter, we decide whether to return applications for which
|
||||
* the primary AM is missing or to omit them.
|
||||
*
|
||||
|
@ -494,7 +494,7 @@ public final class RouterWebServiceUtil {
|
|||
protected static <T> String getMediaTypeFromHttpServletRequest(
|
||||
HttpServletRequest request, final Class<T> returnType) {
|
||||
if (request == null) {
|
||||
// By default we return XML for REST call without HttpServletRequest
|
||||
// By default, we return XML for REST call without HttpServletRequest
|
||||
return MediaType.APPLICATION_XML;
|
||||
}
|
||||
// TODO
|
||||
|
@ -503,7 +503,7 @@ public final class RouterWebServiceUtil {
|
|||
}
|
||||
String header = request.getHeader(HttpHeaders.ACCEPT);
|
||||
if (header == null || header.equals("*")) {
|
||||
// By default we return JSON
|
||||
// By default, we return JSON
|
||||
return MediaType.APPLICATION_JSON;
|
||||
}
|
||||
return header;
|
||||
|
|
|
@ -141,10 +141,10 @@ public class RouterWebServices implements RMWebServiceProtocol {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the comma separated intercepter class names from the configuration.
|
||||
* Returns the comma separated interceptor class names from the configuration.
|
||||
*
|
||||
* @param conf
|
||||
* @return the intercepter class names as an instance of ArrayList
|
||||
* @return the interceptor class names as an instance of ArrayList
|
||||
*/
|
||||
private List<String> getInterceptorClassNames(Configuration config) {
|
||||
String configuredInterceptorClassNames =
|
||||
|
@ -189,9 +189,9 @@ public class RouterWebServices implements RMWebServiceProtocol {
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the Request intercepter chains for all the users.
|
||||
* Gets the Request interceptor chains for all the users.
|
||||
*
|
||||
* @return the request intercepter chains.
|
||||
* @return the request interceptor chains.
|
||||
*/
|
||||
@VisibleForTesting
|
||||
protected Map<String, RequestInterceptorChainWrapper> getPipelines() {
|
||||
|
@ -199,10 +199,10 @@ public class RouterWebServices implements RMWebServiceProtocol {
|
|||
}
|
||||
|
||||
/**
|
||||
* This method creates and returns reference of the first intercepter in the
|
||||
* chain of request intercepter instances.
|
||||
* This method creates and returns reference of the first interceptor in the
|
||||
* chain of request interceptor instances.
|
||||
*
|
||||
* @return the reference of the first intercepter in the chain
|
||||
* @return the reference of the first interceptor in the chain
|
||||
*/
|
||||
@VisibleForTesting
|
||||
protected RESTRequestInterceptor createRequestInterceptorChain() {
|
||||
|
@ -247,7 +247,7 @@ public class RouterWebServices implements RMWebServiceProtocol {
|
|||
}
|
||||
|
||||
/**
|
||||
* Initializes the request intercepter pipeline for the specified user.
|
||||
* Initializes the request interceptor pipeline for the specified user.
|
||||
*
|
||||
* @param user
|
||||
*/
|
||||
|
@ -298,9 +298,9 @@ public class RouterWebServices implements RMWebServiceProtocol {
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the root request intercepter.
|
||||
* Gets the root request interceptor.
|
||||
*
|
||||
* @return the root request intercepter
|
||||
* @return the root request interceptor
|
||||
*/
|
||||
public synchronized RESTRequestInterceptor getRootInterceptor() {
|
||||
return rootInterceptor;
|
||||
|
|
|
@ -134,7 +134,7 @@ public abstract class BaseRouterClientRMTest {
|
|||
String mockPassThroughInterceptorClass =
|
||||
PassThroughClientRequestInterceptor.class.getName();
|
||||
|
||||
// Create a request intercepter pipeline for testing. The last one in the
|
||||
// Create a request interceptor pipeline for testing. The last one in the
|
||||
// chain will call the mock resource manager. The others in the chain will
|
||||
// simply forward it to the next one in the chain
|
||||
config.set(YarnConfiguration.ROUTER_CLIENTRM_INTERCEPTOR_CLASS_PIPELINE,
|
||||
|
|
|
@ -93,8 +93,8 @@ import org.apache.hadoop.yarn.api.protocolrecords.UpdateApplicationTimeoutsRespo
|
|||
import org.apache.hadoop.yarn.exceptions.YarnException;
|
||||
|
||||
/**
|
||||
* Mock intercepter that does not do anything other than forwarding it to the
|
||||
* next intercepter in the chain.
|
||||
* Mock interceptor that does not do anything other than forwarding it to the
|
||||
* next interceptor in the chain.
|
||||
*/
|
||||
public class PassThroughClientRequestInterceptor
|
||||
extends AbstractClientRequestInterceptor {
|
||||
|
|
|
@ -121,7 +121,7 @@ import org.slf4j.LoggerFactory;
|
|||
* use the {@code RouterClientRMService} pipeline test cases for testing the
|
||||
* {@code FederationInterceptor} class. The tests for
|
||||
* {@code RouterClientRMService} has been written cleverly so that it can be
|
||||
* reused to validate different request intercepter chains.
|
||||
* reused to validate different request interceptor chains.
|
||||
*/
|
||||
public class TestFederationClientInterceptor extends BaseRouterClientRMTest {
|
||||
private static final Logger LOG =
|
||||
|
@ -180,8 +180,8 @@ public class TestFederationClientInterceptor extends BaseRouterClientRMTest {
|
|||
String mockPassThroughInterceptorClass =
|
||||
PassThroughClientRequestInterceptor.class.getName();
|
||||
|
||||
// Create a request intercepter pipeline for testing. The last one in the
|
||||
// chain is the federation intercepter that calls the mock resource manager.
|
||||
// Create a request interceptor pipeline for testing. The last one in the
|
||||
// chain is the federation interceptor that calls the mock resource manager.
|
||||
// The others in the chain will simply forward it to the next one in the
|
||||
// chain
|
||||
conf.set(YarnConfiguration.ROUTER_CLIENTRM_INTERCEPTOR_CLASS_PIPELINE,
|
||||
|
|
|
@ -54,7 +54,7 @@ import org.slf4j.LoggerFactory;
|
|||
* use the {@code RouterClientRMService} pipeline test cases for testing the
|
||||
* {@code FederationInterceptor} class. The tests for
|
||||
* {@code RouterClientRMService} has been written cleverly so that it can be
|
||||
* reused to validate different request intercepter chains.
|
||||
* reused to validate different request interceptor chains.
|
||||
*
|
||||
* It tests the case with SubClusters down and the Router logic of retries. We
|
||||
* have 1 good SubCluster and 2 bad ones for all the tests.
|
||||
|
@ -137,8 +137,8 @@ public class TestFederationClientInterceptorRetry
|
|||
String mockPassThroughInterceptorClass =
|
||||
PassThroughClientRequestInterceptor.class.getName();
|
||||
|
||||
// Create a request intercepter pipeline for testing. The last one in the
|
||||
// chain is the federation intercepter that calls the mock resource manager.
|
||||
// Create a request interceptor pipeline for testing. The last one in the
|
||||
// chain is the federation interceptor that calls the mock resource manager.
|
||||
// The others in the chain will simply forward it to the next one in the
|
||||
// chain
|
||||
conf.set(YarnConfiguration.ROUTER_CLIENTRM_INTERCEPTOR_CLASS_PIPELINE,
|
||||
|
|
|
@ -424,7 +424,7 @@ public class TestRouterYarnClientUtils {
|
|||
GetQueueUserAclsInfoResponse response3 = Records.newRecord(
|
||||
GetQueueUserAclsInfoResponse.class);
|
||||
|
||||
// null responce
|
||||
// null response
|
||||
GetQueueUserAclsInfoResponse response4 = null;
|
||||
|
||||
List<GetQueueUserAclsInfoResponse> responses = new ArrayList<>();
|
||||
|
|
|
@ -91,7 +91,7 @@ public abstract class BaseRouterRMAdminTest {
|
|||
String mockPassThroughInterceptorClass =
|
||||
PassThroughRMAdminRequestInterceptor.class.getName();
|
||||
|
||||
// Create a request intercepter pipeline for testing. The last one in the
|
||||
// Create a request interceptor pipeline for testing. The last one in the
|
||||
// chain will call the mock resource manager. The others in the chain will
|
||||
// simply forward it to the next one in the chain
|
||||
this.conf.set(YarnConfiguration.ROUTER_RMADMIN_INTERCEPTOR_CLASS_PIPELINE,
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.apache.hadoop.yarn.server.resourcemanager.AdminService;
|
|||
import org.apache.hadoop.yarn.server.resourcemanager.MockRM;
|
||||
|
||||
/**
|
||||
* This class mocks the RMAmdinRequestInterceptor.
|
||||
* This class mocks the RMAdminRequestInterceptor.
|
||||
*/
|
||||
public class MockRMAdminRequestInterceptor
|
||||
extends DefaultRMAdminRequestInterceptor {
|
||||
|
|
|
@ -52,8 +52,8 @@ import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceReque
|
|||
import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceResponse;
|
||||
|
||||
/**
|
||||
* Mock intercepter that does not do anything other than forwarding it to the
|
||||
* next intercepter in the chain.
|
||||
* Mock interceptor that does not do anything other than forwarding it to the
|
||||
* next interceptor in the chain.
|
||||
*/
|
||||
public class PassThroughRMAdminRequestInterceptor
|
||||
extends AbstractRMAdminRequestInterceptor {
|
||||
|
|
|
@ -94,7 +94,7 @@ public abstract class BaseRouterWebServicesTest {
|
|||
String mockPassThroughInterceptorClass =
|
||||
PassThroughRESTRequestInterceptor.class.getName();
|
||||
|
||||
// Create a request intercepter pipeline for testing. The last one in the
|
||||
// Create a request interceptor pipeline for testing. The last one in the
|
||||
// chain will call the mock resource manager. The others in the chain will
|
||||
// simply forward it to the next one in the chain
|
||||
config.set(YarnConfiguration.ROUTER_WEBAPP_INTERCEPTOR_CLASS_PIPELINE,
|
||||
|
|
|
@ -34,15 +34,15 @@ public class JavaProcess {
|
|||
this(clazz, null, output);
|
||||
}
|
||||
|
||||
public JavaProcess(Class<?> clazz, List<String> addClasspaths, File output)
|
||||
public JavaProcess(Class<?> clazz, List<String> addClassPaths, File output)
|
||||
throws IOException, InterruptedException {
|
||||
String javaHome = System.getProperty("java.home");
|
||||
String javaBin =
|
||||
javaHome + File.separator + "bin" + File.separator + "java";
|
||||
String classpath = System.getProperty("java.class.path");
|
||||
classpath = classpath.concat("./src/test/resources");
|
||||
if (addClasspaths != null) {
|
||||
for (String addClasspath : addClasspaths) {
|
||||
if (addClassPaths != null) {
|
||||
for (String addClasspath : addClassPaths) {
|
||||
classpath = classpath.concat(File.pathSeparatorChar + addClasspath);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,8 +62,8 @@ import org.apache.hadoop.yarn.server.webapp.dao.ContainerInfo;
|
|||
import org.apache.hadoop.yarn.server.webapp.dao.ContainersInfo;
|
||||
|
||||
/**
|
||||
* Mock intercepter that does not do anything other than forwarding it to the
|
||||
* next intercepter in the chain.
|
||||
* Mock interceptor that does not do anything other than forwarding it to the
|
||||
* next interceptor in the chain.
|
||||
*/
|
||||
public class PassThroughRESTRequestInterceptor
|
||||
extends AbstractRESTRequestInterceptor {
|
||||
|
|
|
@ -61,7 +61,7 @@ import org.slf4j.LoggerFactory;
|
|||
* use the {@code RouterClientRMService} pipeline test cases for testing the
|
||||
* {@code FederationInterceptor} class. The tests for
|
||||
* {@code RouterClientRMService} has been written cleverly so that it can be
|
||||
* reused to validate different request intercepter chains.
|
||||
* reused to validate different request interceptor chains.
|
||||
*/
|
||||
public class TestFederationInterceptorREST extends BaseRouterWebServicesTest {
|
||||
private static final Logger LOG =
|
||||
|
@ -119,8 +119,8 @@ public class TestFederationInterceptorREST extends BaseRouterWebServicesTest {
|
|||
String mockPassThroughInterceptorClass =
|
||||
PassThroughRESTRequestInterceptor.class.getName();
|
||||
|
||||
// Create a request intercepter pipeline for testing. The last one in the
|
||||
// chain is the federation intercepter that calls the mock resource manager.
|
||||
// Create a request interceptor pipeline for testing. The last one in the
|
||||
// chain is the federation interceptor that calls the mock resource manager.
|
||||
// The others in the chain will simply forward it to the next one in the
|
||||
// chain
|
||||
conf.set(YarnConfiguration.ROUTER_CLIENTRM_INTERCEPTOR_CLASS_PIPELINE,
|
||||
|
@ -239,7 +239,7 @@ public class TestFederationInterceptorREST extends BaseRouterWebServicesTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* This test validates the correctness of SubmitApplication in case of of
|
||||
* This test validates the correctness of SubmitApplication in case of
|
||||
* application in wrong format.
|
||||
*/
|
||||
@Test
|
||||
|
|
|
@ -139,8 +139,8 @@ public class TestFederationInterceptorRESTRetry
|
|||
String mockPassThroughInterceptorClass =
|
||||
PassThroughClientRequestInterceptor.class.getName();
|
||||
|
||||
// Create a request intercepter pipeline for testing. The last one in the
|
||||
// chain is the federation intercepter that calls the mock resource manager.
|
||||
// Create a request interceptor pipeline for testing. The last one in the
|
||||
// chain is the federation interceptor that calls the mock resource manager.
|
||||
// The others in the chain will simply forward it to the next one in the
|
||||
// chain
|
||||
conf.set(YarnConfiguration.ROUTER_CLIENTRM_INTERCEPTOR_CLASS_PIPELINE,
|
||||
|
|
Loading…
Reference in New Issue