@InterfaceAudience.Private public class AzureNativeFileSystemStore extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_DOWNLOAD_BLOCK_SIZE |
static int |
DEFAULT_UPLOAD_BLOCK_SIZE |
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_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 org.apache.commons.logging.Log |
LOG |
| 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,
PermissionStatus newPermission)
Changes the permission status on the given key.
|
void |
close() |
void |
delete(String key) |
void |
delete(String key,
SelfRenewingLease lease) |
void |
dump()
Diagnostic method to dump state to the console.
|
protected void |
finalize() |
static String |
getAccountKeyFromConfiguration(String accountName,
Configuration conf) |
BandwidthGaugeUpdater |
getBandwidthGaugeUpdater() |
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,
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 |
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.PartialListing |
list(String prefix,
int maxListingCount,
int maxListingDepth) |
org.apache.hadoop.fs.azure.PartialListing |
list(String prefix,
int maxListingCount,
int maxListingDepth,
String priorLastKey) |
org.apache.hadoop.fs.azure.PartialListing |
listAll(String prefix,
int maxListingCount,
int maxListingDepth,
String priorLastKey) |
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) |
DataInputStream |
retrieve(String key) |
DataInputStream |
retrieve(String key,
long startByteOffset) |
org.apache.hadoop.fs.azure.FileMetadata |
retrieveMetadata(String key) |
void |
storeEmptyFolder(String key,
PermissionStatus permissionStatus) |
void |
storeEmptyLinkFile(String key,
String tempBlobKey,
PermissionStatus permissionStatus)
Stores an empty blob that's linking to the temporary file where're we're
uploading the initial data.
|
DataOutputStream |
storefile(String key,
PermissionStatus permissionStatus) |
void |
updateFolderLastModifiedTime(String key,
Date lastModified,
SelfRenewingLease folderLease) |
void |
updateFolderLastModifiedTime(String key,
SelfRenewingLease folderLease) |
public static final org.apache.commons.logging.Log LOG
public static final String KEY_PAGE_BLOB_DIRECTORIES
public static final String KEY_ATOMIC_RENAME_DIRECTORIES
public static final int DEFAULT_DOWNLOAD_BLOCK_SIZE
public static final int DEFAULT_UPLOAD_BLOCK_SIZE
public BandwidthGaugeUpdater getBandwidthGaugeUpdater()
public void initialize(URI uri, 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, Configuration conf) throws KeyProviderException
KeyProviderExceptionpublic boolean isPageBlobKey(String key)
public boolean isAtomicRenameKey(String key)
public DataOutputStream storefile(String key, PermissionStatus permissionStatus) throws AzureException
AzureExceptionpublic void storeEmptyFolder(String key, PermissionStatus permissionStatus) throws AzureException
AzureExceptionpublic void storeEmptyLinkFile(String key, String tempBlobKey, PermissionStatus permissionStatus) throws AzureException
AzureExceptionpublic String getLinkInFileMetadata(String key) throws AzureException
AzureExceptionpublic org.apache.hadoop.fs.azure.FileMetadata retrieveMetadata(String key) throws IOException
IOExceptionpublic DataInputStream retrieve(String key) throws AzureException, IOException
AzureExceptionIOExceptionpublic DataInputStream retrieve(String key, long startByteOffset) throws AzureException, IOException
AzureExceptionIOExceptionpublic org.apache.hadoop.fs.azure.PartialListing list(String prefix, int maxListingCount, int maxListingDepth) throws IOException
IOExceptionpublic org.apache.hadoop.fs.azure.PartialListing list(String prefix, int maxListingCount, int maxListingDepth, String priorLastKey) throws IOException
IOExceptionpublic org.apache.hadoop.fs.azure.PartialListing listAll(String prefix, int maxListingCount, int maxListingDepth, String priorLastKey) throws IOException
IOExceptionpublic void delete(String key, SelfRenewingLease lease) throws IOException
IOExceptionpublic void delete(String key) throws IOException
IOExceptionpublic void rename(String srcKey, String dstKey) throws IOException
IOExceptionpublic void rename(String srcKey, String dstKey, boolean acquireLease, SelfRenewingLease existingLease) throws IOException
IOExceptionpublic void changePermissionStatus(String key, PermissionStatus newPermission) throws AzureException
AzureExceptionpublic void purge(String prefix) throws IOException
IOExceptionpublic 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
IOExceptionpublic void close()
Copyright © 2018 CERN. All Rights Reserved.