public class RMServerUtils extends Object
Modifier and Type | Field and Description |
---|---|
static org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport |
DUMMY_APPLICATION_RESOURCE_USAGE_REPORT
Statically defined dummy ApplicationResourceUsageREport.
|
protected static org.apache.hadoop.yarn.factories.RecordFactory |
RECORD_FACTORY |
Constructor and Description |
---|
RMServerUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
checkSchedContainerChangeRequest(SchedContainerChangeRequest request,
boolean increase)
Validate increase/decrease request.
|
static org.apache.hadoop.yarn.api.records.YarnApplicationAttemptState |
createApplicationAttemptState(RMAppAttemptState rmAppAttemptState) |
static org.apache.hadoop.yarn.api.records.YarnApplicationState |
createApplicationState(RMAppState rmAppState) |
static void |
normalizeAndValidateRequests(List<org.apache.hadoop.yarn.api.records.ResourceRequest> ask,
org.apache.hadoop.yarn.api.records.Resource maximumResource,
String queueName,
YarnScheduler scheduler,
RMContext rmContext)
Utility method to validate a list resource requests, by insuring that the
requested memory/vcore is non-negative and not greater than max
|
static void |
processRMProxyUsersConf(org.apache.hadoop.conf.Configuration conf)
Find all configs whose name starts with
YarnConfiguration.RM_PROXY_USER_PREFIX, and add a record for each one by
replacing the prefix with ProxyUsers.CONF_HADOOP_PROXYUSER
|
static List<RMNode> |
queryRMNodes(RMContext context,
EnumSet<org.apache.hadoop.yarn.api.records.NodeState> acceptedStates) |
static List<org.apache.hadoop.yarn.api.records.UpdateContainerError> |
validateAndSplitUpdateResourceRequests(RMContext rmContext,
org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request,
org.apache.hadoop.yarn.api.records.Resource maximumAllocation,
List<org.apache.hadoop.yarn.api.records.UpdateContainerRequest> increaseResourceReqs,
List<org.apache.hadoop.yarn.api.records.UpdateContainerRequest> decreaseResourceReqs)
Check if we have:
- Request for same containerId and different target resource
- If targetResources violates maximum/minimumAllocation
|
static void |
validateBlacklistRequest(org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest blacklistRequest) |
static void |
validateContainerReleaseRequest(List<org.apache.hadoop.yarn.api.records.ContainerId> containerReleaseList,
org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
It will validate to make sure all the containers belong to correct
application attempt id.
|
static org.apache.hadoop.security.UserGroupInformation |
verifyAdminAccess(org.apache.hadoop.yarn.security.YarnAuthorizationProvider authorizer,
String method,
org.apache.commons.logging.Log LOG) |
static org.apache.hadoop.security.UserGroupInformation |
verifyAdminAccess(org.apache.hadoop.yarn.security.YarnAuthorizationProvider authorizer,
String method,
String module,
org.apache.commons.logging.Log LOG)
Utility method to verify if the current user has access based on the
passed
AccessControlList |
protected static final org.apache.hadoop.yarn.factories.RecordFactory RECORD_FACTORY
public static final org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport DUMMY_APPLICATION_RESOURCE_USAGE_REPORT
public static List<RMNode> queryRMNodes(RMContext context, EnumSet<org.apache.hadoop.yarn.api.records.NodeState> acceptedStates)
public static List<org.apache.hadoop.yarn.api.records.UpdateContainerError> validateAndSplitUpdateResourceRequests(RMContext rmContext, org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request, org.apache.hadoop.yarn.api.records.Resource maximumAllocation, List<org.apache.hadoop.yarn.api.records.UpdateContainerRequest> increaseResourceReqs, List<org.apache.hadoop.yarn.api.records.UpdateContainerRequest> decreaseResourceReqs)
rmContext
- RM contextrequest
- Allocate RequestmaximumAllocation
- Maximum AllocationincreaseResourceReqs
- Increase Resource RequestdecreaseResourceReqs
- Decrease Resource Requestpublic static void normalizeAndValidateRequests(List<org.apache.hadoop.yarn.api.records.ResourceRequest> ask, org.apache.hadoop.yarn.api.records.Resource maximumResource, String queueName, YarnScheduler scheduler, RMContext rmContext) throws org.apache.hadoop.yarn.exceptions.InvalidResourceRequestException
org.apache.hadoop.yarn.exceptions.InvalidResourceRequestException
public static void checkSchedContainerChangeRequest(SchedContainerChangeRequest request, boolean increase) throws org.apache.hadoop.yarn.exceptions.InvalidResourceRequestException
- Throw exception when any other error happens
org.apache.hadoop.yarn.exceptions.InvalidResourceRequestException
public static void validateBlacklistRequest(org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest blacklistRequest) throws org.apache.hadoop.yarn.exceptions.InvalidResourceBlacklistRequestException
org.apache.hadoop.yarn.exceptions.InvalidResourceBlacklistRequestException
public static void validateContainerReleaseRequest(List<org.apache.hadoop.yarn.api.records.ContainerId> containerReleaseList, org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId) throws org.apache.hadoop.yarn.exceptions.InvalidContainerReleaseException
InvalidContainerReleaseException
containerReleaseList
- containers to be released as requested by
application master.appAttemptId
- Application attempt Idorg.apache.hadoop.yarn.exceptions.InvalidContainerReleaseException
public static org.apache.hadoop.security.UserGroupInformation verifyAdminAccess(org.apache.hadoop.yarn.security.YarnAuthorizationProvider authorizer, String method, org.apache.commons.logging.Log LOG) throws IOException
IOException
public static org.apache.hadoop.security.UserGroupInformation verifyAdminAccess(org.apache.hadoop.yarn.security.YarnAuthorizationProvider authorizer, String method, String module, org.apache.commons.logging.Log LOG) throws IOException
AccessControlList
authorizer
- the AccessControlList
to check againstmethod
- the method name to be loggedmodule
- like AdminService or NodeLabelManagerLOG
- the logger to useUserGroupInformation
of the current userIOException
public static org.apache.hadoop.yarn.api.records.YarnApplicationState createApplicationState(RMAppState rmAppState)
public static org.apache.hadoop.yarn.api.records.YarnApplicationAttemptState createApplicationAttemptState(RMAppAttemptState rmAppAttemptState)
public static void processRMProxyUsersConf(org.apache.hadoop.conf.Configuration conf)
Copyright © 2017 Apache Software Foundation. All Rights Reserved.