java.lang.Object
org.apache.hadoop.yarn.server.globalpolicygenerator.GPGUtils

public final class GPGUtils extends Object
GPGUtils contains utility functions for the GPG.
  • Method Summary

    Modifier and Type
    Method
    Description
    static javax.ws.rs.client.Client
    createJerseyClient(org.apache.hadoop.conf.Configuration conf)
    Create JerseyClient based on configuration file.
    static Map<org.apache.hadoop.yarn.server.federation.store.records.SubClusterIdInfo,Float>
    createUniformWeights(Set<org.apache.hadoop.yarn.server.federation.store.records.SubClusterId> ids)
    Creates a uniform weighting of 1.0 for each sub cluster.
    static <T> T
    invokeRMWebService(String webAddr, String path, Class<T> returnType, org.apache.hadoop.conf.Configuration config)
    Performs an invocation of the remote RMWebService.
    static <T> T
    invokeRMWebService(String webAddr, String path, Class<T> returnType, org.apache.hadoop.conf.Configuration conf, String selectParam)
    Performs an invocation of the remote RMWebService.

    Methods inherited from class java.lang.Object

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

    • invokeRMWebService

      public static <T> T invokeRMWebService(String webAddr, String path, Class<T> returnType, org.apache.hadoop.conf.Configuration conf, String selectParam)
      Performs an invocation of the remote RMWebService.
      Type Parameters:
      T - Generic T.
      Parameters:
      webAddr - WebAddress.
      path - url path.
      returnType - return type.
      selectParam - query parameters.
      conf - configuration.
      Returns:
      response entity.
    • invokeRMWebService

      public static <T> T invokeRMWebService(String webAddr, String path, Class<T> returnType, org.apache.hadoop.conf.Configuration config)
      Performs an invocation of the remote RMWebService.
      Type Parameters:
      T - Generic T.
      Parameters:
      webAddr - WebAddress.
      path - url path.
      returnType - return type.
      config - configuration.
      Returns:
      response entity.
    • createUniformWeights

      public static Map<org.apache.hadoop.yarn.server.federation.store.records.SubClusterIdInfo,Float> createUniformWeights(Set<org.apache.hadoop.yarn.server.federation.store.records.SubClusterId> ids)
      Creates a uniform weighting of 1.0 for each sub cluster.
      Parameters:
      ids - subClusterId set
      Returns:
      weight of subCluster.
    • createJerseyClient

      public static javax.ws.rs.client.Client createJerseyClient(org.apache.hadoop.conf.Configuration conf)
      Create JerseyClient based on configuration file. We will set the timeout when creating JerseyClient.
      Parameters:
      conf - Configuration.
      Returns:
      Jersey Client.