Package org.apache.drill.exec.store.dfs
Class OAuthEnabledFileSystem
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.fs.FileSystem
org.apache.drill.exec.store.dfs.OAuthEnabledFileSystem
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.hadoop.conf.Configurable
,org.apache.hadoop.fs.PathCapabilities
,org.apache.hadoop.security.token.DelegationTokenIssuer
- Direct Known Subclasses:
BoxFileSystem
,DropboxFileSystem
public abstract class OAuthEnabledFileSystem
extends org.apache.hadoop.fs.FileSystem
This class enables Drill to access file systems which use OAuth 2.0 for
authorization. The class contains methods to interact with Drill's token management
which makes use of a persistent store for the access and refresh tokens.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.fs.FileSystem
org.apache.hadoop.fs.FileSystem.DirectoryEntries, org.apache.hadoop.fs.FileSystem.DirListingIterator<T extends org.apache.hadoop.fs.FileStatus>, org.apache.hadoop.fs.FileSystem.Statistics
-
Field Summary
Fields inherited from class org.apache.hadoop.fs.FileSystem
DEFAULT_FS, FS_DEFAULT_NAME_KEY, LOG, SHUTDOWN_HOOK_PRIORITY, statistics, TRASH_PREFIX, USER_HOME_PREFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
setoAuthConfig
(OAuthConfig oAuthConfig) void
setPluginConfig
(StoragePluginConfig pluginConfig) void
setTokenTable
(PersistentTokenTable tokenTable) void
updateTokens
(String accessToken, String refreshToken) This function must be called by the inheritor class after every operation to make sure that the tokens stay current.void
updateTokens
(String accessToken, String refreshToken, String expiresAt) This function must be called by the inheritor class after every operation to make sure that the tokens stay current.Methods inherited from class org.apache.hadoop.fs.FileSystem
access, append, append, append, appendFile, areSymlinksEnabled, cancelDeleteOnExit, canonicalizeUri, checkPath, clearStatistics, close, closeAll, closeAllForUGI, completeLocalOutput, concat, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, create, create, create, createFile, createNewFile, createNonRecursive, createNonRecursive, createNonRecursive, createPathHandle, createSnapshot, createSnapshot, createSymlink, delete, delete, deleteOnExit, deleteSnapshot, enableSymlinks, exists, fixRelativePart, get, get, get, getAclStatus, getAdditionalTokenIssuers, getAllStatistics, getAllStoragePolicies, getBlockSize, getCanonicalServiceName, getCanonicalUri, getChildFileSystems, getContentSummary, getDefaultBlockSize, getDefaultBlockSize, getDefaultPort, getDefaultReplication, getDefaultReplication, getDefaultUri, getDelegationToken, getFileBlockLocations, getFileBlockLocations, getFileChecksum, getFileChecksum, getFileLinkStatus, getFileStatus, getFileSystemClass, getFSofPath, getGlobalStorageStatistics, getHomeDirectory, getInitialWorkingDirectory, getLength, getLinkTarget, getLocal, getName, getNamed, getPathHandle, getQuotaUsage, getReplication, getScheme, getServerDefaults, getServerDefaults, getStatistics, getStatistics, getStatus, getStatus, getStoragePolicy, getStorageStatistics, getTrashRoot, getTrashRoots, getUri, getUsed, getUsed, getWorkingDirectory, getXAttr, getXAttrs, getXAttrs, globStatus, globStatus, hasPathCapability, initialize, isDirectory, isFile, listCorruptFileBlocks, listFiles, listLocatedStatus, listLocatedStatus, listStatus, listStatus, listStatus, listStatus, listStatusBatch, listStatusIterator, listXAttrs, makeQualified, mkdirs, mkdirs, mkdirs, modifyAclEntries, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, msync, newInstance, newInstance, newInstance, newInstanceLocal, open, open, open, open, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, removeAcl, removeAclEntries, removeDefaultAcl, removeXAttr, rename, rename, renameSnapshot, resolveLink, resolvePath, satisfyStoragePolicy, setAcl, setDefaultUri, setDefaultUri, setOwner, setPermission, setQuota, setQuotaByStorageType, setReplication, setStoragePolicy, setTimes, setVerifyChecksum, setWorkingDirectory, setWriteChecksum, setXAttr, setXAttr, startLocalOutput, supportsSymlinks, truncate, unsetStoragePolicy
Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.security.token.DelegationTokenIssuer
addDelegationTokens
-
Constructor Details
-
OAuthEnabledFileSystem
public OAuthEnabledFileSystem()
-
-
Method Details
-
getPluginConfig
-
setPluginConfig
-
getAuthMode
-
setTokenTable
-
getTokenTable
-
setoAuthConfig
-
getoAuthConfig
-
getCredentialsProvider
-
updateTokens
This function must be called by the inheritor class after every operation to make sure that the tokens stay current. This method compares the access token with the one from the persistent store. If the incoming tokens are different, it will update the persistent store.- Parameters:
accessToken
- The new access tokenrefreshToken
- The new refresh token
-
updateTokens
This function must be called by the inheritor class after every operation to make sure that the tokens stay current. This method compares the access token with the one from the persistent store. If the incoming tokens are different, it will update the persistent store.- Parameters:
accessToken
- The new access tokenrefreshToken
- The new refresh tokenexpiresAt
- The new expires at value.
-