Class NativeAzureFileSystem
- All Implemented Interfaces:
Closeable,AutoCloseable,Configurable,BulkDeleteSource,org.apache.hadoop.fs.PathCapabilities,org.apache.hadoop.security.token.DelegationTokenIssuer
FileSystem for reading and writing files stored on Windows Azure. This implementation is
blob-based and stores files on Azure in their native form so they can be read
by other Azure tools.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classorg.apache.hadoop.fs.azure.NativeAzureFileSystem.FolderRenamePendingA description of a folder rename operation, including the source and destination keys, and descriptions of the files in the source folder.classorg.apache.hadoop.fs.azure.NativeAzureFileSystem.NativeAzureFsOutputStreamAzure output stream; wraps an inner stream of different types.static classorg.apache.hadoop.fs.azure.NativeAzureFileSystem.SecureAFileSystemfor reading and writing files stored on Windows Azure.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 FileStatus>, org.apache.hadoop.fs.FileSystem.Statistics -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringConfiguration property used to specify list of users that can perform chmod operation when authorization is enabled in WASB.static final StringConfiguration property used to specify list of users that can perform chown operation when authorization is enabled in WASB.static final StringConfiguration property used to specify list of daemon users that can perform chmod operation when authorization is enabled in WASB.static final StringThe configuration property to set number of threads to be used for delete operation.static final StringThe configuration property to set number of threads to be used for rename operation.static final intThe default number of threads to be used for delete operation.static final intThe default number of threads to be used for rename operation.static final StringConfiguration key to enable authorization support in WASB.static final org.slf4j.Loggerstatic final Stringstatic final StringFields inherited from class org.apache.hadoop.fs.FileSystem
DEFAULT_FS, FS_DEFAULT_NAME_KEY, SHUTDOWN_HOOK_PRIORITY, statistics, TRASH_PREFIX, USER_HOME_PREFIXFields inherited from interface org.apache.hadoop.security.token.DelegationTokenIssuer
TOKEN_LOG -
Constructor Summary
ConstructorsConstructorDescriptionNativeAzureFileSystem(org.apache.hadoop.fs.azure.NativeFileSystemStore store) -
Method Summary
Modifier and TypeMethodDescriptionvoidChecks if the user can access a path.org.apache.hadoop.fs.azure.SelfRenewingLeaseacquireLease(Path path) Get a self-renewing lease on the specified file.append(Path f, int bufferSize, Progressable progress) This optional operation is not yet supported.protected voidCheck that a Path belongs to this FileSystem.voidclose()Close this FileSystem instance.create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) Create an FSDataOutputStream at the indicated Path with write-progress reporting.protected FSDataOutputStreamcreateInternal(Path f, FsPermission permission, boolean overwrite, org.apache.hadoop.fs.azure.SelfRenewingLease parentFolderLease) This is the version of the create call that is meant for internal usage.createNonRecursive(Path f, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) Opens an FSDataOutputStream at the indicated Path with write-progress reporting.createNonRecursive(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) Opens an FSDataOutputStream at the indicated Path with write-progress reporting.createNonRecursive(Path f, FsPermission permission, EnumSet<CreateFlag> flags, int bufferSize, short replication, long blockSize, Progressable progress) Opens an FSDataOutputStream at the indicated Path with write-progress reporting.booleanDeprecated.booleanDelete a file.booleanDelete the specified file or folder.voidLooks under the given root path for any blob that are left "dangling", meaning that they are place-holder blobs that we created while we upload the data to a temporary blob, but for some reason we crashed in the middle of the upload and left them there.protected booleanChecks if a given path exists in the filesystem.protected voidfinalize()If fs.azure.override.canonical.service.name is set as true, return URI of the WASB filesystem, otherwise use the default implementation.Token<?>getDelegationToken(String renewer) Get a delegation token from remote service endpoint if 'fs.azure.enable.kerberos.support' is set to 'true'.Return a file status object that represents the path.Return the current user's home directory in this FileSystem.Gets the metrics source for this file system.getOwnerForPath(Path absolutePath) Return the protocol scheme for this FileSystem.org.apache.hadoop.fs.azure.AzureNativeFileSystemStoregetStore()For unit test purposes, retrieves the AzureNativeFileSystemStore store backing this file system.org.apache.hadoop.fs.azure.AzureFileSystemThreadPoolExecutorgetThreadPoolExecutor(int threadCount, String threadNamePrefix, String operation, String key, String config) getUri()Returns a URI which identifies this FileSystem.Get the current working directory for the given FileSystembyte[]Get the value of an attribute for a path.booleanhasPathCapability(Path path, String capability) The base FileSystem implementation generally has no knowledge of the capabilities of actual implementations.voidinitialize(URI uri, Configuration conf) Initialize a FileSystem.listStatus(Path f) Retrieve the status of a given path if it is a file, or of all the contained files if it is a directory.makeAbsolute(Path path) Get the absolute version of the path (fully qualified).booleanmkdirs(Path f, FsPermission permission) Make the given file and all non-existent parents into directories.booleanmkdirs(Path f, FsPermission permission, boolean noUmask) static StringCreates a new metrics source name that's unique within this process.Opens an FSDataInputStream at the indicated Path.protected CompletableFuture<FSDataInputStream>openFileWithOptions(Path path, org.apache.hadoop.fs.impl.OpenFileParameters parameters) Execute the actual open file operation.Convert the path to a key.voidrecoverFilesWithDanglingTempData(Path root, Path destination) Looks under the given root path for any blob that are left "dangling", meaning that they are place-holder blobs that we created while we upload the data to a temporary blob, but for some reason we crashed in the middle of the upload and left them there.booleanRenames Path src to Path dst.voidSet owner of a path (i.e. a file or a directory).voidsetPermission(Path p, FsPermission permission) Set permission of a path.voidsetWorkingDirectory(Path newDir) Set the working directory to the given directory.voidsetXAttr(Path path, String xAttrName, byte[] value, EnumSet<XAttrSetFlag> flag) Set the value of an attribute for a path.voidupdateWasbAuthorizer(org.apache.hadoop.fs.azure.WasbAuthorizerInterface authorizer) Methods inherited from class org.apache.hadoop.fs.FileSystem
append, append, append, append, appendFile, areSymlinksEnabled, cancelDeleteOnExit, canonicalizeUri, clearStatistics, closeAll, closeAllForUGI, completeLocalOutput, concat, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, create, create, createBulkDelete, createDataInputStreamBuilder, createDataInputStreamBuilder, createDataOutputStreamBuilder, createFile, createMultipartUploader, createNewFile, createPathHandle, createSnapshot, createSnapshot, createSymlink, deleteOnExit, deleteSnapshot, enableSymlinks, exists, fixRelativePart, get, get, get, getAclStatus, getAdditionalTokenIssuers, getAllStatistics, getAllStoragePolicies, getBlockSize, getCanonicalUri, getChildFileSystems, getContentSummary, getDefaultBlockSize, getDefaultBlockSize, getDefaultPort, getDefaultReplication, getDefaultReplication, getDefaultUri, getEnclosingRoot, getFileBlockLocations, getFileBlockLocations, getFileChecksum, getFileChecksum, getFileLinkStatus, getFileSystemClass, getFSofPath, getGlobalStorageStatistics, getInitialWorkingDirectory, getLength, getLinkTarget, getLocal, getName, getNamed, getPathHandle, getQuotaUsage, getReplication, getServerDefaults, getServerDefaults, getStatistics, getStatistics, getStatus, getStatus, getStoragePolicy, getStorageStatistics, getTrashRoot, getTrashRoots, getUsed, getUsed, getXAttrs, getXAttrs, globStatus, globStatus, isDirectory, isFile, listCorruptFileBlocks, listFiles, listLocatedStatus, listLocatedStatus, listStatus, listStatus, listStatus, listStatusBatch, listStatusIterator, listXAttrs, makeQualified, mkdirs, mkdirs, modifyAclEntries, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, msync, newInstance, newInstance, newInstance, newInstanceLocal, open, open, open, openFile, openFile, openFileWithOptions, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, removeAcl, removeAclEntries, removeDefaultAcl, removeXAttr, rename, renameSnapshot, resolveLink, resolvePath, satisfyStoragePolicy, setAcl, setDefaultUri, setDefaultUri, setQuota, setQuotaByStorageType, setReplication, setStoragePolicy, setTimes, setVerifyChecksum, setWriteChecksum, setXAttr, startLocalOutput, supportsSymlinks, truncate, unsetStoragePolicyMethods inherited from class org.apache.hadoop.conf.Configured
getConf, setConfMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.security.token.DelegationTokenIssuer
addDelegationTokens
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG -
AZURE_CHOWN_USERLIST_PROPERTY_NAME
Configuration property used to specify list of users that can perform chown operation when authorization is enabled in WASB.- See Also:
-
AZURE_DAEMON_USERLIST_PROPERTY_NAME
Configuration property used to specify list of daemon users that can perform chmod operation when authorization is enabled in WASB.- See Also:
-
AZURE_CHMOD_USERLIST_PROPERTY_NAME
Configuration property used to specify list of users that can perform chmod operation when authorization is enabled in WASB.- See Also:
-
SKIP_AZURE_METRICS_PROPERTY_NAME
- See Also:
-
APPEND_SUPPORT_ENABLE_PROPERTY_NAME
- See Also:
-
RETURN_URI_AS_CANONICAL_SERVICE_NAME_PROPERTY_NAME
- See Also:
-
AZURE_RENAME_THREADS
The configuration property to set number of threads to be used for rename operation.- See Also:
-
DEFAULT_AZURE_RENAME_THREADS
public static final int DEFAULT_AZURE_RENAME_THREADSThe default number of threads to be used for rename operation.- See Also:
-
AZURE_DELETE_THREADS
The configuration property to set number of threads to be used for delete operation.- See Also:
-
DEFAULT_AZURE_DELETE_THREADS
public static final int DEFAULT_AZURE_DELETE_THREADSThe default number of threads to be used for delete operation.- See Also:
-
KEY_AZURE_AUTHORIZATION
Configuration key to enable authorization support in WASB.- See Also:
-
-
Constructor Details
-
NativeAzureFileSystem
public NativeAzureFileSystem() -
NativeAzureFileSystem
public NativeAzureFileSystem(org.apache.hadoop.fs.azure.NativeFileSystemStore store)
-
-
Method Details
-
getScheme
Description copied from class:FileSystemReturn the protocol scheme for this FileSystem.This implementation throws an
UnsupportedOperationException.- Overrides:
getSchemein classFileSystem- Returns:
- the protocol scheme for this FileSystem.
-
getCanonicalServiceName
If fs.azure.override.canonical.service.name is set as true, return URI of the WASB filesystem, otherwise use the default implementation.- Specified by:
getCanonicalServiceNamein interfaceorg.apache.hadoop.security.token.DelegationTokenIssuer- Overrides:
getCanonicalServiceNamein classFileSystem- Returns:
- a service string that uniquely identifies this file system
- See Also:
-
newMetricsSourceName
Creates a new metrics source name that's unique within this process.- Returns:
- metric source name
-
checkPath
Description copied from class:FileSystemCheck that a Path belongs to this FileSystem. The base implementation performs case insensitive equality checks of the URIs' schemes and authorities. Subclasses may implement slightly different checks.- Overrides:
checkPathin classFileSystem- Parameters:
path- to check
-
initialize
Description copied from class:FileSystemInitialize a FileSystem. Called after the new FileSystem instance is constructed, and before it is ready for use. FileSystem implementations overriding this method MUST forward it to their superclass, though the order in which it is done, and whether to alter the configuration before the invocation are options of the subclass.- Overrides:
initializein classFileSystem- Parameters:
uri- a URI whose authority section names the host, port, etc. for this FileSystemconf- the configuration- Throws:
IOException- on any failure to initialize this instance.IllegalArgumentException- if the URI is considered invalid.
-
getHomeDirectory
Description copied from class:FileSystemReturn the current user's home directory in this FileSystem. The default implementation returns"/user/$USER/".- Overrides:
getHomeDirectoryin classFileSystem- Returns:
- the path.
-
updateWasbAuthorizer
@VisibleForTesting public void updateWasbAuthorizer(org.apache.hadoop.fs.azure.WasbAuthorizerInterface authorizer) -
pathToKey
Convert the path to a key. By convention, any leading or trailing slash is removed, except for the special case of a single slash.- Parameters:
path- path converted to a key- Returns:
- key string
-
makeAbsolute
Get the absolute version of the path (fully qualified). This is public for testing purposes.- Parameters:
path- path to be absolute path.- Returns:
- fully qualified path
-
getStore
@VisibleForTesting public org.apache.hadoop.fs.azure.AzureNativeFileSystemStore getStore()For unit test purposes, retrieves the AzureNativeFileSystemStore store backing this file system.- Returns:
- The store object.
-
getInstrumentation
Gets the metrics source for this file system. This is mainly here for unit testing purposes.- Returns:
- the metrics source.
-
append
This optional operation is not yet supported.- Specified by:
appendin classFileSystem- Parameters:
f- the existing file to be appended.bufferSize- the size of the buffer to be used.progress- for reporting progress if it is not null.- Returns:
- output stream.
- Throws:
IOException- IO failure
-
create
public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException Description copied from class:FileSystemCreate an FSDataOutputStream at the indicated Path with write-progress reporting.- Specified by:
createin classFileSystem- Parameters:
f- the file name to openpermission- file permissionoverwrite- if a file with this name already exists, then if true, the file will be overwritten, and if false an error will be thrown.bufferSize- the size of the buffer to be used.replication- required block replication for the file.blockSize- block sizeprogress- the progress reporter- Returns:
- output stream.
- Throws:
IOException- IO failure- See Also:
-
acquireLease
Get a self-renewing lease on the specified file.- Parameters:
path- path whose lease to be renewed.- Returns:
- Lease
- Throws:
AzureException- when not being able to acquire a lease on the path
-
createNonRecursive
public FSDataOutputStream createNonRecursive(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException Description copied from class:FileSystemOpens an FSDataOutputStream at the indicated Path with write-progress reporting. Same as create(), except fails if parent directory doesn't already exist.- Overrides:
createNonRecursivein classFileSystem- Parameters:
f- the file name to openpermission- file permissionoverwrite- if a file with this name already exists, then if true, the file will be overwritten, and if false an error will be thrown.bufferSize- the size of the buffer to be used.replication- required block replication for the file.blockSize- block sizeprogress- the progress reporter- Returns:
- output stream.
- Throws:
IOException- IO failure- See Also:
-
createNonRecursive
public FSDataOutputStream createNonRecursive(Path f, FsPermission permission, EnumSet<CreateFlag> flags, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException Description copied from class:FileSystemOpens an FSDataOutputStream at the indicated Path with write-progress reporting. Same as create(), except fails if parent directory doesn't already exist.- Overrides:
createNonRecursivein classFileSystem- Parameters:
f- the file name to openpermission- file permissionflags-CreateFlags to use for this stream.bufferSize- the size of the buffer to be used.replication- required block replication for the file.blockSize- block sizeprogress- the progress reporter- Returns:
- output stream.
- Throws:
IOException- IO failure- See Also:
-
createNonRecursive
public FSDataOutputStream createNonRecursive(Path f, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException Description copied from class:FileSystemOpens an FSDataOutputStream at the indicated Path with write-progress reporting. Same as create(), except fails if parent directory doesn't already exist.- Overrides:
createNonRecursivein classFileSystem- Parameters:
f- the file name to openoverwrite- if a file with this name already exists, then if true, the file will be overwritten, and if false an error will be thrown.bufferSize- the size of the buffer to be used.replication- required block replication for the file.blockSize- block sizeprogress- the progress reporter- Returns:
- output stream.
- Throws:
IOException- IO failure- See Also:
-
createInternal
protected FSDataOutputStream createInternal(Path f, FsPermission permission, boolean overwrite, org.apache.hadoop.fs.azure.SelfRenewingLease parentFolderLease) throws FileAlreadyExistsException, IOException This is the version of the create call that is meant for internal usage. This version is not public facing and does not perform authorization checks. It is used by the public facing create call and by FolderRenamePending to create the internal -RenamePending.json file.- Parameters:
f- the path to a file to be created.permission- for the newly created file.overwrite- specifies if the file should be overwritten.parentFolderLease- lease on the parent folder.- Returns:
- the output stream used to write data into the newly created file .
- Throws:
IOException- if an IO error occurs while attempting to delete the path.FileAlreadyExistsException
-
delete
Deprecated.Description copied from class:FileSystemDelete a file/directory.- Overrides:
deletein classFileSystem- Parameters:
path- the path.- Returns:
- if delete success true, not false.
- Throws:
IOException- IO failure.
-
delete
Description copied from class:FileSystemDelete a file.- Specified by:
deletein classFileSystem- Parameters:
f- the path to delete.recursive- if path is a directory and set to true, the directory is deleted else throws an exception. In case of a file the recursive can be set to either true or false.- Returns:
- true if delete is successful else false.
- Throws:
IOException- IO failure
-
delete
public boolean delete(Path f, boolean recursive, boolean skipParentFolderLastModifiedTimeUpdate) throws IOException Delete the specified file or folder. The parameter skipParentFolderLastModifiedTimeUpdate is used in the case of atomic folder rename redo. In that case, there is a lease on the parent folder, so (without reworking the code) modifying the parent folder update time will fail because of a conflict with the lease. Since we are going to delete the folder soon anyway so accurate modified time is not necessary, it's easier to just skip the modified time update.- Parameters:
f- file path to be deleted.recursive- specify deleting recursively or not.skipParentFolderLastModifiedTimeUpdate- If true, don't update the folder last modified time.- Returns:
- true if and only if the file is deleted
- Throws:
IOException- Thrown when fail to delete file or directory.
-
getThreadPoolExecutor
-
getFileStatus
Description copied from class:FileSystemReturn a file status object that represents the path.- Specified by:
getFileStatusin classFileSystem- Parameters:
f- The path we want information from- Returns:
- a FileStatus object
- Throws:
FileNotFoundException- when the path does not existIOException- see specific implementation
-
existsInternal
Checks if a given path exists in the filesystem. Calls getFileStatusInternal and has the same costs as the public facing exists call. This internal version of the exists call does not perform authorization checks, and is used internally by various filesystem operations that need to check if the parent/ancestor/path exist. The idea is to avoid having to configure authorization policies for these internal calls.- Parameters:
f- the path to a file or directory.- Returns:
- true if path exists; otherwise false.
- Throws:
IOException- if an IO error occurs while attempting to check for existence of the path.
-
getUri
Description copied from class:FileSystemReturns a URI which identifies this FileSystem.- Specified by:
getUriin classFileSystem- Returns:
- the URI of this filesystem.
-
listStatus
Retrieve the status of a given path if it is a file, or of all the contained files if it is a directory.- Specified by:
listStatusin classFileSystem- Parameters:
f- given path- Returns:
- the statuses of the files/directories in the given patch
- Throws:
FileNotFoundException- when the path does not existIOException- see specific implementation
-
mkdirs
Description copied from class:FileSystemMake the given file and all non-existent parents into directories. Has roughly the semantics of Unix @{code mkdir -p}. Existence of the directory hierarchy is not an error.- Specified by:
mkdirsin classFileSystem- Parameters:
f- path to createpermission- to apply to f- Returns:
- if mkdir success true, not false.
- Throws:
IOException- IO failure
-
mkdirs
- Throws:
IOException
-
open
Description copied from class:FileSystemOpens an FSDataInputStream at the indicated Path.- Specified by:
openin classFileSystem- Parameters:
f- the file name to openbufferSize- the size of the buffer to be used.- Returns:
- input stream.
- Throws:
IOException- IO failureFileNotFoundException
-
openFileWithOptions
protected CompletableFuture<FSDataInputStream> openFileWithOptions(Path path, org.apache.hadoop.fs.impl.OpenFileParameters parameters) throws IOException Description copied from class:FileSystemExecute the actual open file operation. This is invoked fromFSDataInputStreamBuilder.build()and fromDelegateToFileSystemand is where the action of opening the file should begin. The base implementation performs a blocking call toFileSystem.open(Path, int)in this call; the actual outcome is in the returnedCompletableFuture. This avoids having to create some thread pool, while still setting up the expectation that theget()call is needed to evaluate the result.- Overrides:
openFileWithOptionsin classFileSystem- Parameters:
path- path to the fileparameters- open file parameters from the builder.- Returns:
- a future which will evaluate to the opened file.
- Throws:
IOException- failure to resolve the link.
-
rename
Description copied from class:FileSystemRenames Path src to Path dst.- Specified by:
renamein classFileSystem- Parameters:
src- path to be renameddst- new path after rename- Returns:
- true if rename is successful
- Throws:
IOException- on failureFileNotFoundException
-
setWorkingDirectory
Set the working directory to the given directory.- Specified by:
setWorkingDirectoryin classFileSystem- Parameters:
newDir- Path of new working directory
-
getWorkingDirectory
Description copied from class:FileSystemGet the current working directory for the given FileSystem- Specified by:
getWorkingDirectoryin classFileSystem- Returns:
- the directory pathname
-
setPermission
public void setPermission(Path p, FsPermission permission) throws FileNotFoundException, IOException Description copied from class:FileSystemSet permission of a path.- Overrides:
setPermissionin classFileSystem- Parameters:
p- The pathpermission- permission- Throws:
IOException- IO failureFileNotFoundException
-
setOwner
Description copied from class:FileSystemSet owner of a path (i.e. a file or a directory). The parameters username and groupname cannot both be null.- Overrides:
setOwnerin classFileSystem- Parameters:
p- The pathusername- If it is null, the original username remains unchanged.groupname- If it is null, the original groupname remains unchanged.- Throws:
IOException- IO failure
-
setXAttr
public void setXAttr(Path path, String xAttrName, byte[] value, EnumSet<XAttrSetFlag> flag) throws IOException Set the value of an attribute for a path.- Overrides:
setXAttrin classFileSystem- Parameters:
path- The path on which to set the attributexAttrName- The attribute to setvalue- The byte value of the attribute to set (encoded in utf-8)flag- The mode in which to set the attribute- Throws:
IOException- If there was an issue setting the attribute on Azure
-
getXAttr
Get the value of an attribute for a path.- Overrides:
getXAttrin classFileSystem- Parameters:
path- The path on which to get the attributexAttrName- The attribute to get- Returns:
- The bytes of the attribute's value (encoded in utf-8) or null if the attribute does not exist
- Throws:
IOException- If there was an issue getting the attribute from Azure
-
close
Description copied from class:FileSystemClose this FileSystem instance. Will release any held locks, delete all files queued for deletion through calls toFileSystem.deleteOnExit(Path), and remove this FS instance from the cache, if cached. After this operation, the outcome of any method call on this FileSystem instance, or any input/output stream created by it is undefined.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFileSystem- Throws:
IOException- IO failure
-
getDelegationToken
Get a delegation token from remote service endpoint if 'fs.azure.enable.kerberos.support' is set to 'true'.- Specified by:
getDelegationTokenin interfaceorg.apache.hadoop.security.token.DelegationTokenIssuer- Parameters:
renewer- the account name that is allowed to renew the token.- Returns:
- delegation token
- Throws:
IOException- thrown when getting the current user.
-
access
Description copied from class:FileSystemChecks if the user can access a path. The mode specifies which access checks to perform. If the requested permissions are granted, then the method returns normally. If access is denied, then the method throws anAccessControlException.The default implementation calls
FileSystem.getFileStatus(Path)and checks the returned permissions against the requested permissions. Note that theFileSystem.getFileStatus(Path)call will be subject to authorization checks. Typically, this requires search (execute) permissions on each directory in the path's prefix, but this is implementation-defined. Any file system that provides a richer authorization model (such as ACLs) may override the default implementation so that it checks against that model instead.In general, applications should avoid using this method, due to the risk of time-of-check/time-of-use race conditions. The permissions on a file may change immediately after the access call returns. Most applications should prefer running specific file system actions as the desired user represented by a
UserGroupInformation.- Parameters:
path- Path to checkmode- type of access to check- Throws:
AccessControlException- if access is deniedFileNotFoundException- if the path does not existIOException- see specific implementation
-
recoverFilesWithDanglingTempData
Looks under the given root path for any blob that are left "dangling", meaning that they are place-holder blobs that we created while we upload the data to a temporary blob, but for some reason we crashed in the middle of the upload and left them there. If any are found, we move them to the destination given.- Parameters:
root- The root path to consider.destination- The destination path to move any recovered files to.- Throws:
IOException- Thrown when fail to recover files.
-
deleteFilesWithDanglingTempData
Looks under the given root path for any blob that are left "dangling", meaning that they are place-holder blobs that we created while we upload the data to a temporary blob, but for some reason we crashed in the middle of the upload and left them there. If any are found, we delete them.- Parameters:
root- The root path to consider.- Throws:
IOException- Thrown when fail to delete.
-
finalize
-
getOwnerForPath
- Throws:
IOException
-
hasPathCapability
Description copied from class:FileSystemThe base FileSystem implementation generally has no knowledge of the capabilities of actual implementations. Unless it has a way to explicitly determine the capabilities, this method returns false. Probe for a specific capability under the given path. If the function returnstrue, this instance is explicitly declaring that the capability is available. If the function returnsfalse, it can mean one of:- The capability is not known.
- The capability is known but it is not supported.
- The capability is known but the filesystem does not know if it is supported under the supplied path.
Implementors:
PathCapabilitiesSupportcan be used to help implement this method.- Specified by:
hasPathCapabilityin interfaceorg.apache.hadoop.fs.PathCapabilities- Overrides:
hasPathCapabilityin classFileSystem- Parameters:
path- path to query the capability of.capability- non-null, non-empty string to query the path for support.- Returns:
- true if the capability is supported under that part of the FS.
- Throws:
IOException- this should not be raised, except on problems resolving paths or relaying the call.
-