@InterfaceStability.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 and Description |
|---|---|
class |
AzureBlobFileSystem.ResilientCommitByRenameImpl
Resilient commit support.
|
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
AzureBlobFileSystem() |
| Modifier and Type | Method and 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,
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.
|
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(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.
|
String |
getOwnerUser()
Get the username of the FS.
|
String |
getOwnerUserPrimaryGroup()
Get the group name of the owner of the FS.
|
String |
getScheme() |
URI |
getUri() |
org.apache.hadoop.fs.Path |
getWorkingDirectory() |
byte[] |
getXAttr(org.apache.hadoop.fs.Path path,
String name)
Get the value of an attribute for a path.
|
boolean |
hasPathCapability(org.apache.hadoop.fs.Path path,
String capability) |
void |
initialize(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,
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 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,
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,
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,
String owner,
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,
String name,
byte[] value,
EnumSet<org.apache.hadoop.fs.XAttrSetFlag> flag)
Set the value of an attribute for a path.
|
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, createDataInputStreamBuilder, createDataInputStreamBuilder, createDataOutputStreamBuilder, createFile, createMultipartUploader, createNewFile, createPathHandle, createSnapshot, createSnapshot, createSymlink, delete, deleteOnExit, deleteSnapshot, enableSymlinks, fixRelativePart, get, get, get, getAdditionalTokenIssuers, getAllStatistics, getAllStoragePolicies, getBlockSize, getCanonicalUri, getChildFileSystems, getContentSummary, getDefaultBlockSize, getDefaultBlockSize, getDefaultPort, getDefaultReplication, getDefaultReplication, getDefaultUri, 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, listStatus, listStatus, listStatus, listStatusBatch, listXAttrs, mkdirs, mkdirs, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, msync, newInstance, newInstance, newInstance, newInstanceLocal, open, open, open, openFile, openFile, openFileWithOptions, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, removeXAttr, rename, renameSnapshot, resolveLink, resolvePath, satisfyStoragePolicy, setDefaultUri, setDefaultUri, setQuota, setQuotaByStorageType, setReplication, setStoragePolicy, setTimes, setVerifyChecksum, setWriteChecksum, setXAttr, startLocalOutput, supportsSymlinks, truncate, unsetStoragePolicypublic void initialize(URI uri, org.apache.hadoop.conf.Configuration configuration) throws IOException
initialize in class org.apache.hadoop.fs.FileSystemIOExceptionpublic boolean isSecureScheme()
public 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 IOException
open in class org.apache.hadoop.fs.FileSystemIOExceptionprotected CompletableFuture<org.apache.hadoop.fs.FSDataInputStream> openFileWithOptions(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.impl.OpenFileParameters parameters) throws 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 mandatoryKeysIOExceptionpublic 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 IOException
create in class org.apache.hadoop.fs.FileSystemIOExceptionpublic 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 IOException
createNonRecursive in class org.apache.hadoop.fs.FileSystemIOExceptionpublic org.apache.hadoop.fs.FSDataOutputStream createNonRecursive(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission permission,
EnumSet<org.apache.hadoop.fs.CreateFlag> flags,
int bufferSize,
short replication,
long blockSize,
org.apache.hadoop.util.Progressable progress)
throws IOException
createNonRecursive in class org.apache.hadoop.fs.FileSystemIOExceptionpublic 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 IOException
createNonRecursive in class org.apache.hadoop.fs.FileSystemIOExceptionpublic org.apache.hadoop.fs.FSDataOutputStream append(org.apache.hadoop.fs.Path f,
int bufferSize,
org.apache.hadoop.util.Progressable progress)
throws IOException
append in class org.apache.hadoop.fs.FileSystemIOExceptionpublic boolean rename(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst)
throws IOException
rename in class org.apache.hadoop.fs.FileSystemIOException@InterfaceAudience.Private public ResilientCommitByRename createResilientCommitSupport(org.apache.hadoop.fs.Path path) throws IOException
path - destination pathIOException - problem probing store capabilitiesUnsupportedOperationException - if the store lacks this supportpublic boolean delete(org.apache.hadoop.fs.Path f,
boolean recursive)
throws IOException
delete in class org.apache.hadoop.fs.FileSystemIOExceptionpublic org.apache.hadoop.fs.FileStatus[] listStatus(org.apache.hadoop.fs.Path f)
throws IOException
listStatus in class org.apache.hadoop.fs.FileSystemIOExceptionpublic boolean mkdirs(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission permission)
throws IOException
mkdirs in class org.apache.hadoop.fs.FileSystemIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class org.apache.hadoop.fs.FileSystemIOExceptionpublic org.apache.hadoop.fs.FileStatus getFileStatus(org.apache.hadoop.fs.Path f)
throws IOException
getFileStatus in class org.apache.hadoop.fs.FileSystemIOExceptionpublic void breakLease(org.apache.hadoop.fs.Path f)
throws IOException
f - file nameIOException - 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.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 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 Throwable
public String getOwnerUser()
public String getOwnerUserPrimaryGroup()
public void setOwner(org.apache.hadoop.fs.Path path,
String owner,
String group)
throws 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.IOExceptionpublic void setXAttr(org.apache.hadoop.fs.Path path,
String name,
byte[] value,
EnumSet<org.apache.hadoop.fs.XAttrSetFlag> flag)
throws 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 attributeIOException - If there was an issue setting the attribute on AzureIllegalArgumentException - If name is null or empty or if value is nullpublic byte[] getXAttr(org.apache.hadoop.fs.Path path,
String name)
throws IOException
getXAttr in class org.apache.hadoop.fs.FileSystempath - The path on which to get the attributename - The attribute to getIOException - If there was an issue getting the attribute from AzureIllegalArgumentException - If name is null or emptypublic void setPermission(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.permission.FsPermission permission)
throws IOException
setPermission in class org.apache.hadoop.fs.FileSystempath - The pathpermission - Access permissionIOExceptionpublic void modifyAclEntries(org.apache.hadoop.fs.Path path,
List<org.apache.hadoop.fs.permission.AclEntry> aclSpec)
throws IOException
modifyAclEntries in class org.apache.hadoop.fs.FileSystempath - Path to modifyaclSpec - List of AbfsAclEntry describing modificationsIOException - if an ACL could not be modifiedpublic void removeAclEntries(org.apache.hadoop.fs.Path path,
List<org.apache.hadoop.fs.permission.AclEntry> aclSpec)
throws IOException
removeAclEntries in class org.apache.hadoop.fs.FileSystempath - Path to modifyaclSpec - List of AclEntry describing entries to removeIOException - if an ACL could not be modifiedpublic void removeDefaultAcl(org.apache.hadoop.fs.Path path)
throws IOException
removeDefaultAcl in class org.apache.hadoop.fs.FileSystempath - Path to modifyIOException - if an ACL could not be modifiedpublic void removeAcl(org.apache.hadoop.fs.Path path)
throws IOException
removeAcl in class org.apache.hadoop.fs.FileSystempath - Path to modifyIOException - if an ACL could not be removedpublic void setAcl(org.apache.hadoop.fs.Path path,
List<org.apache.hadoop.fs.permission.AclEntry> aclSpec)
throws 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.IOException - if an ACL could not be modifiedpublic org.apache.hadoop.fs.permission.AclStatus getAclStatus(org.apache.hadoop.fs.Path path)
throws IOException
getAclStatus in class org.apache.hadoop.fs.FileSystempath - Path to getIOException - if an ACL could not be readpublic void access(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.permission.FsAction mode)
throws 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 deniedFileNotFoundException - if the path does not existIOException - see specific implementationpublic boolean exists(org.apache.hadoop.fs.Path f)
throws IOException
exists in class org.apache.hadoop.fs.FileSystemf - source path.IOExceptionpublic org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.FileStatus> listStatusIterator(org.apache.hadoop.fs.Path path)
throws IOException
listStatusIterator in class org.apache.hadoop.fs.FileSystemIOExceptionprotected org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus> listLocatedStatus(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.PathFilter filter)
throws FileNotFoundException,
IOException
listLocatedStatus in class org.apache.hadoop.fs.FileSystempath - path to listfilter - a path filterFileNotFoundException - source path not found.IOException - other values.@VisibleForTesting
public static void checkException(org.apache.hadoop.fs.Path path,
AzureBlobFileSystemException exception,
AzureServiceErrorCode... allowedErrorCodesList)
throws IOException
path - path of operation triggering exception; may be nullexception - the exception caughtallowedErrorCodesList - varargs list of error codes.IOException - if the exception error code is not on the allowed list.public org.apache.hadoop.security.token.Token<?> getDelegationToken(String renewer) throws 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.IOException - thrown when getting the current user.public 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,
String capability)
throws IOException
hasPathCapability in interface org.apache.hadoop.fs.PathCapabilitieshasPathCapability in class org.apache.hadoop.fs.FileSystemIOExceptionpublic org.apache.hadoop.fs.statistics.IOStatistics getIOStatistics()
getIOStatistics in interface org.apache.hadoop.fs.statistics.IOStatisticsSourceCopyright © 2008–2023 Apache Software Foundation. All rights reserved.