Package org.apache.hadoop.hdfs
Class HAUtilClient
java.lang.Object
org.apache.hadoop.hdfs.HAUtilClient
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.hadoop.io.TextbuildTokenServiceForLogicalUri(URI uri, String scheme) Get the service name used in the delegation token for the given logical HA service.static Stringstatic voidcloneDelegationTokenForLogicalUri(org.apache.hadoop.security.UserGroupInformation ugi, URI haUri, Collection<InetSocketAddress> nnAddrs) Locate a delegation token associated with the given HA cluster URI, and if one is found, clone it to also represent the underlying namenode address.static URIgetServiceUriFromToken(String scheme, org.apache.hadoop.security.token.Token<?> token) Parse the file system URI out of the provided token.static booleanisClientFailoverConfigured(org.apache.hadoop.conf.Configuration conf, URI nameNodeUri) Check whether the client has a failover proxy provider configured for the namenode/nameservice.static booleanisLogicalUri(org.apache.hadoop.conf.Configuration conf, URI nameNodeUri) static booleanisTokenForLogicalUri(org.apache.hadoop.security.token.Token<?> token)
-
Constructor Details
-
HAUtilClient
public HAUtilClient()
-
-
Method Details
-
isLogicalUri
- Returns:
- true if the given nameNodeUri appears to be a logical URI.
-
isClientFailoverConfigured
public static boolean isClientFailoverConfigured(org.apache.hadoop.conf.Configuration conf, URI nameNodeUri) Check whether the client has a failover proxy provider configured for the namenode/nameservice.- Parameters:
conf- ConfigurationnameNodeUri- The URI of namenode- Returns:
- true if failover is configured.
-
buildTokenServiceForLogicalUri
Get the service name used in the delegation token for the given logical HA service.- Parameters:
uri- the logical URI of the clusterscheme- the scheme of the corresponding FileSystem- Returns:
- the service name
-
buildTokenServicePrefixForLogicalUri
-
getServiceUriFromToken
public static URI getServiceUriFromToken(String scheme, org.apache.hadoop.security.token.Token<?> token) Parse the file system URI out of the provided token. -
isTokenForLogicalUri
public static boolean isTokenForLogicalUri(org.apache.hadoop.security.token.Token<?> token) - Returns:
- true if this token corresponds to a logical nameservice rather than a specific namenode.
-
cloneDelegationTokenForLogicalUri
public static void cloneDelegationTokenForLogicalUri(org.apache.hadoop.security.UserGroupInformation ugi, URI haUri, Collection<InetSocketAddress> nnAddrs) Locate a delegation token associated with the given HA cluster URI, and if one is found, clone it to also represent the underlying namenode address.- Parameters:
ugi- the UGI to modifyhaUri- the logical URI for the clusternnAddrs- collection of NNs in the cluster to which the token applies
-