@InterfaceAudience.Public @InterfaceStability.Evolving public class AzureBlobFileSystemStore extends Object implements Closeable, org.apache.hadoop.fs.azurebfs.services.ListingSupport
Constructor and Description |
---|
AzureBlobFileSystemStore(org.apache.hadoop.fs.azurebfs.AzureBlobFileSystemStore.AzureBlobFileSystemStoreBuilder abfsStoreBuilder)
FileSystem Store for
AzureBlobFileSystem for Abfs operations. |
Modifier and Type | Method and Description |
---|---|
void |
access(Path path,
FsAction mode,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
void |
breakLease(Path path,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext)
Break any current lease on an ABFS file.
|
void |
close() |
void |
createDirectory(Path path,
FsPermission permission,
FsPermission umask,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
OutputStream |
createFile(Path path,
org.apache.hadoop.fs.FileSystem.Statistics statistics,
boolean overwrite,
FsPermission permission,
FsPermission umask,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
void |
createFilesystem(org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
void |
delete(Path path,
boolean recursive,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
void |
deleteFilesystem(org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
static String |
extractEtagHeader(org.apache.hadoop.fs.azurebfs.services.AbfsHttpOperation result)
Get the etag header from a response, stripping any quotations.
|
org.apache.hadoop.fs.azurebfs.AbfsConfiguration |
getAbfsConfiguration() |
AclStatus |
getAclStatus(Path path,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
org.apache.hadoop.fs.azurebfs.services.AbfsClient |
getClient() |
FileStatus |
getFileStatus(Path path,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
Hashtable<String,String> |
getFilesystemProperties(org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
boolean |
getIsNamespaceEnabled(org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext)
Resolves namespace information of the filesystem from the state of
isNamespaceEnabled . |
Hashtable<String,String> |
getPathStatus(Path path,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
String |
getPrimaryGroup() |
String |
getRelativePath(Path path) |
String |
getUser() |
boolean |
isAppendBlobKey(String key)
Checks if the given key in Azure Storage should be stored as a page
blob instead of block blob.
|
boolean |
isAtomicRenameKey(String key) |
boolean |
isInfiniteLeaseKey(String key) |
String |
listStatus(Path path,
String startFrom,
List<FileStatus> fileStatuses,
boolean fetchAll,
String continuation,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
FileStatus[] |
listStatus(Path path,
String startFrom,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
FileStatus[] |
listStatus(Path path,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
void |
modifyAclEntries(Path path,
List<AclEntry> aclSpec,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
org.apache.hadoop.fs.azurebfs.services.AbfsInputStream |
openFileForRead(Path path,
org.apache.hadoop.fs.FileSystem.Statistics statistics,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
org.apache.hadoop.fs.azurebfs.services.AbfsInputStream |
openFileForRead(Path path,
Optional<org.apache.hadoop.fs.impl.OpenFileParameters> parameters,
org.apache.hadoop.fs.FileSystem.Statistics statistics,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
OutputStream |
openFileForWrite(Path path,
org.apache.hadoop.fs.FileSystem.Statistics statistics,
boolean overwrite,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
void |
removeAcl(Path path,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
void |
removeAclEntries(Path path,
List<AclEntry> aclSpec,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
void |
removeDefaultAcl(Path path,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
boolean |
rename(Path source,
Path destination,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext,
String sourceEtag)
Rename a file or directory.
|
void |
setAcl(Path path,
List<AclEntry> aclSpec,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
void |
setFilesystemProperties(Hashtable<String,String> properties,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
void |
setOwner(Path path,
String owner,
String group,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
void |
setPathProperties(Path path,
Hashtable<String,String> properties,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
void |
setPermission(Path path,
FsPermission permission,
org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) |
public AzureBlobFileSystemStore(org.apache.hadoop.fs.azurebfs.AzureBlobFileSystemStore.AzureBlobFileSystemStoreBuilder abfsStoreBuilder) throws IOException
AzureBlobFileSystem
for Abfs operations.
Built using the AzureBlobFileSystemStore.AzureBlobFileSystemStoreBuilder
with parameters
required.abfsStoreBuilder
- Builder for AzureBlobFileSystemStore.IOException
- Throw IOE in case of failure during constructing.public boolean isAppendBlobKey(String key)
public String getUser()
public String getPrimaryGroup()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public boolean getIsNamespaceEnabled(org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws AzureBlobFileSystemException
isNamespaceEnabled
.
if the state is UNKNOWN, it will be determined by making a GET_ACL request
to the root of the filesystem. GET_ACL call is synchronized to ensure a single
call is made to determine the namespace information in case multiple threads are
calling this method at the same time. The resolution of namespace information
would be stored back as state of isNamespaceEnabled
.tracingContext
- tracing contextAzureBlobFileSystemException
- server errors.public org.apache.hadoop.fs.azurebfs.AbfsConfiguration getAbfsConfiguration()
public Hashtable<String,String> getFilesystemProperties(org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws AzureBlobFileSystemException
AzureBlobFileSystemException
public void setFilesystemProperties(Hashtable<String,String> properties, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws AzureBlobFileSystemException
AzureBlobFileSystemException
public Hashtable<String,String> getPathStatus(Path path, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws IOException
IOException
public void setPathProperties(Path path, Hashtable<String,String> properties, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws IOException
IOException
public void createFilesystem(org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws AzureBlobFileSystemException
AzureBlobFileSystemException
public void deleteFilesystem(org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws AzureBlobFileSystemException
AzureBlobFileSystemException
public OutputStream createFile(Path path, org.apache.hadoop.fs.FileSystem.Statistics statistics, boolean overwrite, FsPermission permission, FsPermission umask, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws IOException
IOException
public void createDirectory(Path path, FsPermission permission, FsPermission umask, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws IOException
IOException
public org.apache.hadoop.fs.azurebfs.services.AbfsInputStream openFileForRead(Path path, org.apache.hadoop.fs.FileSystem.Statistics statistics, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws IOException
IOException
public org.apache.hadoop.fs.azurebfs.services.AbfsInputStream openFileForRead(Path path, Optional<org.apache.hadoop.fs.impl.OpenFileParameters> parameters, org.apache.hadoop.fs.FileSystem.Statistics statistics, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws IOException
IOException
public OutputStream openFileForWrite(Path path, org.apache.hadoop.fs.FileSystem.Statistics statistics, boolean overwrite, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws IOException
IOException
public void breakLease(Path path, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws AzureBlobFileSystemException
path
- file nametracingContext
- TracingContext instance to track correlation IDsAzureBlobFileSystemException
- on any exception while breaking the leasepublic boolean rename(Path source, Path destination, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext, String sourceEtag) throws IOException
source
- path to source filedestination
- destination of rename.tracingContext
- trace contextsourceEtag
- etag of source file. may be null or emptyAzureBlobFileSystemException
- failure, excluding any recovery from overload failures.IOException
public void delete(Path path, boolean recursive, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws AzureBlobFileSystemException
AzureBlobFileSystemException
public FileStatus getFileStatus(Path path, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws IOException
IOException
public FileStatus[] listStatus(Path path, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws IOException
listStatus
in interface org.apache.hadoop.fs.azurebfs.services.ListingSupport
path
- The list path.tracingContext
- Tracks identifiers for request headerIOException
- in case of error@InterfaceStability.Unstable public FileStatus[] listStatus(Path path, String startFrom, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws IOException
listStatus
in interface org.apache.hadoop.fs.azurebfs.services.ListingSupport
path
- Path the list path.startFrom
- the entry name that list results should start with.
For example, if folder "/folder" contains four files: "afile", "bfile", "hfile", "ifile".
Then listStatus(Path("/folder"), "hfile") will return "/folder/hfile" and "folder/ifile"
Notice that if startFrom is a non-existent entry name, then the list response contains
all entries after this non-existent entry in lexical order:
listStatus(Path("/folder"), "cfile") will return "/folder/hfile" and "/folder/ifile".tracingContext
- Tracks identifiers for request headerIOException
- in case of errorpublic String listStatus(Path path, String startFrom, List<FileStatus> fileStatuses, boolean fetchAll, String continuation, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws IOException
listStatus
in interface org.apache.hadoop.fs.azurebfs.services.ListingSupport
path
- The list pathstartFrom
- The entry name that list results should start with.
For example, if folder "/folder" contains four
files: "afile", "bfile", "hfile", "ifile". Then
listStatus(Path("/folder"), "hfile") will return
"/folder/hfile" and "folder/ifile" Notice that if
startFrom is a non-existent entry name, then the
list response contains all entries after this
non-existent entry in lexical order: listStatus
(Path("/folder"), "cfile") will return
"/folder/hfile" and "/folder/ifile".fileStatuses
- This list has to be filled with the FileStatus objectsfetchAll
- flag to indicate if the above list needs to be
filled with just one page os results or the entire
result.continuation
- Contiuation token. null means start rom the begining.tracingContext
- TracingContext instance to track identifiersIOException
- in case of errorpublic void setOwner(Path path, String owner, String group, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws AzureBlobFileSystemException
AzureBlobFileSystemException
public void setPermission(Path path, FsPermission permission, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws AzureBlobFileSystemException
AzureBlobFileSystemException
public void modifyAclEntries(Path path, List<AclEntry> aclSpec, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws AzureBlobFileSystemException
AzureBlobFileSystemException
public void removeAclEntries(Path path, List<AclEntry> aclSpec, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws AzureBlobFileSystemException
AzureBlobFileSystemException
public void removeDefaultAcl(Path path, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws AzureBlobFileSystemException
AzureBlobFileSystemException
public void removeAcl(Path path, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws AzureBlobFileSystemException
AzureBlobFileSystemException
public void setAcl(Path path, List<AclEntry> aclSpec, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws AzureBlobFileSystemException
AzureBlobFileSystemException
public AclStatus getAclStatus(Path path, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws IOException
IOException
public void access(Path path, FsAction mode, org.apache.hadoop.fs.azurebfs.utils.TracingContext tracingContext) throws AzureBlobFileSystemException
AzureBlobFileSystemException
public boolean isAtomicRenameKey(String key)
public boolean isInfiniteLeaseKey(String key)
@VisibleForTesting public org.apache.hadoop.fs.azurebfs.services.AbfsClient getClient()
public static String extractEtagHeader(org.apache.hadoop.fs.azurebfs.services.AbfsHttpOperation result)
result
- response to process.Copyright © 2024 Apache Software Foundation. All rights reserved.