@InterfaceAudience.Public
@InterfaceStability.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 and 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 and Description |
|---|---|
static String |
APPEND_SUPPORT_ENABLE_PROPERTY_NAME |
static 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 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 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 String |
AZURE_DELETE_THREADS
The configuration property to set number of threads to be used for delete operation.
|
static 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 String |
KEY_AZURE_AUTHORIZATION
Configuration key to enable authorization support in WASB.
|
static org.slf4j.Logger |
LOG |
static String |
SKIP_AZURE_METRICS_PROPERTY_NAME |
| Constructor and Description |
|---|
NativeAzureFileSystem() |
NativeAzureFileSystem(org.apache.hadoop.fs.azure.NativeFileSystemStore store) |
| Modifier and Type | Method and 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,
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() |
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'.
|
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.
|
String |
getOwnerForPath(org.apache.hadoop.fs.Path absolutePath) |
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,
String threadNamePrefix,
String operation,
String key,
String config) |
URI |
getUri() |
org.apache.hadoop.fs.Path |
getWorkingDirectory() |
void |
initialize(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 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) |
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,
String username,
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 |
updateWasbAuthorizer(WasbAuthorizerInterface authorizer) |
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, createFile, createNewFile, createPathHandle, createSnapshot, createSnapshot, createSymlink, deleteOnExit, deleteSnapshot, enableSymlinks, exists, fixRelativePart, get, get, get, getAclStatus, getAdditionalTokenIssuers, getAllStatistics, getAllStoragePolicies, getBlockSize, getCanonicalServiceName, getCanonicalUri, getChildFileSystems, getContentSummary, getDefaultBlockSize, getDefaultBlockSize, getDefaultPort, getDefaultReplication, getDefaultReplication, getDefaultUri, 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, getXAttr, getXAttrs, getXAttrs, globStatus, globStatus, isDirectory, isFile, listCorruptFileBlocks, listFiles, listLocatedStatus, listLocatedStatus, listStatus, listStatus, listStatus, listStatusBatch, listStatusIterator, listXAttrs, makeQualified, mkdirs, mkdirs, modifyAclEntries, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, newInstance, newInstance, newInstance, newInstanceLocal, open, open, open, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, removeAcl, removeAclEntries, removeDefaultAcl, removeXAttr, rename, renameSnapshot, resolveLink, resolvePath, setAcl, setDefaultUri, setDefaultUri, setReplication, setStoragePolicy, setTimes, setVerifyChecksum, setWriteChecksum, setXAttr, setXAttr, startLocalOutput, supportsSymlinks, truncate, unsetStoragePolicypublic static final org.slf4j.Logger LOG
public static final String AZURE_CHOWN_USERLIST_PROPERTY_NAME
public static final String AZURE_DAEMON_USERLIST_PROPERTY_NAME
public static final String AZURE_CHMOD_USERLIST_PROPERTY_NAME
public static final String SKIP_AZURE_METRICS_PROPERTY_NAME
public static final String APPEND_SUPPORT_ENABLE_PROPERTY_NAME
public static final String AZURE_RENAME_THREADS
public static final int DEFAULT_AZURE_RENAME_THREADS
public static final String AZURE_DELETE_THREADS
public static final int DEFAULT_AZURE_DELETE_THREADS
public static final String KEY_AZURE_AUTHORIZATION
public NativeAzureFileSystem()
public NativeAzureFileSystem(org.apache.hadoop.fs.azure.NativeFileSystemStore store)
public String getScheme()
getScheme in class org.apache.hadoop.fs.FileSystempublic static String newMetricsSourceName()
protected void checkPath(org.apache.hadoop.fs.Path path)
checkPath in class org.apache.hadoop.fs.FileSystempublic void initialize(URI uri, org.apache.hadoop.conf.Configuration conf) throws IOException, IllegalArgumentException
initialize in class org.apache.hadoop.fs.FileSystemIOExceptionIllegalArgumentExceptionpublic org.apache.hadoop.fs.Path getHomeDirectory()
getHomeDirectory in class org.apache.hadoop.fs.FileSystempublic void updateWasbAuthorizer(WasbAuthorizerInterface authorizer)
public String pathToKey(org.apache.hadoop.fs.Path path)
path - path converted to a keypublic org.apache.hadoop.fs.Path makeAbsolute(org.apache.hadoop.fs.Path path)
path - path to be absolute path.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 IOException
append in class org.apache.hadoop.fs.FileSystemIOExceptionpublic 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 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 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.FileSystemIOExceptionprotected 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,
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.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 IOException
delete in class org.apache.hadoop.fs.FileSystemIOExceptionpublic boolean delete(org.apache.hadoop.fs.Path f,
boolean recursive)
throws IOException
delete in class org.apache.hadoop.fs.FileSystemIOExceptionpublic boolean delete(org.apache.hadoop.fs.Path f,
boolean recursive,
boolean skipParentFolderLastModifiedTimeUpdate)
throws IOException
f - file path to be deleted.recursive - specify deleting recursively or not.skipParentFolderLastModifiedTimeUpdate - If true, don't update the folder last
modified time.IOException - Thrown when fail to delete file or directory.public org.apache.hadoop.fs.azure.AzureFileSystemThreadPoolExecutor getThreadPoolExecutor(int threadCount,
String threadNamePrefix,
String operation,
String key,
String config)
public org.apache.hadoop.fs.FileStatus getFileStatus(org.apache.hadoop.fs.Path f)
throws FileNotFoundException,
IOException
getFileStatus in class org.apache.hadoop.fs.FileSystemFileNotFoundExceptionIOExceptionprotected boolean existsInternal(org.apache.hadoop.fs.Path f)
throws IOException
f - the path to a file or directory.IOException - if an IO error occurs while attempting to check
for existence of the path.public URI getUri()
getUri in class org.apache.hadoop.fs.FileSystempublic org.apache.hadoop.fs.FileStatus[] listStatus(org.apache.hadoop.fs.Path f)
throws FileNotFoundException,
IOException
listStatus in class org.apache.hadoop.fs.FileSystemFileNotFoundExceptionIOExceptionpublic 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 boolean mkdirs(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission permission,
boolean noUmask)
throws IOException
IOExceptionpublic org.apache.hadoop.fs.FSDataInputStream open(org.apache.hadoop.fs.Path f,
int bufferSize)
throws FileNotFoundException,
IOException
open in class org.apache.hadoop.fs.FileSystemFileNotFoundExceptionIOExceptionpublic boolean rename(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst)
throws FileNotFoundException,
IOException
rename in class org.apache.hadoop.fs.FileSystemFileNotFoundExceptionIOExceptionpublic 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 FileNotFoundException,
IOException
setPermission in class org.apache.hadoop.fs.FileSystemFileNotFoundExceptionIOExceptionpublic void setOwner(org.apache.hadoop.fs.Path p,
String username,
String groupname)
throws IOException
setOwner 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.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 void access(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.permission.FsAction mode)
throws IOException
access in class org.apache.hadoop.fs.FileSystemIOExceptionpublic void recoverFilesWithDanglingTempData(org.apache.hadoop.fs.Path root,
org.apache.hadoop.fs.Path destination)
throws IOException
root - The root path to consider.destination - The destination path to move any recovered files to.IOException - Thrown when fail to recover files.public void deleteFilesWithDanglingTempData(org.apache.hadoop.fs.Path root)
throws IOException
root - The root path to consider.IOException - Thrown when fail to delete.protected void finalize()
throws Throwable
public String getOwnerForPath(org.apache.hadoop.fs.Path absolutePath) throws IOException
IOExceptionCopyright © 2008–2020 Apache Software Foundation. All rights reserved.