Class AMRMClientUtils

java.lang.Object
org.apache.hadoop.yarn.client.AMRMClientUtils

@Private public final class AMRMClientUtils extends Object
Utility class for AMRMClient.
  • Field Details

  • Method Details

    • createRMProxy

      @Public @Unstable public static <T> T createRMProxy(org.apache.hadoop.conf.Configuration configuration, Class<T> protocol, org.apache.hadoop.security.UserGroupInformation user, org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token) throws IOException
      Create a proxy for the specified protocol.
      Type Parameters:
      T - Type information of the proxy
      Parameters:
      configuration - Configuration to generate ClientRMProxy
      protocol - Protocol for the proxy
      user - the user on whose behalf the proxy is being created
      token - the auth token to use for connection
      Returns:
      Proxy to the RM
      Throws:
      IOException - on failure
    • assembleInvalidResponseIdExceptionMessage

      public static String assembleInvalidResponseIdExceptionMessage(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, int expected, int received)
      Generate the exception message when RM receives an AM heartbeat with invalid responseId.
      Parameters:
      appAttemptId - the app attempt
      expected - the expected responseId value
      received - the received responseId value
      Returns:
      the assembled exception message
    • parseExpectedResponseIdFromException

      public static int parseExpectedResponseIdFromException(String exceptionMessage)
      Parse the expected responseId from the exception generated by RM when processing AM heartbeat.
      Parameters:
      exceptionMessage - the exception message thrown by RM
      Returns:
      the parsed expected responseId, -1 if failed
    • getNextResponseId

      public static int getNextResponseId(int responseId)
    • addToOutstandingSchedulingRequests

      public static void addToOutstandingSchedulingRequests(Collection<org.apache.hadoop.yarn.api.records.SchedulingRequest> requests, Map<Set<String>,List<org.apache.hadoop.yarn.api.records.SchedulingRequest>> outstandingSchedRequests)
    • isMatchingSchedulingRequests

      public static boolean isMatchingSchedulingRequests(org.apache.hadoop.yarn.api.records.SchedulingRequest schedReq1, org.apache.hadoop.yarn.api.records.SchedulingRequest schedReq2)
    • removeFromOutstandingSchedulingRequests

      public static void removeFromOutstandingSchedulingRequests(Collection<org.apache.hadoop.yarn.api.records.Container> containers, Map<Set<String>,List<org.apache.hadoop.yarn.api.records.SchedulingRequest>> outstandingSchedRequests)