Class GPGUtils
java.lang.Object
org.apache.hadoop.yarn.server.globalpolicygenerator.GPGUtils
GPGUtils contains utility functions for the GPG.
-
Method Summary
Modifier and TypeMethodDescriptionstatic javax.ws.rs.client.ClientcreateJerseyClient(org.apache.hadoop.conf.Configuration conf) Create JerseyClient based on configuration file.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> TinvokeRMWebService(String webAddr, String path, Class<T> returnType, org.apache.hadoop.conf.Configuration config) Performs an invocation of the remote RMWebService.static <T> TinvokeRMWebService(String webAddr, String path, Class<T> returnType, org.apache.hadoop.conf.Configuration conf, String selectParam) Performs an invocation of the remote RMWebService.
-
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.
-