@Private
@VisibleForTesting
public class AzureNativeFileSystemStore
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static int |
DEFAULT_DOWNLOAD_BLOCK_SIZE |
|
static boolean |
DEFAULT_ENABLE_FLAT_LISTING |
Enable flat listing of blobs as default option.
|
static long |
DEFAULT_HADOOP_BLOCK_SIZE |
|
static int |
DEFAULT_UPLOAD_BLOCK_SIZE |
|
static boolean |
DEFAULT_USE_SECURE_MODE |
Default values to control SAS Key mode.
|
static java.lang.String |
FS_AZURE_BLOCK_BLOB_BUFFERED_PREAD_DISABLE |
Optional config to enable a lock free pread which will bypass buffer in
BlockBlobInputStream.
|
static java.lang.String |
KEY_ATOMIC_RENAME_DIRECTORIES |
Configuration key to indicate the set of directories in WASB where
we should do atomic folder rename synchronized with createNonRecursive.
|
static java.lang.String |
KEY_BLOCK_BLOB_WITH_COMPACTION_DIRECTORIES |
Configuration key to indicate the set of directories in WASB where we
should store files as block blobs with block compaction enabled.
|
static java.lang.String |
KEY_ENABLE_FLAT_LISTING |
Configuration key to enable flat listing of blobs.
|
static java.lang.String |
KEY_PAGE_BLOB_DIRECTORIES |
Configuration key to indicate the set of directories in WASB where we
should store files as page blobs instead of block blobs.
|
static java.lang.String |
KEY_USE_LOCAL_SAS_KEY_MODE |
By default the SAS Key mode is expected to run in Romote key mode.
|
static java.lang.String |
KEY_USE_SECURE_MODE |
Configuration keys to identify if WASB needs to run in Secure mode.
|
static org.slf4j.Logger |
LOG |
|
static java.lang.String |
NO_ACCESS_TO_CONTAINER_MSG |
The error message template when container is not accessible.
|
| Constructor | Description |
|---|---|
AzureNativeFileSystemStore() |
| Modifier and Type | Method | Description |
|---|---|---|
SelfRenewingLease |
acquireLease(java.lang.String key) |
Get a lease on the blob identified by key.
|
void |
changePermissionStatus(java.lang.String key,
org.apache.hadoop.fs.permission.PermissionStatus newPermission) |
Changes the permission status on the given key.
|
void |
close() |
|
boolean |
delete(java.lang.String key) |
API implementation to delete a blob in the back end azure storage.
|
boolean |
delete(java.lang.String key,
SelfRenewingLease lease) |
API implementation to delete a blob in the back end azure storage.
|
void |
dump() |
|
boolean |
explicitFileExists(java.lang.String key) |
Checks whether an explicit file/folder exists.
|
protected void |
finalize() |
|
static java.lang.String |
getAccountKeyFromConfiguration(java.lang.String accountName,
org.apache.hadoop.conf.Configuration conf) |
|
BandwidthGaugeUpdater |
getBandwidthGaugeUpdater() |
|
long |
getHadoopBlockSize() |
Returns the file block size.
|
java.lang.String |
getLinkInFileMetadata(java.lang.String key) |
If the blob with the given key exists and has a link in its metadata to a
temporary file (see storeEmptyLinkFile), this method returns the key to
that temporary file.
|
void |
initialize(java.net.URI uri,
org.apache.hadoop.conf.Configuration conf,
AzureFileSystemInstrumentation instrumentation) |
Method for the URI and configuration object necessary to create a storage
session with an Azure session.
|
boolean |
isAtomicRenameKey(java.lang.String key) |
Checks if the given key in Azure storage should have synchronized
atomic folder rename createNonRecursive implemented.
|
boolean |
isBlockBlobWithCompactionKey(java.lang.String key) |
Checks if the given key in Azure Storage should be stored as a block blobs
with compaction enabled instead of normal block blob.
|
boolean |
isKeyForDirectorySet(java.lang.String key,
java.util.Set<java.lang.String> dirSet) |
|
boolean |
isPageBlobKey(java.lang.String key) |
Checks if the given key in Azure Storage should be stored as a page
blob instead of block blob.
|
org.apache.hadoop.fs.azure.FileMetadata[] |
list(java.lang.String prefix,
int maxListingCount,
int maxListingDepth) |
|
void |
purge(java.lang.String prefix) |
|
void |
rename(java.lang.String srcKey,
java.lang.String dstKey) |
|
void |
rename(java.lang.String srcKey,
java.lang.String dstKey,
boolean acquireLease,
SelfRenewingLease existingLease) |
|
void |
rename(java.lang.String srcKey,
java.lang.String dstKey,
boolean acquireLease,
SelfRenewingLease existingLease,
boolean overwriteDestination) |
|
java.io.InputStream |
retrieve(java.lang.String key) |
|
java.io.InputStream |
retrieve(java.lang.String key,
long startByteOffset) |
|
java.io.InputStream |
retrieve(java.lang.String key,
long startByteOffset,
java.util.Optional<org.apache.hadoop.conf.Configuration> options) |
|
java.io.DataOutputStream |
retrieveAppendStream(java.lang.String key,
int bufferSize) |
|
byte[] |
retrieveAttribute(java.lang.String key,
java.lang.String attribute) |
|
org.apache.hadoop.fs.azure.FileMetadata |
retrieveMetadata(java.lang.String key) |
|
void |
storeAttribute(java.lang.String key,
java.lang.String attribute,
byte[] value) |
|
void |
storeEmptyFolder(java.lang.String key,
org.apache.hadoop.fs.permission.PermissionStatus permissionStatus) |
|
void |
storeEmptyLinkFile(java.lang.String key,
java.lang.String tempBlobKey,
org.apache.hadoop.fs.permission.PermissionStatus permissionStatus) |
Stores an empty blob that's linking to the temporary file where're we're
uploading the initial data.
|
java.io.DataOutputStream |
storefile(java.lang.String keyEncoded,
org.apache.hadoop.fs.permission.PermissionStatus permissionStatus,
java.lang.String key) |
|
void |
updateFolderLastModifiedTime(java.lang.String key,
java.util.Date lastModified,
SelfRenewingLease folderLease) |
|
void |
updateFolderLastModifiedTime(java.lang.String key,
SelfRenewingLease folderLease) |
public static final org.slf4j.Logger LOG
@VisibleForTesting public static final java.lang.String KEY_USE_SECURE_MODE
public static final java.lang.String KEY_USE_LOCAL_SAS_KEY_MODE
public static final java.lang.String KEY_PAGE_BLOB_DIRECTORIES
public static final java.lang.String KEY_BLOCK_BLOB_WITH_COMPACTION_DIRECTORIES
public static final java.lang.String KEY_ATOMIC_RENAME_DIRECTORIES
public static final java.lang.String KEY_ENABLE_FLAT_LISTING
public static final java.lang.String FS_AZURE_BLOCK_BLOB_BUFFERED_PREAD_DISABLE
FileSystem.openFile(org.apache.hadoop.fs.Path),
Constant Field Valuespublic static final int DEFAULT_DOWNLOAD_BLOCK_SIZE
public static final int DEFAULT_UPLOAD_BLOCK_SIZE
public static final long DEFAULT_HADOOP_BLOCK_SIZE
public static final boolean DEFAULT_USE_SECURE_MODE
public static final boolean DEFAULT_ENABLE_FLAT_LISTING
public static final java.lang.String NO_ACCESS_TO_CONTAINER_MSG
@VisibleForTesting public BandwidthGaugeUpdater getBandwidthGaugeUpdater()
public void initialize(java.net.URI uri,
org.apache.hadoop.conf.Configuration conf,
AzureFileSystemInstrumentation instrumentation)
throws java.lang.IllegalArgumentException,
AzureException,
java.io.IOException
uri - - URI for target storage blob.conf - - reference to configuration object.instrumentation - - the metrics source that will keep track of operations here.java.lang.IllegalArgumentException - if URI or job object is null, or invalid scheme.AzureExceptionjava.io.IOException@VisibleForTesting
public static java.lang.String getAccountKeyFromConfiguration(java.lang.String accountName,
org.apache.hadoop.conf.Configuration conf)
throws KeyProviderException
KeyProviderExceptionpublic boolean isPageBlobKey(java.lang.String key)
public boolean isBlockBlobWithCompactionKey(java.lang.String key)
key - blob namepublic boolean isAtomicRenameKey(java.lang.String key)
public boolean isKeyForDirectorySet(java.lang.String key,
java.util.Set<java.lang.String> dirSet)
public long getHadoopBlockSize()
public java.io.DataOutputStream storefile(java.lang.String keyEncoded,
org.apache.hadoop.fs.permission.PermissionStatus permissionStatus,
java.lang.String key)
throws AzureException
AzureExceptionpublic void storeEmptyFolder(java.lang.String key,
org.apache.hadoop.fs.permission.PermissionStatus permissionStatus)
throws AzureException
AzureExceptionpublic void storeEmptyLinkFile(java.lang.String key,
java.lang.String tempBlobKey,
org.apache.hadoop.fs.permission.PermissionStatus permissionStatus)
throws AzureException
AzureExceptionpublic java.lang.String getLinkInFileMetadata(java.lang.String key)
throws AzureException
AzureExceptionpublic org.apache.hadoop.fs.azure.FileMetadata retrieveMetadata(java.lang.String key)
throws java.io.IOException
java.io.IOExceptionpublic byte[] retrieveAttribute(java.lang.String key,
java.lang.String attribute)
throws java.io.IOException
java.io.IOExceptionpublic void storeAttribute(java.lang.String key,
java.lang.String attribute,
byte[] value)
throws java.io.IOException
java.io.IOExceptionpublic java.io.InputStream retrieve(java.lang.String key)
throws AzureException,
java.io.IOException
AzureExceptionjava.io.IOExceptionpublic java.io.InputStream retrieve(java.lang.String key,
long startByteOffset)
throws AzureException,
java.io.IOException
AzureExceptionjava.io.IOExceptionpublic java.io.InputStream retrieve(java.lang.String key,
long startByteOffset,
java.util.Optional<org.apache.hadoop.conf.Configuration> options)
throws AzureException,
java.io.IOException
AzureExceptionjava.io.IOExceptionpublic org.apache.hadoop.fs.azure.FileMetadata[] list(java.lang.String prefix,
int maxListingCount,
int maxListingDepth)
throws java.io.IOException
java.io.IOExceptionpublic boolean delete(java.lang.String key,
SelfRenewingLease lease)
throws java.io.IOException
java.io.IOExceptionpublic boolean delete(java.lang.String key)
throws java.io.IOException
java.io.IOExceptionpublic void rename(java.lang.String srcKey,
java.lang.String dstKey)
throws java.io.IOException
java.io.IOExceptionpublic void rename(java.lang.String srcKey,
java.lang.String dstKey,
boolean acquireLease,
SelfRenewingLease existingLease)
throws java.io.IOException
java.io.IOExceptionpublic void rename(java.lang.String srcKey,
java.lang.String dstKey,
boolean acquireLease,
SelfRenewingLease existingLease,
boolean overwriteDestination)
throws java.io.IOException
java.io.IOExceptionpublic boolean explicitFileExists(java.lang.String key)
throws AzureException
AzureExceptionpublic void changePermissionStatus(java.lang.String key,
org.apache.hadoop.fs.permission.PermissionStatus newPermission)
throws AzureException
AzureExceptionpublic void purge(java.lang.String prefix)
throws java.io.IOException
java.io.IOExceptionpublic SelfRenewingLease acquireLease(java.lang.String key) throws AzureException
AzureExceptionpublic void updateFolderLastModifiedTime(java.lang.String key,
java.util.Date lastModified,
SelfRenewingLease folderLease)
throws AzureException
AzureExceptionpublic void updateFolderLastModifiedTime(java.lang.String key,
SelfRenewingLease folderLease)
throws AzureException
AzureExceptionpublic void dump()
throws java.io.IOException
java.io.IOExceptionpublic void close()
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic java.io.DataOutputStream retrieveAppendStream(java.lang.String key,
int bufferSize)
throws java.io.IOException
java.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.