java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.conf.Configurable, org.apache.hadoop.fs.BulkDeleteSource, org.apache.hadoop.fs.PathCapabilities, org.apache.hadoop.security.token.DelegationTokenIssuerNativeAzureFileSystem.Secure@Public
@Stable
public class NativeAzureFileSystem
extends org.apache.hadoop.fs.FileSystem
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.| Modifier and Type | Class | Description |
|---|---|---|
static class |
NativeAzureFileSystem.FolderRenamePending |
A description of a folder rename operation, including the source and
destination keys, and descriptions of the files in the source folder.
|
class |
NativeAzureFileSystem.NativeAzureFsOutputStream |
Azure output stream; wraps an inner stream of different types.
|
static class |
NativeAzureFileSystem.Secure |
A
FileSystem for reading and writing files stored on Windows Azure. |
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
APPEND_SUPPORT_ENABLE_PROPERTY_NAME |
|
static java.lang.String |
AZURE_CHMOD_USERLIST_PROPERTY_NAME |
Configuration property used to specify list of users that can perform
chmod operation when authorization is enabled in WASB.
|
static java.lang.String |
AZURE_CHOWN_USERLIST_PROPERTY_NAME |
Configuration property used to specify list of users that can perform
chown operation when authorization is enabled in WASB.
|
static java.lang.String |
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.
|
static java.lang.String |
AZURE_DELETE_THREADS |
The configuration property to set number of threads to be used for delete operation.
|
static java.lang.String |
AZURE_RENAME_THREADS |
The configuration property to set number of threads to be used for rename operation.
|
static int |
DEFAULT_AZURE_DELETE_THREADS |
The default number of threads to be used for delete operation.
|
static int |
DEFAULT_AZURE_RENAME_THREADS |
The default number of threads to be used for rename operation.
|
static java.lang.String |
KEY_AZURE_AUTHORIZATION |
Configuration key to enable authorization support in WASB.
|
static org.slf4j.Logger |
LOG |
|
static java.lang.String |
RETURN_URI_AS_CANONICAL_SERVICE_NAME_PROPERTY_NAME |
|
static java.lang.String |
SKIP_AZURE_METRICS_PROPERTY_NAME |
| Constructor | Description |
|---|---|
NativeAzureFileSystem() |
|
NativeAzureFileSystem(org.apache.hadoop.fs.azure.NativeFileSystemStore store) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
access(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.permission.FsAction mode) |
|
SelfRenewingLease |
acquireLease(org.apache.hadoop.fs.Path path) |
Get a self-renewing lease on the specified file.
|
org.apache.hadoop.fs.FSDataOutputStream |
append(org.apache.hadoop.fs.Path f,
int bufferSize,
org.apache.hadoop.util.Progressable progress) |
This optional operation is not yet supported.
|
protected void |
checkPath(org.apache.hadoop.fs.Path path) |
|
void |
close() |
|
org.apache.hadoop.fs.FSDataOutputStream |
create(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission permission,
boolean overwrite,
int bufferSize,
short replication,
long blockSize,
org.apache.hadoop.util.Progressable progress) |
|
protected org.apache.hadoop.fs.FSDataOutputStream |
createInternal(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission permission,
boolean overwrite,
SelfRenewingLease parentFolderLease) |
This is the version of the create call that is meant for internal usage.
|
org.apache.hadoop.fs.FSDataOutputStream |
createNonRecursive(org.apache.hadoop.fs.Path f,
boolean overwrite,
int bufferSize,
short replication,
long blockSize,
org.apache.hadoop.util.Progressable progress) |
|
org.apache.hadoop.fs.FSDataOutputStream |
createNonRecursive(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission permission,
boolean overwrite,
int bufferSize,
short replication,
long blockSize,
org.apache.hadoop.util.Progressable progress) |
|
org.apache.hadoop.fs.FSDataOutputStream |
createNonRecursive(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission permission,
java.util.EnumSet<org.apache.hadoop.fs.CreateFlag> flags,
int bufferSize,
short replication,
long blockSize,
org.apache.hadoop.util.Progressable progress) |
|
boolean |
delete(org.apache.hadoop.fs.Path path) |
Deprecated.
|
boolean |
delete(org.apache.hadoop.fs.Path f,
boolean recursive) |
|
boolean |
delete(org.apache.hadoop.fs.Path f,
boolean recursive,
boolean skipParentFolderLastModifiedTimeUpdate) |
Delete the specified file or folder.
|
void |
deleteFilesWithDanglingTempData(org.apache.hadoop.fs.Path root) |
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.
|
protected boolean |
existsInternal(org.apache.hadoop.fs.Path f) |
Checks if a given path exists in the filesystem.
|
protected void |
finalize() |
|
java.lang.String |
getCanonicalServiceName() |
If fs.azure.override.canonical.service.name is set as true, return URI of
the WASB filesystem, otherwise use the default implementation.
|
org.apache.hadoop.security.token.Token<?> |
getDelegationToken(java.lang.String renewer) |
Get a delegation token from remote service endpoint if
'fs.azure.enable.kerberos.support' is set to 'true'.
|
org.apache.hadoop.fs.FileStatus |
getFileStatus(org.apache.hadoop.fs.Path f) |
|
org.apache.hadoop.fs.Path |
getHomeDirectory() |
|
AzureFileSystemInstrumentation |
getInstrumentation() |
Gets the metrics source for this file system.
|
java.lang.String |
getOwnerForPath(org.apache.hadoop.fs.Path absolutePath) |
|
java.lang.String |
getScheme() |
|
AzureNativeFileSystemStore |
getStore() |
For unit test purposes, retrieves the AzureNativeFileSystemStore store
backing this file system.
|
org.apache.hadoop.fs.azure.AzureFileSystemThreadPoolExecutor |
getThreadPoolExecutor(int threadCount,
java.lang.String threadNamePrefix,
java.lang.String operation,
java.lang.String key,
java.lang.String config) |
|
java.net.URI |
getUri() |
|
org.apache.hadoop.fs.Path |
getWorkingDirectory() |
|
byte[] |
getXAttr(org.apache.hadoop.fs.Path path,
java.lang.String xAttrName) |
Get the value of an attribute for a path.
|
boolean |
hasPathCapability(org.apache.hadoop.fs.Path path,
java.lang.String capability) |
|
void |
initialize(java.net.URI uri,
org.apache.hadoop.conf.Configuration conf) |
|
org.apache.hadoop.fs.FileStatus[] |
listStatus(org.apache.hadoop.fs.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.
|
org.apache.hadoop.fs.Path |
makeAbsolute(org.apache.hadoop.fs.Path path) |
Get the absolute version of the path (fully qualified).
|
boolean |
mkdirs(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission permission) |
|
boolean |
mkdirs(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission permission,
boolean noUmask) |
|
static java.lang.String |
newMetricsSourceName() |
Creates a new metrics source name that's unique within this process.
|
org.apache.hadoop.fs.FSDataInputStream |
open(org.apache.hadoop.fs.Path f,
int bufferSize) |
|
protected java.util.concurrent.CompletableFuture<org.apache.hadoop.fs.FSDataInputStream> |
openFileWithOptions(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.impl.OpenFileParameters parameters) |
|
java.lang.String |
pathToKey(org.apache.hadoop.fs.Path path) |
Convert the path to a key.
|
void |
recoverFilesWithDanglingTempData(org.apache.hadoop.fs.Path root,
org.apache.hadoop.fs.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.
|
boolean |
rename(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst) |
|
void |
setOwner(org.apache.hadoop.fs.Path p,
java.lang.String username,
java.lang.String groupname) |
|
void |
setPermission(org.apache.hadoop.fs.Path p,
org.apache.hadoop.fs.permission.FsPermission permission) |
|
void |
setWorkingDirectory(org.apache.hadoop.fs.Path newDir) |
Set the working directory to the given directory.
|
void |
setXAttr(org.apache.hadoop.fs.Path path,
java.lang.String xAttrName,
byte[] value,
java.util.EnumSet<org.apache.hadoop.fs.XAttrSetFlag> flag) |
Set the value of an attribute for a path.
|
void |
updateWasbAuthorizer(WasbAuthorizerInterface authorizer) |
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, createFid, createFile, createMultipartUploader, createNewFile, createPathHandle, createPathId, createSnapshot, createSnapshot, createSymlink, deleteFid, 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, getJobTrackerAddrs, getLength, getLinkTarget, getLocal, getName, getNamed, getPathHandle, getQuotaUsage, getReplication, getServerDefaults, getServerDefaults, getStatistics, getStatistics, getStatus, getStatus, getStoragePolicy, getStorageStatistics, getTrashRoot, getTrashRoots, getUsed, getUsed, getXAttrs, getXAttrs, getZkConnectString, globStatus, globStatus, isDirectory, isFile, listCorruptFileBlocks, listFiles, listLocatedStatus, listLocatedStatus, listStatus, listStatus, listStatus, listStatusBatch, listStatusIterator, listXAttrs, makeQualified, mkdirs, mkdirs, mkdirsFid, mkdirsFid, modifyAclEntries, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, msync, newInstance, newInstance, newInstance, newInstanceLocal, open, open, open, openFid, openFid, openFid2, openFile, openFile, openFileWithOptions, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, removeAcl, removeAclEntries, removeDefaultAcl, removeXAttr, rename, renameSnapshot, resolveLink, resolvePath, satisfyStoragePolicy, setAcl, setDefaultUri, setDefaultUri, setOwnerFid, setQuota, setQuotaByStorageType, setReplication, setStoragePolicy, setTimes, setVerifyChecksum, setWriteChecksum, setXAttr, startLocalOutput, supportsSymlinks, truncate, unsetStoragePolicypublic static final org.slf4j.Logger LOG
public static final java.lang.String AZURE_CHOWN_USERLIST_PROPERTY_NAME
public static final java.lang.String AZURE_DAEMON_USERLIST_PROPERTY_NAME
public static final java.lang.String AZURE_CHMOD_USERLIST_PROPERTY_NAME
public static final java.lang.String SKIP_AZURE_METRICS_PROPERTY_NAME
public static final java.lang.String APPEND_SUPPORT_ENABLE_PROPERTY_NAME
public static final java.lang.String RETURN_URI_AS_CANONICAL_SERVICE_NAME_PROPERTY_NAME
public static final java.lang.String AZURE_RENAME_THREADS
public static final int DEFAULT_AZURE_RENAME_THREADS
public static final java.lang.String AZURE_DELETE_THREADS
public static final int DEFAULT_AZURE_DELETE_THREADS
public static final java.lang.String KEY_AZURE_AUTHORIZATION
public NativeAzureFileSystem()
public NativeAzureFileSystem(org.apache.hadoop.fs.azure.NativeFileSystemStore store)
public java.lang.String getScheme()
getScheme in class org.apache.hadoop.fs.FileSystempublic java.lang.String getCanonicalServiceName()
getCanonicalServiceName in interface org.apache.hadoop.security.token.DelegationTokenIssuergetCanonicalServiceName in class org.apache.hadoop.fs.FileSystem@VisibleForTesting public static java.lang.String newMetricsSourceName()
protected void checkPath(org.apache.hadoop.fs.Path path)
checkPath in class org.apache.hadoop.fs.FileSystempublic void initialize(java.net.URI uri,
org.apache.hadoop.conf.Configuration conf)
throws java.io.IOException,
java.lang.IllegalArgumentException
initialize in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionjava.lang.IllegalArgumentExceptionpublic org.apache.hadoop.fs.Path getHomeDirectory()
getHomeDirectory in class org.apache.hadoop.fs.FileSystem@VisibleForTesting public void updateWasbAuthorizer(WasbAuthorizerInterface authorizer)
@VisibleForTesting public java.lang.String pathToKey(org.apache.hadoop.fs.Path path)
path - path converted to a key@VisibleForTesting public org.apache.hadoop.fs.Path makeAbsolute(org.apache.hadoop.fs.Path path)
path - path to be absolute path.@VisibleForTesting public AzureNativeFileSystemStore getStore()
public AzureFileSystemInstrumentation getInstrumentation()
public org.apache.hadoop.fs.FSDataOutputStream append(org.apache.hadoop.fs.Path f,
int bufferSize,
org.apache.hadoop.util.Progressable progress)
throws java.io.IOException
append in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionpublic org.apache.hadoop.fs.FSDataOutputStream create(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission permission,
boolean overwrite,
int bufferSize,
short replication,
long blockSize,
org.apache.hadoop.util.Progressable progress)
throws java.io.IOException
create in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionpublic SelfRenewingLease acquireLease(org.apache.hadoop.fs.Path path) throws AzureException
path - path whose lease to be renewed.AzureException - when not being able to acquire a lease on the pathpublic org.apache.hadoop.fs.FSDataOutputStream createNonRecursive(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission permission,
boolean overwrite,
int bufferSize,
short replication,
long blockSize,
org.apache.hadoop.util.Progressable progress)
throws java.io.IOException
createNonRecursive in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionpublic org.apache.hadoop.fs.FSDataOutputStream createNonRecursive(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission permission,
java.util.EnumSet<org.apache.hadoop.fs.CreateFlag> flags,
int bufferSize,
short replication,
long blockSize,
org.apache.hadoop.util.Progressable progress)
throws java.io.IOException
createNonRecursive in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionpublic org.apache.hadoop.fs.FSDataOutputStream createNonRecursive(org.apache.hadoop.fs.Path f,
boolean overwrite,
int bufferSize,
short replication,
long blockSize,
org.apache.hadoop.util.Progressable progress)
throws java.io.IOException
createNonRecursive in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionprotected org.apache.hadoop.fs.FSDataOutputStream createInternal(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission permission,
boolean overwrite,
SelfRenewingLease parentFolderLease)
throws org.apache.hadoop.fs.FileAlreadyExistsException,
java.io.IOException
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.java.io.IOException - if an IO error occurs while attempting to delete the
path.org.apache.hadoop.fs.FileAlreadyExistsException@Deprecated
public boolean delete(org.apache.hadoop.fs.Path path)
throws java.io.IOException
delete in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionpublic boolean delete(org.apache.hadoop.fs.Path f,
boolean recursive)
throws java.io.IOException
delete in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionpublic boolean delete(org.apache.hadoop.fs.Path f,
boolean recursive,
boolean skipParentFolderLastModifiedTimeUpdate)
throws java.io.IOException
f - file path to be deleted.recursive - specify deleting recursively or not.skipParentFolderLastModifiedTimeUpdate - If true, don't update the folder last
modified time.java.io.IOException - Thrown when fail to delete file or directory.public org.apache.hadoop.fs.azure.AzureFileSystemThreadPoolExecutor getThreadPoolExecutor(int threadCount,
java.lang.String threadNamePrefix,
java.lang.String operation,
java.lang.String key,
java.lang.String config)
public org.apache.hadoop.fs.FileStatus getFileStatus(org.apache.hadoop.fs.Path f)
throws java.io.FileNotFoundException,
java.io.IOException
getFileStatus in class org.apache.hadoop.fs.FileSystemjava.io.FileNotFoundExceptionjava.io.IOExceptionprotected boolean existsInternal(org.apache.hadoop.fs.Path f)
throws java.io.IOException
f - the path to a file or directory.java.io.IOException - if an IO error occurs while attempting to check
for existence of the path.public java.net.URI getUri()
getUri in class org.apache.hadoop.fs.FileSystempublic org.apache.hadoop.fs.FileStatus[] listStatus(org.apache.hadoop.fs.Path f)
throws java.io.FileNotFoundException,
java.io.IOException
listStatus in class org.apache.hadoop.fs.FileSystemjava.io.FileNotFoundExceptionjava.io.IOExceptionpublic boolean mkdirs(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission permission)
throws java.io.IOException
mkdirs in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionpublic boolean mkdirs(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission permission,
boolean noUmask)
throws java.io.IOException
java.io.IOExceptionpublic org.apache.hadoop.fs.FSDataInputStream open(org.apache.hadoop.fs.Path f,
int bufferSize)
throws java.io.FileNotFoundException,
java.io.IOException
open in class org.apache.hadoop.fs.FileSystemjava.io.FileNotFoundExceptionjava.io.IOExceptionprotected java.util.concurrent.CompletableFuture<org.apache.hadoop.fs.FSDataInputStream> openFileWithOptions(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.impl.OpenFileParameters parameters)
throws java.io.IOException
openFileWithOptions in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionpublic boolean rename(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst)
throws java.io.FileNotFoundException,
java.io.IOException
rename in class org.apache.hadoop.fs.FileSystemjava.io.FileNotFoundExceptionjava.io.IOExceptionpublic void setWorkingDirectory(org.apache.hadoop.fs.Path newDir)
setWorkingDirectory in class org.apache.hadoop.fs.FileSystempublic org.apache.hadoop.fs.Path getWorkingDirectory()
getWorkingDirectory in class org.apache.hadoop.fs.FileSystempublic void setPermission(org.apache.hadoop.fs.Path p,
org.apache.hadoop.fs.permission.FsPermission permission)
throws java.io.FileNotFoundException,
java.io.IOException
setPermission in class org.apache.hadoop.fs.FileSystemjava.io.FileNotFoundExceptionjava.io.IOExceptionpublic void setOwner(org.apache.hadoop.fs.Path p,
java.lang.String username,
java.lang.String groupname)
throws java.io.IOException
setOwner in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionpublic void setXAttr(org.apache.hadoop.fs.Path path,
java.lang.String xAttrName,
byte[] value,
java.util.EnumSet<org.apache.hadoop.fs.XAttrSetFlag> flag)
throws java.io.IOException
setXAttr in class org.apache.hadoop.fs.FileSystempath - 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 attributejava.io.IOException - If there was an issue setting the attribute on Azurepublic byte[] getXAttr(org.apache.hadoop.fs.Path path,
java.lang.String xAttrName)
throws java.io.IOException
getXAttr in class org.apache.hadoop.fs.FileSystempath - The path on which to get the attributexAttrName - The attribute to getjava.io.IOException - If there was an issue getting the attribute from Azurepublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeableclose in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionpublic org.apache.hadoop.security.token.Token<?> getDelegationToken(java.lang.String renewer)
throws java.io.IOException
getDelegationToken in interface org.apache.hadoop.security.token.DelegationTokenIssuergetDelegationToken in class org.apache.hadoop.fs.FileSystemrenewer - the account name that is allowed to renew the token.java.io.IOException - thrown when getting the current user.public void access(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.permission.FsAction mode)
throws java.io.IOException
access in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionpublic void recoverFilesWithDanglingTempData(org.apache.hadoop.fs.Path root,
org.apache.hadoop.fs.Path destination)
throws java.io.IOException
root - The root path to consider.destination - The destination path to move any recovered files to.java.io.IOException - Thrown when fail to recover files.public void deleteFilesWithDanglingTempData(org.apache.hadoop.fs.Path root)
throws java.io.IOException
root - The root path to consider.java.io.IOException - Thrown when fail to delete.protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable@VisibleForTesting
public java.lang.String getOwnerForPath(org.apache.hadoop.fs.Path absolutePath)
throws java.io.IOException
java.io.IOExceptionpublic boolean hasPathCapability(org.apache.hadoop.fs.Path path,
java.lang.String capability)
throws java.io.IOException
hasPathCapability in interface org.apache.hadoop.fs.PathCapabilitieshasPathCapability in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.