java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.conf.Configurable, org.apache.hadoop.fs.BulkDeleteSource, org.apache.hadoop.fs.PathCapabilities, org.apache.hadoop.fs.statistics.IOStatisticsSource, org.apache.hadoop.security.token.DelegationTokenIssuerSecureAzureBlobFileSystem@Evolving
public class AzureBlobFileSystem
extends org.apache.hadoop.fs.FileSystem
implements org.apache.hadoop.fs.statistics.IOStatisticsSource
FileSystem for reading and writing files stored on Windows Azure| Modifier and Type | Class | Description |
|---|---|---|
class |
AzureBlobFileSystem.ResilientCommitByRenameImpl |
Resilient commit support.
|
| Modifier and Type | Field | Description |
|---|---|---|
static org.slf4j.Logger |
LOG |
| Constructor | Description |
|---|---|
AzureBlobFileSystem() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
access(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.permission.FsAction mode) |
Checks if the user can access a path.
|
org.apache.hadoop.fs.FSDataOutputStream |
append(org.apache.hadoop.fs.Path f,
int bufferSize,
org.apache.hadoop.util.Progressable progress) |
|
void |
breakLease(org.apache.hadoop.fs.Path f) |
Break the current lease on an ABFS file if it exists.
|
static void |
checkException(org.apache.hadoop.fs.Path path,
AzureBlobFileSystemException exception,
AzureServiceErrorCode... allowedErrorCodesList) |
Given a path and exception, choose which IOException subclass
to create.
|
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) |
|
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) |
|
ResilientCommitByRename |
createResilientCommitSupport(org.apache.hadoop.fs.Path path) |
Private method to create resilient commit support.
|
boolean |
delete(org.apache.hadoop.fs.Path f,
boolean recursive) |
|
boolean |
exists(org.apache.hadoop.fs.Path f) |
Incrementing exists() calls from superclass for statistic collection.
|
protected void |
finalize() |
|
AzureBlobFileSystemStore |
getAbfsStore() |
|
org.apache.hadoop.fs.permission.AclStatus |
getAclStatus(org.apache.hadoop.fs.Path path) |
Gets the ACL of a file or directory.
|
java.lang.String |
getCanonicalServiceName() |
If Delegation tokens are enabled, the canonical service name of
this filesystem is the filesystem URI.
|
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', and
'fs.azure.enable.delegation.token' is set to 'true'.
|
org.apache.hadoop.fs.BlockLocation[] |
getFileBlockLocations(org.apache.hadoop.fs.FileStatus file,
long start,
long len) |
Return an array containing hostnames, offset and size of
portions of the given file.
|
org.apache.hadoop.fs.FileStatus |
getFileStatus(org.apache.hadoop.fs.Path f) |
|
org.apache.hadoop.fs.Path |
getHomeDirectory() |
|
org.apache.hadoop.fs.statistics.IOStatistics |
getIOStatistics() |
Getter for IOStatistic instance in AzureBlobFilesystem.
|
java.lang.String |
getOwnerUser() |
Get the username of the FS.
|
java.lang.String |
getOwnerUserPrimaryGroup() |
Get the group name of the owner of the FS.
|
java.lang.String |
getScheme() |
|
java.net.URI |
getUri() |
|
org.apache.hadoop.fs.Path |
getWorkingDirectory() |
|
byte[] |
getXAttr(org.apache.hadoop.fs.Path path,
java.lang.String name) |
Get the value of an attribute for a non-root path.
|
boolean |
hasPathCapability(org.apache.hadoop.fs.Path path,
java.lang.String capability) |
|
void |
initialize(java.net.URI uri,
org.apache.hadoop.conf.Configuration configuration) |
|
boolean |
isSecureScheme() |
|
protected org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus> |
listLocatedStatus(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.PathFilter filter) |
Incremental listing of located status entries,
preserving etags.
|
org.apache.hadoop.fs.FileStatus[] |
listStatus(org.apache.hadoop.fs.Path f) |
|
org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.FileStatus> |
listStatusIterator(org.apache.hadoop.fs.Path path) |
|
org.apache.hadoop.fs.Path |
makeQualified(org.apache.hadoop.fs.Path path) |
Qualify a path to one which uses this FileSystem and, if relative,
made absolute.
|
boolean |
mkdirs(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission permission) |
|
void |
modifyAclEntries(org.apache.hadoop.fs.Path path,
java.util.List<org.apache.hadoop.fs.permission.AclEntry> aclSpec) |
Modifies ACL entries of files and directories.
|
org.apache.hadoop.fs.FSDataInputStream |
open(org.apache.hadoop.fs.Path path,
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) |
Takes config and other options through
OpenFileParameters. |
void |
registerListener(Listener listener1) |
|
void |
removeAcl(org.apache.hadoop.fs.Path path) |
Removes all but the base ACL entries of files and directories.
|
void |
removeAclEntries(org.apache.hadoop.fs.Path path,
java.util.List<org.apache.hadoop.fs.permission.AclEntry> aclSpec) |
Removes ACL entries from files and directories.
|
void |
removeDefaultAcl(org.apache.hadoop.fs.Path path) |
Removes all default ACL entries from files and directories.
|
boolean |
rename(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst) |
|
void |
setAcl(org.apache.hadoop.fs.Path path,
java.util.List<org.apache.hadoop.fs.permission.AclEntry> aclSpec) |
Fully replaces ACL of files and directories, discarding all existing
entries.
|
void |
setOwner(org.apache.hadoop.fs.Path path,
java.lang.String owner,
java.lang.String group) |
Set owner of a path (i.e.
|
void |
setPermission(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.permission.FsPermission permission) |
Set permission of a path.
|
void |
setWorkingDirectory(org.apache.hadoop.fs.Path newDir) |
|
void |
setXAttr(org.apache.hadoop.fs.Path path,
java.lang.String name,
byte[] value,
java.util.EnumSet<org.apache.hadoop.fs.XAttrSetFlag> flag) |
Set the value of an attribute for a non-root path.
|
java.lang.String |
toString() |
append, append, append, append, appendFile, areSymlinksEnabled, cancelDeleteOnExit, canonicalizeUri, checkPath, 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, delete, deleteFid, deleteOnExit, deleteSnapshot, enableSymlinks, fixRelativePart, get, get, get, getAdditionalTokenIssuers, getAllStatistics, getAllStoragePolicies, getBlockSize, getCanonicalUri, getChildFileSystems, getContentSummary, getDefaultBlockSize, getDefaultBlockSize, getDefaultPort, getDefaultReplication, getDefaultReplication, getDefaultUri, getEnclosingRoot, 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, listStatus, listStatus, listStatus, listStatusBatch, listXAttrs, mkdirs, mkdirs, mkdirsFid, mkdirsFid, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, msync, newInstance, newInstance, newInstance, newInstanceLocal, open, open, open, openFid, openFid, openFid2, openFile, openFile, openFileWithOptions, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, removeXAttr, rename, renameSnapshot, resolveLink, resolvePath, satisfyStoragePolicy, setDefaultUri, setDefaultUri, setOwnerFid, setQuota, setQuotaByStorageType, setReplication, setStoragePolicy, setTimes, setVerifyChecksum, setWriteChecksum, setXAttr, startLocalOutput, supportsSymlinks, truncate, unsetStoragePolicypublic void initialize(java.net.URI uri,
org.apache.hadoop.conf.Configuration configuration)
throws java.io.IOException
initialize in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isSecureScheme()
public java.net.URI getUri()
getUri in class org.apache.hadoop.fs.FileSystempublic void registerListener(Listener listener1)
public org.apache.hadoop.fs.FSDataInputStream open(org.apache.hadoop.fs.Path path,
int bufferSize)
throws java.io.IOException
open in class org.apache.hadoop.fs.FileSystemjava.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
OpenFileParameters. Ensure that
FileStatus entered is up-to-date, as it will be used to create the
InputStream (with info such as contentLength, eTag)openFileWithOptions in class org.apache.hadoop.fs.FileSystempath - The location of file to be openedparameters - OpenFileParameters instance; can hold FileStatus,
Configuration, bufferSize and mandatoryKeysjava.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 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.IOExceptionpublic 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 boolean rename(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst)
throws java.io.IOException
rename in class org.apache.hadoop.fs.FileSystemjava.io.IOException@Private public ResilientCommitByRename createResilientCommitSupport(org.apache.hadoop.fs.Path path) throws java.io.IOException
path - destination pathjava.io.IOException - problem probing store capabilitiesjava.lang.UnsupportedOperationException - if the store lacks this supportpublic boolean delete(org.apache.hadoop.fs.Path f,
boolean recursive)
throws java.io.IOException
delete in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionpublic org.apache.hadoop.fs.FileStatus[] listStatus(org.apache.hadoop.fs.Path f)
throws java.io.IOException
listStatus in class org.apache.hadoop.fs.FileSystemjava.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 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.fs.FileStatus getFileStatus(org.apache.hadoop.fs.Path f)
throws java.io.IOException
getFileStatus in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionpublic void breakLease(org.apache.hadoop.fs.Path f)
throws java.io.IOException
f - file namejava.io.IOException - on any exception while breaking the leasepublic org.apache.hadoop.fs.Path makeQualified(org.apache.hadoop.fs.Path path)
makeQualified in class org.apache.hadoop.fs.FileSystempath - to qualify.java.lang.IllegalArgumentException - if the path has a schema/URI different
from this FileSystem.Path.makeQualified(URI, Path)public org.apache.hadoop.fs.Path getWorkingDirectory()
getWorkingDirectory in class org.apache.hadoop.fs.FileSystempublic void setWorkingDirectory(org.apache.hadoop.fs.Path newDir)
setWorkingDirectory in class org.apache.hadoop.fs.FileSystempublic java.lang.String getScheme()
getScheme in class org.apache.hadoop.fs.FileSystempublic org.apache.hadoop.fs.Path getHomeDirectory()
getHomeDirectory in class org.apache.hadoop.fs.FileSystempublic org.apache.hadoop.fs.BlockLocation[] getFileBlockLocations(org.apache.hadoop.fs.FileStatus file,
long start,
long len)
getFileBlockLocations in class org.apache.hadoop.fs.FileSystemprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic java.lang.String getOwnerUser()
public java.lang.String getOwnerUserPrimaryGroup()
public void setOwner(org.apache.hadoop.fs.Path path,
java.lang.String owner,
java.lang.String group)
throws java.io.IOException
setOwner in class org.apache.hadoop.fs.FileSystempath - The pathowner - If it is null, the original username remains unchanged.group - If it is null, the original groupname remains unchanged.java.io.IOExceptionpublic void setXAttr(org.apache.hadoop.fs.Path path,
java.lang.String name,
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 attributename - The attribute to setvalue - The byte value of the attribute to set (encoded in latin-1)flag - The mode in which to set the attributejava.io.IOException - If there was an issue setting the attribute on Azurejava.lang.IllegalArgumentException - If name is null or empty or if value is nullpublic byte[] getXAttr(org.apache.hadoop.fs.Path path,
java.lang.String name)
throws java.io.IOException
getXAttr in class org.apache.hadoop.fs.FileSystempath - The path on which to get the attributename - The attribute to getjava.io.IOException - If there was an issue getting the attribute from Azurejava.lang.IllegalArgumentException - If name is null or emptypublic void setPermission(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.permission.FsPermission permission)
throws java.io.IOException
setPermission in class org.apache.hadoop.fs.FileSystempath - The pathpermission - Access permissionjava.io.IOExceptionpublic void modifyAclEntries(org.apache.hadoop.fs.Path path,
java.util.List<org.apache.hadoop.fs.permission.AclEntry> aclSpec)
throws java.io.IOException
modifyAclEntries in class org.apache.hadoop.fs.FileSystempath - Path to modifyaclSpec - List of AbfsAclEntry describing modificationsjava.io.IOException - if an ACL could not be modifiedpublic void removeAclEntries(org.apache.hadoop.fs.Path path,
java.util.List<org.apache.hadoop.fs.permission.AclEntry> aclSpec)
throws java.io.IOException
removeAclEntries in class org.apache.hadoop.fs.FileSystempath - Path to modifyaclSpec - List of AclEntry describing entries to removejava.io.IOException - if an ACL could not be modifiedpublic void removeDefaultAcl(org.apache.hadoop.fs.Path path)
throws java.io.IOException
removeDefaultAcl in class org.apache.hadoop.fs.FileSystempath - Path to modifyjava.io.IOException - if an ACL could not be modifiedpublic void removeAcl(org.apache.hadoop.fs.Path path)
throws java.io.IOException
removeAcl in class org.apache.hadoop.fs.FileSystempath - Path to modifyjava.io.IOException - if an ACL could not be removedpublic void setAcl(org.apache.hadoop.fs.Path path,
java.util.List<org.apache.hadoop.fs.permission.AclEntry> aclSpec)
throws java.io.IOException
setAcl in class org.apache.hadoop.fs.FileSystempath - Path to modifyaclSpec - List of AclEntry describing modifications, must include
entries for user, group, and others for compatibility with
permission bits.java.io.IOException - if an ACL could not be modifiedpublic org.apache.hadoop.fs.permission.AclStatus getAclStatus(org.apache.hadoop.fs.Path path)
throws java.io.IOException
getAclStatus in class org.apache.hadoop.fs.FileSystempath - Path to getjava.io.IOException - if an ACL could not be readpublic void access(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.permission.FsAction mode)
throws java.io.IOException
AccessControlException.access in class org.apache.hadoop.fs.FileSystempath - Path to checkmode - type of access to checkorg.apache.hadoop.security.AccessControlException - if access is deniedjava.io.FileNotFoundException - if the path does not existjava.io.IOException - see specific implementationpublic boolean exists(org.apache.hadoop.fs.Path f)
throws java.io.IOException
exists in class org.apache.hadoop.fs.FileSystemf - source path.java.io.IOException - if some issue in checking path.public org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.FileStatus> listStatusIterator(org.apache.hadoop.fs.Path path)
throws java.io.IOException
listStatusIterator in class org.apache.hadoop.fs.FileSystemjava.io.IOExceptionprotected org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus> listLocatedStatus(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.PathFilter filter)
throws java.io.FileNotFoundException,
java.io.IOException
listLocatedStatus in class org.apache.hadoop.fs.FileSystempath - path to listfilter - a path filterjava.io.FileNotFoundException - source path not found.java.io.IOException - other values.@VisibleForTesting
public static void checkException(org.apache.hadoop.fs.Path path,
AzureBlobFileSystemException exception,
AzureServiceErrorCode... allowedErrorCodesList)
throws java.io.IOException
path - path of operation triggering exception; may be nullexception - the exception caughtallowedErrorCodesList - varargs list of error codes.java.io.IOException - if the exception error code is not on the allowed list.public 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 java.lang.String getCanonicalServiceName()
getCanonicalServiceName in interface org.apache.hadoop.security.token.DelegationTokenIssuergetCanonicalServiceName in class org.apache.hadoop.fs.FileSystem@VisibleForTesting public AzureBlobFileSystemStore getAbfsStore()
public 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.IOExceptionpublic org.apache.hadoop.fs.statistics.IOStatistics getIOStatistics()
getIOStatistics in interface org.apache.hadoop.fs.statistics.IOStatisticsSourceCopyright © 2008–2025 Apache Software Foundation. All rights reserved.