public class GcsDelegationTokens
extends org.apache.hadoop.service.AbstractService
Constructor and Description |
---|
GcsDelegationTokens() |
Modifier and Type | Method and Description |
---|---|
void |
bindToAnyDelegationToken()
Attempt to bind to any existing DT, including unmarshalling its contents and creating the GCP
credential provider used to authenticate the client.
|
void |
bindToDelegationToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> token)
Bind to a delegation token retrieved for this filesystem.
|
void |
bindToFileSystem(GoogleHadoopFileSystemBase fs,
org.apache.hadoop.io.Text service)
Bind to the filesystem.
|
AccessTokenProvider |
deployUnbonded()
Perform the unbonded deployment operations.
|
static org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier |
extractIdentifier(org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> token)
From a token, get the session token identifier.
|
AccessTokenProvider |
getAccessTokenProvider() |
org.apache.hadoop.security.token.Token<org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> |
getBoundDT()
Get any bound DT.
|
org.apache.hadoop.security.token.Token<org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> |
getBoundOrNewDT(String renewer)
Get any bound DT or create a new one.
|
org.apache.hadoop.io.Text |
getService() |
boolean |
isBoundToDT()
Predicate: is there a bound DT?
|
org.apache.hadoop.security.token.Token<org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> |
selectTokenFromFsOwner()
Find a token for the FS user and service name.
|
void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
protected void |
serviceStart() |
protected void |
serviceStop() |
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
public GcsDelegationTokens() throws IOException
IOException
public void serviceInit(org.apache.hadoop.conf.Configuration conf) throws Exception
serviceInit
in class org.apache.hadoop.service.AbstractService
Exception
protected void serviceStart() throws Exception
serviceStart
in class org.apache.hadoop.service.AbstractService
Exception
protected void serviceStop() throws Exception
serviceStop
in class org.apache.hadoop.service.AbstractService
Exception
public org.apache.hadoop.io.Text getService()
public AccessTokenProvider getAccessTokenProvider()
public AccessTokenProvider deployUnbonded() throws IOException
accessTokenProvider
IOException
- any failure.public void bindToAnyDelegationToken() throws IOException
If successful:
boundDT
is set to the retrieved token.
accessTokenProvider
is set to the credential provider(s) returned by the token
binding.
deployUnbonded()
is called for the unbonded codepath instead, which
will set accessTokenProvider
to its value.
This means after this call (and only after) the token operations can be invoked.
IOException
- selection/extraction/validation failure.public org.apache.hadoop.security.token.Token<org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> selectTokenFromFsOwner() throws IOException
IOException
- on a failure to unmarshall the token.public void bindToFileSystem(GoogleHadoopFileSystemBase fs, org.apache.hadoop.io.Text service) throws IOException
init()
.
Important: This binding will happen during FileSystem.initialize(); the FS is not live for actual use and will not yet have interacted with GCS services.
fs
- owning FS.IOException
- failure.public void bindToDelegationToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> token) throws IOException
boundDT
is set to token
.
accessTokenProvider
is set to the credential provider(s) returned by the token
binding.
token
- token to decode and bind to.IOException
- selection/extraction/validation failure.public boolean isBoundToDT()
boundDT
.public org.apache.hadoop.security.token.Token<org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> getBoundDT()
public org.apache.hadoop.security.token.Token<org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> getBoundOrNewDT(String renewer) throws IOException
IOException
- if one cannot be createdpublic static org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier extractIdentifier(org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> token) throws IOException
token
- token to processIOException
- failure to validate/read data encoded in identifier.IllegalArgumentException
- if the token isn't an GCP session tokenCopyright © 2021. All rights reserved.