Class ConverterUtils

java.lang.Object
org.apache.hadoop.yarn.util.ConverterUtils

@Public public class ConverterUtils extends Object
This class contains a set of utilities which help converting data structures from/to 'serializableFormat' to/from hadoop/nativejava data structures.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends org.apache.hadoop.security.token.TokenIdentifier>
    org.apache.hadoop.security.token.Token<T>
    convertFromYarn(org.apache.hadoop.yarn.api.records.Token protoToken, InetSocketAddress serviceAddr)
    Convert a protobuf token into a rpc token and set its service.
    static <T extends org.apache.hadoop.security.token.TokenIdentifier>
    org.apache.hadoop.security.token.Token<T>
    convertFromYarn(org.apache.hadoop.yarn.api.records.Token protoToken, org.apache.hadoop.io.Text service)
    Convert a protobuf token into a rpc token and set its service.
    static org.apache.hadoop.fs.Path
    getPathFromYarnURL(org.apache.hadoop.yarn.api.records.URL url)
    Deprecated.
    static org.apache.hadoop.yarn.api.records.URL
    getYarnUrlFromPath(org.apache.hadoop.fs.Path path)
    Deprecated.
    static org.apache.hadoop.yarn.api.records.URL
    Deprecated.
    static org.apache.hadoop.yarn.api.records.ApplicationAttemptId
    toApplicationAttemptId(String applicationAttemptIdStr)
    Deprecated.
    static org.apache.hadoop.yarn.api.records.ApplicationId
    Deprecated.
    static org.apache.hadoop.yarn.api.records.ApplicationId
    toApplicationId(org.apache.hadoop.yarn.factories.RecordFactory recordFactory, String applicationIdStr)
    Deprecated.
    static org.apache.hadoop.yarn.api.records.ContainerId
    toContainerId(String containerIdStr)
    Deprecated.
    static org.apache.hadoop.yarn.api.records.NodeId
    toNodeId(String nodeIdStr)
    Deprecated.
    static org.apache.hadoop.yarn.api.records.NodeId
     
    static String
    toString(org.apache.hadoop.yarn.api.records.ApplicationId appId)
    Deprecated.
    static String
    toString(org.apache.hadoop.yarn.api.records.ContainerId cId)
    Deprecated.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ConverterUtils

      public ConverterUtils()
  • Method Details

    • getPathFromYarnURL

      @Public @Deprecated public static org.apache.hadoop.fs.Path getPathFromYarnURL(org.apache.hadoop.yarn.api.records.URL url) throws URISyntaxException
      Deprecated.
      return a hadoop path from a given url This method is deprecated, use URL.toPath() instead.
      Parameters:
      url - url to convert
      Returns:
      path from URL
      Throws:
      URISyntaxException - exception thrown to indicate that a string could not be parsed as a URI reference.
    • getYarnUrlFromPath

      @Public @Deprecated public static org.apache.hadoop.yarn.api.records.URL getYarnUrlFromPath(org.apache.hadoop.fs.Path path)
      Deprecated.
    • getYarnUrlFromURI

      @Public @Deprecated public static org.apache.hadoop.yarn.api.records.URL getYarnUrlFromURI(URI uri)
      Deprecated.
    • toString

      @Public @Deprecated public static String toString(org.apache.hadoop.yarn.api.records.ApplicationId appId)
      Deprecated.
    • toApplicationId

      @Public @Deprecated public static org.apache.hadoop.yarn.api.records.ApplicationId toApplicationId(org.apache.hadoop.yarn.factories.RecordFactory recordFactory, String applicationIdStr)
      Deprecated.
    • toString

      @Public @Deprecated public static String toString(org.apache.hadoop.yarn.api.records.ContainerId cId)
      Deprecated.
    • toNodeIdWithDefaultPort

      @Private @Unstable public static org.apache.hadoop.yarn.api.records.NodeId toNodeIdWithDefaultPort(String nodeIdStr)
    • toNodeId

      @Public @Deprecated public static org.apache.hadoop.yarn.api.records.NodeId toNodeId(String nodeIdStr)
      Deprecated.
    • toContainerId

      @Public @Deprecated public static org.apache.hadoop.yarn.api.records.ContainerId toContainerId(String containerIdStr)
      Deprecated.
    • toApplicationAttemptId

      @Public @Deprecated public static org.apache.hadoop.yarn.api.records.ApplicationAttemptId toApplicationAttemptId(String applicationAttemptIdStr)
      Deprecated.
    • toApplicationId

      @Public @Deprecated public static org.apache.hadoop.yarn.api.records.ApplicationId toApplicationId(String appIdStr)
      Deprecated.
    • convertFromYarn

      public static <T extends org.apache.hadoop.security.token.TokenIdentifier> org.apache.hadoop.security.token.Token<T> convertFromYarn(org.apache.hadoop.yarn.api.records.Token protoToken, InetSocketAddress serviceAddr)
      Convert a protobuf token into a rpc token and set its service. Supposed to be used for tokens other than RMDelegationToken. For RMDelegationToken, use convertFromYarn(org.apache.hadoop.yarn.api.records.Token, org.apache.hadoop.io.Text) instead.
      Type Parameters:
      T - Generic Type T.
      Parameters:
      protoToken - the yarn token
      serviceAddr - the connect address for the service
      Returns:
      rpc token
    • convertFromYarn

      public static <T extends org.apache.hadoop.security.token.TokenIdentifier> org.apache.hadoop.security.token.Token<T> convertFromYarn(org.apache.hadoop.yarn.api.records.Token protoToken, org.apache.hadoop.io.Text service)
      Convert a protobuf token into a rpc token and set its service.
      Type Parameters:
      T - Generic Type T.
      Parameters:
      protoToken - the yarn token
      service - the service for the token
      Returns:
      rpc token