Class FederationRegistryClient
java.lang.Object
org.apache.hadoop.yarn.server.federation.utils.FederationRegistryClient
Helper class that handles reads and writes to Yarn Registry to support UAM HA
and second attempt.
-
Constructor Summary
ConstructorsConstructorDescriptionFederationRegistryClient(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.registry.client.api.RegistryOperations registry, org.apache.hadoop.security.UserGroupInformation user) -
Method Summary
Modifier and TypeMethodDescriptionvoidFor testing, delete all application records in registry.Get the list of known applications in the registry.Map<String,org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier>> loadStateFromRegistry(org.apache.hadoop.yarn.api.records.ApplicationId appId) Load the information of one application from registry.voidremoveAppFromRegistry(org.apache.hadoop.yarn.api.records.ApplicationId appId) Remove an application from registry.voidremoveAppFromRegistry(org.apache.hadoop.yarn.api.records.ApplicationId appId, boolean ignoreMemoryState) Remove an application from registry.booleanwriteAMRMTokenForUAM(org.apache.hadoop.yarn.api.records.ApplicationId appId, String subClusterId, org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> token) Write/update the UAM token for an application and a sub-cluster.
-
Constructor Details
-
FederationRegistryClient
public FederationRegistryClient(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.registry.client.api.RegistryOperations registry, org.apache.hadoop.security.UserGroupInformation user)
-
-
Method Details
-
getAllApplications
Get the list of known applications in the registry.- Returns:
- the list of known applications
-
cleanAllApplications
@VisibleForTesting public void cleanAllApplications()For testing, delete all application records in registry. -
writeAMRMTokenForUAM
public boolean writeAMRMTokenForUAM(org.apache.hadoop.yarn.api.records.ApplicationId appId, String subClusterId, org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> token) Write/update the UAM token for an application and a sub-cluster.- Parameters:
appId- ApplicationId.subClusterId- sub-cluster id of the tokentoken- the UAM of the application- Returns:
- whether the amrmToken is added or updated to a new value
-
loadStateFromRegistry
public Map<String,org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier>> loadStateFromRegistry(org.apache.hadoop.yarn.api.records.ApplicationId appId) Load the information of one application from registry.- Parameters:
appId- application id- Returns:
- the sub-cluster to UAM token mapping
-
removeAppFromRegistry
public void removeAppFromRegistry(org.apache.hadoop.yarn.api.records.ApplicationId appId) Remove an application from registry.- Parameters:
appId- application id.
-
removeAppFromRegistry
public void removeAppFromRegistry(org.apache.hadoop.yarn.api.records.ApplicationId appId, boolean ignoreMemoryState) Remove an application from registry.- Parameters:
appId- application idignoreMemoryState- whether to ignore the memory data in terms of known application
-