@InterfaceAudience.Private public class AzureNativeFileSystemStore extends Object
| Modifier and Type | Field and 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 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 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 String |
KEY_ENABLE_FLAT_LISTING
Configuration key to enable flat listing of blobs.
|
static 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 String |
KEY_USE_LOCAL_SAS_KEY_MODE
By default the SAS Key mode is expected to run in Romote key mode.
|
static String |
KEY_USE_SECURE_MODE
Configuration keys to identify if WASB needs to run in Secure mode.
|
static org.slf4j.Logger |
LOG |
static String |
NO_ACCESS_TO_CONTAINER_MSG
The error message template when container is not accessible.
|
| Constructor and Description |
|---|
AzureNativeFileSystemStore() |
| Modifier and Type | Method and Description |
|---|---|
SelfRenewingLease |
acquireLease(String key)
Get a lease on the blob identified by key.
|
void |
changePermissionStatus(String key,
org.apache.hadoop.fs.permission.PermissionStatus newPermission)
Changes the permission status on the given key.
|
void |
close() |
boolean |
delete(String key)
API implementation to delete a blob in the back end azure storage.
|
boolean |
delete(String key,
SelfRenewingLease lease)
API implementation to delete a blob in the back end azure storage.
|
void |
dump()
Diagnostic method to dump state to the console.
|
boolean |
explicitFileExists(String key)
Checks whether an explicit file/folder exists.
|
protected void |
finalize() |
static String |
getAccountKeyFromConfiguration(String accountName,
org.apache.hadoop.conf.Configuration conf) |
BandwidthGaugeUpdater |
getBandwidthGaugeUpdater() |
long |
getHadoopBlockSize()
Returns the file block size.
|
String |
getLinkInFileMetadata(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(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(String key)
Checks if the given key in Azure storage should have synchronized
atomic folder rename createNonRecursive implemented.
|
boolean |
isBlockBlobWithCompactionKey(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(String key,
Set<String> dirSet) |
boolean |
isPageBlobKey(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(String prefix,
int maxListingCount,
int maxListingDepth) |
void |
purge(String prefix)
Delete all keys with the given prefix.
|
void |
rename(String srcKey,
String dstKey) |
void |
rename(String srcKey,
String dstKey,
boolean acquireLease,
SelfRenewingLease existingLease) |
void |
rename(String srcKey,
String dstKey,
boolean acquireLease,
SelfRenewingLease existingLease,
boolean overwriteDestination) |
InputStream |
retrieve(String key) |
InputStream |
retrieve(String key,
long startByteOffset) |
DataOutputStream |
retrieveAppendStream(String key,
int bufferSize) |
org.apache.hadoop.fs.azure.FileMetadata |
retrieveMetadata(String key) |
void |
storeEmptyFolder(String key,
org.apache.hadoop.fs.permission.PermissionStatus permissionStatus) |
void |
storeEmptyLinkFile(String key,
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.
|
DataOutputStream |
storefile(String keyEncoded,
org.apache.hadoop.fs.permission.PermissionStatus permissionStatus,
String key) |
void |
updateFolderLastModifiedTime(String key,
Date lastModified,
SelfRenewingLease folderLease) |
void |
updateFolderLastModifiedTime(String key,
SelfRenewingLease folderLease) |
public static final org.slf4j.Logger LOG
public static final String KEY_USE_SECURE_MODE
public static final String KEY_USE_LOCAL_SAS_KEY_MODE
public static final String KEY_PAGE_BLOB_DIRECTORIES
public static final String KEY_BLOCK_BLOB_WITH_COMPACTION_DIRECTORIES
public static final String KEY_ATOMIC_RENAME_DIRECTORIES
public static final String KEY_ENABLE_FLAT_LISTING
public 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 String NO_ACCESS_TO_CONTAINER_MSG
public BandwidthGaugeUpdater getBandwidthGaugeUpdater()
public void initialize(URI uri, org.apache.hadoop.conf.Configuration conf, AzureFileSystemInstrumentation instrumentation) throws IllegalArgumentException, AzureException, IOException
uri - - URI for target storage blob.conf - - reference to configuration object.instrumentation - - the metrics source that will keep track of operations here.IllegalArgumentException - if URI or job object is null, or invalid scheme.AzureExceptionIOExceptionpublic static String getAccountKeyFromConfiguration(String accountName, org.apache.hadoop.conf.Configuration conf) throws KeyProviderException
KeyProviderExceptionpublic boolean isPageBlobKey(String key)
public boolean isBlockBlobWithCompactionKey(String key)
key - blob namepublic boolean isAtomicRenameKey(String key)
public long getHadoopBlockSize()
public DataOutputStream storefile(String keyEncoded, org.apache.hadoop.fs.permission.PermissionStatus permissionStatus, String key) throws AzureException
AzureExceptionpublic void storeEmptyFolder(String key, org.apache.hadoop.fs.permission.PermissionStatus permissionStatus) throws AzureException
AzureExceptionpublic void storeEmptyLinkFile(String key, String tempBlobKey, org.apache.hadoop.fs.permission.PermissionStatus permissionStatus) throws AzureException
AzureExceptionpublic String getLinkInFileMetadata(String key) throws AzureException
AzureExceptionpublic org.apache.hadoop.fs.azure.FileMetadata retrieveMetadata(String key) throws IOException
IOExceptionpublic InputStream retrieve(String key) throws AzureException, IOException
AzureExceptionIOExceptionpublic InputStream retrieve(String key, long startByteOffset) throws AzureException, IOException
AzureExceptionIOExceptionpublic org.apache.hadoop.fs.azure.FileMetadata[] list(String prefix, int maxListingCount, int maxListingDepth) throws IOException
IOExceptionpublic boolean delete(String key, SelfRenewingLease lease) throws IOException
key - - key to the blob being deleted.lease - - Active lease on the blob.IOException - Exception encountered while deleting in
azure storage.public boolean delete(String key) throws IOException
key - - key to the blob being deleted.IOException - Exception encountered while deleting in
azure storage.public void rename(String srcKey, String dstKey) throws IOException
IOExceptionpublic void rename(String srcKey, String dstKey, boolean acquireLease, SelfRenewingLease existingLease) throws IOException
IOExceptionpublic void rename(String srcKey, String dstKey, boolean acquireLease, SelfRenewingLease existingLease, boolean overwriteDestination) throws IOException
IOExceptionpublic boolean explicitFileExists(String key) throws AzureException
AzureExceptionpublic void changePermissionStatus(String key, org.apache.hadoop.fs.permission.PermissionStatus newPermission) throws AzureException
AzureExceptionpublic void purge(String prefix) throws IOException
prefix - prefix of objects to be deleted.IOException - Exception encountered while deleting keys.public SelfRenewingLease acquireLease(String key) throws AzureException
AzureExceptionpublic void updateFolderLastModifiedTime(String key, Date lastModified, SelfRenewingLease folderLease) throws AzureException
AzureExceptionpublic void updateFolderLastModifiedTime(String key, SelfRenewingLease folderLease) throws AzureException
AzureExceptionpublic void dump()
throws IOException
IOException - Exception encountered while dumping to console.public void close()
protected void finalize()
throws Throwable
public DataOutputStream retrieveAppendStream(String key, int bufferSize) throws IOException
IOExceptionCopyright © 2008–2020 Apache Software Foundation. All rights reserved.