@InterfaceAudience.Public
@InterfaceStability.Evolving
public class AdlFileSystem
extends org.apache.hadoop.fs.FileSystem
| Modifier and Type | Field and Description |
|---|---|
static String |
SCHEME |
| Constructor and Description |
|---|
AdlFileSystem() |
| 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)
Append to an existing file (optional operation).
|
void |
concat(org.apache.hadoop.fs.Path trg,
org.apache.hadoop.fs.Path[] srcs)
Concat existing files together.
|
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)
Create call semantic is handled differently in case of ADL.
|
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)
Deprecated.
API only for 0.20-append
|
boolean |
delete(org.apache.hadoop.fs.Path path,
boolean recursive)
Delete a file.
|
static String |
getAccountNameFromFQDN(String accountFQDN)
Gets ADL account name from ADL FQDN.
|
org.apache.hadoop.fs.permission.AclStatus |
getAclStatus(org.apache.hadoop.fs.Path path)
Gets the ACL of a file or directory.
|
com.microsoft.azure.datalake.store.ADLStoreClient |
getAdlClient() |
long |
getBlockSize(org.apache.hadoop.fs.Path f)
Deprecated.
Use getFileStatus() instead
|
org.apache.hadoop.fs.ContentSummary |
getContentSummary(org.apache.hadoop.fs.Path f)
Return the
ContentSummary of a given Path. |
protected AzureADTokenProvider |
getCustomAccessTokenProvider(org.apache.hadoop.conf.Configuration conf)
This method is provided for convenience for derived classes to define
custom
AzureADTokenProvider instance. |
long |
getDefaultBlockSize()
Deprecated.
use
getDefaultBlockSize(Path) instead |
long |
getDefaultBlockSize(org.apache.hadoop.fs.Path f)
Return the number of bytes that large input files should be optimally
be split into to minimize i/o time.
|
int |
getDefaultPort() |
org.apache.hadoop.fs.FileStatus |
getFileStatus(org.apache.hadoop.fs.Path f)
Return a file status object that represents the path.
|
org.apache.hadoop.fs.Path |
getHomeDirectory()
Constructing home directory locally is fine as long as Hadoop
local user name and ADL user name relationship story is not fully baked
yet.
|
short |
getReplication(org.apache.hadoop.fs.Path src)
Deprecated.
Use getFileStatus() instead
|
String |
getScheme() |
protected String |
getTransportScheme() |
URI |
getUri() |
org.apache.hadoop.fs.Path |
getWorkingDirectory()
Get the current working directory for the given file system.
|
boolean |
hasPathCapability(org.apache.hadoop.fs.Path path,
String capability) |
void |
initialize(URI storeUri,
org.apache.hadoop.conf.Configuration originalConf)
Called after a new FileSystem instance is constructed.
|
org.apache.hadoop.fs.FileStatus[] |
listStatus(org.apache.hadoop.fs.Path f)
List the statuses of the files/directories in the given path if the path is
a directory.
|
boolean |
mkdirs(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.permission.FsPermission permission)
Make the given file and all non-existent parents into
directories.
|
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 f,
int buffersize)
Open call semantic is handled differently in case of ADL.
|
static org.apache.hadoop.conf.Configuration |
propagateAccountOptions(org.apache.hadoop.conf.Configuration source,
String accountName)
Propagates account-specific settings into generic ADL configuration keys.
|
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)
Renames Path src to Path dst.
|
void |
rename(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst,
org.apache.hadoop.fs.Options.Rename... options)
Deprecated.
|
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.
|
boolean |
setReplication(org.apache.hadoop.fs.Path p,
short replication)
Azure data lake does not support user configuration for data replication
hence not leaving system to query on
azure data lake.
|
void |
setUserGroupRepresentationAsUPN(boolean enableUPN) |
void |
setWorkingDirectory(org.apache.hadoop.fs.Path dir)
Set the current working directory for the given file system.
|
boolean |
supportsSymlinks() |
append, append, append, append, appendFile, areSymlinksEnabled, cancelDeleteOnExit, canonicalizeUri, checkPath, clearStatistics, close, closeAll, closeAllForUGI, completeLocalOutput, 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, createNonRecursive, createNonRecursive, createPathHandle, createSnapshot, createSnapshot, createSymlink, delete, deleteOnExit, deleteSnapshot, enableSymlinks, exists, fixRelativePart, get, get, get, getAdditionalTokenIssuers, getAllStatistics, getAllStoragePolicies, getCanonicalServiceName, getCanonicalUri, getChildFileSystems, getDefaultReplication, getDefaultReplication, getDefaultUri, getDelegationToken, getEnclosingRoot, getFileBlockLocations, getFileBlockLocations, getFileChecksum, getFileChecksum, getFileLinkStatus, getFileSystemClass, getFSofPath, getGlobalStorageStatistics, getInitialWorkingDirectory, getLength, getLinkTarget, getLocal, getName, getNamed, getPathHandle, getQuotaUsage, 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, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, msync, newInstance, newInstance, newInstance, newInstanceLocal, open, open, open, openFile, openFile, openFileWithOptions, openFileWithOptions, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, removeXAttr, renameSnapshot, resolveLink, resolvePath, satisfyStoragePolicy, setDefaultUri, setDefaultUri, setQuota, setQuotaByStorageType, setStoragePolicy, setTimes, setVerifyChecksum, setWriteChecksum, setXAttr, setXAttr, startLocalOutput, truncate, unsetStoragePolicypublic static final String SCHEME
public String getScheme()
getScheme in class org.apache.hadoop.fs.FileSystempublic URI getUri()
getUri in class org.apache.hadoop.fs.FileSystempublic int getDefaultPort()
getDefaultPort in class org.apache.hadoop.fs.FileSystempublic boolean supportsSymlinks()
supportsSymlinks in class org.apache.hadoop.fs.FileSystempublic void initialize(URI storeUri, org.apache.hadoop.conf.Configuration originalConf) throws IOException
initialize in class org.apache.hadoop.fs.FileSystemstoreUri - a uri whose authority section names the host, port,
etc. for this FileSystemoriginalConf - the configuration to use for the FS. The account-
specific options are patched over the base ones
before any use is made of the config.IOExceptionprotected AzureADTokenProvider getCustomAccessTokenProvider(org.apache.hadoop.conf.Configuration conf) throws IOException
AzureADTokenProvider instance.
In order to ensure secure hadoop infrastructure and user context for which
respective AdlFileSystem instance is initialized,
Loading AzureADTokenProvider is not sufficient.
The order of loading AzureADTokenProvider is to first invoke
getCustomAccessTokenProvider(Configuration), If method return null
which means no implementation provided by derived classes, then
configuration object is loaded to retrieve token configuration as specified
is documentation.
Custom token management takes the higher precedence during initialization.conf - Configuration objectAzureADTokenProvider token management
is specified.IOException - if failed to initialize token provider.@VisibleForTesting public com.microsoft.azure.datalake.store.ADLStoreClient getAdlClient()
public org.apache.hadoop.fs.Path getHomeDirectory()
getHomeDirectory in class org.apache.hadoop.fs.FileSystempublic 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.FileSystemf - File pathpermission - Access permission for the newly created fileoverwrite - Remove existing file and recreate new one if true
otherwise throw error if file existbufferSize - Buffer size, ADL backend does not honourreplication - Replication count, ADL backend does not honourblockSize - Block size, ADL backend does not honourprogress - Progress indicatorIOException - when system error, internal server error or user errorpublic 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.FileSystemf - the file name to openpermission - Access permission for the newly created fileflags - CreateFlags to use for this stream.bufferSize - the size of the buffer to be used. ADL backend does
not honourreplication - required block replication for the file. ADL backend
does not honourblockSize - Block size, ADL backend does not honourprogress - Progress indicatorIOException - when system error, internal server error or user errorsetPermission(Path, FsPermission)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.FileSystemf - the existing file to be appended.bufferSize - the size of the buffer to be used. ADL backend does
not honourprogress - Progress indicatorIOException - when system error, internal server error or user errorpublic boolean setReplication(org.apache.hadoop.fs.Path p,
short replication)
throws IOException
setReplication in class org.apache.hadoop.fs.FileSystemp - Not honouredreplication - Not honouredIOException - No exception would not thrown in this case however
aligning with parent api definition.public org.apache.hadoop.fs.FSDataInputStream open(org.apache.hadoop.fs.Path f,
int buffersize)
throws IOException
open in class org.apache.hadoop.fs.FileSystemf - File pathbuffersize - Buffer size, Not honouredIOException - when system error, internal server error or user errorpublic org.apache.hadoop.fs.FileStatus getFileStatus(org.apache.hadoop.fs.Path f)
throws IOException
getFileStatus in class org.apache.hadoop.fs.FileSystemf - The path we want information fromIOException - when the path does not exist or any other error;
IOException see specific implementationpublic org.apache.hadoop.fs.FileStatus[] listStatus(org.apache.hadoop.fs.Path f)
throws IOException
listStatus in class org.apache.hadoop.fs.FileSystemf - given pathIOException - when the path does not exist or any other error;
IOException see specific implementationpublic boolean rename(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst)
throws IOException
rename in class org.apache.hadoop.fs.FileSystemsrc - path to be renameddst - new path after renameIOException - on failure@Deprecated public void rename(org.apache.hadoop.fs.Path src, org.apache.hadoop.fs.Path dst, org.apache.hadoop.fs.Options.Rename... options) throws IOException
rename in class org.apache.hadoop.fs.FileSystemIOExceptionpublic void concat(org.apache.hadoop.fs.Path trg,
org.apache.hadoop.fs.Path[] srcs)
throws IOException
concat in class org.apache.hadoop.fs.FileSystemtrg - the path to the target destination.srcs - the paths to the sources to use for the concatenation.IOException - when system error, internal server error or user errorpublic boolean delete(org.apache.hadoop.fs.Path path,
boolean recursive)
throws IOException
delete in class org.apache.hadoop.fs.FileSystempath - 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.IOException - when system error, internal server error or user errorpublic boolean mkdirs(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.permission.FsPermission permission)
throws IOException
mkdirs in class org.apache.hadoop.fs.FileSystempath - path to createpermission - to apply to pathIOExceptionpublic 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 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 AclEntry 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 org.apache.hadoop.fs.ContentSummary getContentSummary(org.apache.hadoop.fs.Path f)
throws IOException
ContentSummary of a given Path.getContentSummary in class org.apache.hadoop.fs.FileSystemf - path to useIOException@VisibleForTesting protected String getTransportScheme()
public org.apache.hadoop.fs.Path getWorkingDirectory()
getWorkingDirectory in class org.apache.hadoop.fs.FileSystempublic void setWorkingDirectory(org.apache.hadoop.fs.Path dir)
setWorkingDirectory in class org.apache.hadoop.fs.FileSystemdir - Working directory path.@Deprecated public long getDefaultBlockSize()
getDefaultBlockSize(Path) insteadgetDefaultBlockSize in class org.apache.hadoop.fs.FileSystempublic long getDefaultBlockSize(org.apache.hadoop.fs.Path f)
getDefaultBlockSize in class org.apache.hadoop.fs.FileSystemf - path of file@Deprecated public long getBlockSize(org.apache.hadoop.fs.Path f) throws IOException
getBlockSize in class org.apache.hadoop.fs.FileSystemIOException@Deprecated public short getReplication(org.apache.hadoop.fs.Path src)
getReplication in class org.apache.hadoop.fs.FileSystemsrc - file name@VisibleForTesting public void setUserGroupRepresentationAsUPN(boolean enableUPN)
public static String getAccountNameFromFQDN(String accountFQDN)
accountFQDN - ADL account fqdnpublic static org.apache.hadoop.conf.Configuration propagateAccountOptions(org.apache.hadoop.conf.Configuration source,
String accountName)
fs.adl.account.${account_name}.key to
fs.adl.key, for all values of "key"
The source of the updated property is set to the key name of the account
property, to aid in diagnostics of where things came from.
Returns a new configuration. Why the clone?
You can use the same conf for different filesystems, and the original
values are not updated.source - Source Configuration objectaccountName - account name. Must not be emptypublic 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.FileSystemIOExceptionCopyright © 2008–2024 Apache Software Foundation. All rights reserved.