public class AbfsClient extends Object implements Closeable
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
AbfsClient(URL baseUrl,
SharedKeyCredentials sharedKeyCredentials,
AbfsConfiguration abfsConfiguration,
AccessTokenProvider tokenProvider,
AbfsClientContext abfsClientContext) |
AbfsClient(URL baseUrl,
SharedKeyCredentials sharedKeyCredentials,
AbfsConfiguration abfsConfiguration,
SASTokenProvider sasTokenProvider,
AbfsClientContext abfsClientContext) |
| Modifier and Type | Method and Description |
|---|---|
AbfsRestOperation |
acquireLease(String path,
int duration) |
<V> void |
addCallback(org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<V> future,
org.apache.hadoop.thirdparty.com.google.common.util.concurrent.FutureCallback<V> callback) |
AbfsRestOperation |
append(String path,
byte[] buffer,
AppendRequestParameters reqParams,
String cachedSasToken) |
boolean |
appendSuccessCheckOp(AbfsRestOperation op,
String path,
long length) |
AbfsRestOperation |
breakLease(String path) |
AbfsRestOperation |
checkAccess(String path,
String rwx)
Talks to the server to check whether the permission specified in
the rwx parameter is present for the path specified in the path parameter.
|
void |
close() |
AbfsRestOperation |
createFilesystem() |
AbfsRestOperation |
createPath(String path,
boolean isFile,
boolean overwrite,
String permission,
String umask,
boolean isAppendBlob,
String eTag) |
protected URL |
createRequestUrl(String path,
String query) |
AbfsRestOperation |
deleteFilesystem() |
AbfsRestOperation |
deleteIdempotencyCheckOp(AbfsRestOperation op)
Check if the delete request failure is post a retry and if delete failure
qualifies to be a success response assuming idempotency.
|
AbfsRestOperation |
deletePath(String path,
boolean recursive,
String continuation) |
AbfsRestOperation |
flush(String path,
long position,
boolean retainUncommittedData,
boolean isClose,
String cachedSasToken,
String leaseId) |
protected AbfsCounters |
getAbfsCounters()
Getter for abfsCounters from AbfsClient.
|
protected AbfsPerfTracker |
getAbfsPerfTracker() |
String |
getAccessToken() |
AbfsRestOperation |
getAclStatus(String path) |
AbfsRestOperation |
getAclStatus(String path,
boolean useUPN) |
AuthType |
getAuthType() |
static String |
getDirectoryQueryParameter(String path)
Get the directory query parameter used by the List Paths REST API and used
as the path in the continuation token.
|
String |
getFileSystem() |
AbfsRestOperation |
getFilesystemProperties() |
int |
getNumLeaseThreads() |
AbfsRestOperation |
getPathStatus(String path,
boolean includeProperties) |
SASTokenProvider |
getSasTokenProvider() |
AbfsRestOperation |
listPath(String relativePath,
boolean recursive,
int listMaxResults,
String continuation) |
AbfsRestOperation |
read(String path,
long position,
byte[] buffer,
int bufferOffset,
int bufferLength,
String eTag,
String cachedSasToken) |
AbfsRestOperation |
releaseLease(String path,
String leaseId) |
AbfsRestOperation |
renameIdempotencyCheckOp(Instant renameRequestStartTime,
AbfsRestOperation op,
String destination)
Check if the rename request failure is post a retry and if earlier rename
request might have succeeded at back-end.
|
AbfsRestOperation |
renamePath(String source,
String destination,
String continuation) |
AbfsRestOperation |
renewLease(String path,
String leaseId) |
<V> org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableScheduledFuture<V> |
schedule(Callable<V> callable,
long delay,
TimeUnit timeUnit) |
AbfsRestOperation |
setAcl(String path,
String aclSpecString) |
AbfsRestOperation |
setAcl(String path,
String aclSpecString,
String eTag) |
AbfsRestOperation |
setFilesystemProperties(String properties) |
AbfsRestOperation |
setOwner(String path,
String owner,
String group) |
AbfsRestOperation |
setPathProperties(String path,
String properties) |
AbfsRestOperation |
setPermission(String path,
String permission) |
org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<?> |
submit(Runnable runnable) |
static String |
urlEncode(String value) |
public AbfsClient(URL baseUrl, SharedKeyCredentials sharedKeyCredentials, AbfsConfiguration abfsConfiguration, AccessTokenProvider tokenProvider, AbfsClientContext abfsClientContext) throws IOException
IOExceptionpublic AbfsClient(URL baseUrl, SharedKeyCredentials sharedKeyCredentials, AbfsConfiguration abfsConfiguration, SASTokenProvider sasTokenProvider, AbfsClientContext abfsClientContext) throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic String getFileSystem()
protected AbfsPerfTracker getAbfsPerfTracker()
public AbfsRestOperation createFilesystem() throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation setFilesystemProperties(String properties) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation listPath(String relativePath, boolean recursive, int listMaxResults, String continuation) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation getFilesystemProperties() throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation deleteFilesystem() throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation createPath(String path, boolean isFile, boolean overwrite, String permission, String umask, boolean isAppendBlob, String eTag) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation acquireLease(String path, int duration) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation renewLease(String path, String leaseId) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation releaseLease(String path, String leaseId) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation breakLease(String path) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation renamePath(String source, String destination, String continuation) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation renameIdempotencyCheckOp(Instant renameRequestStartTime, AbfsRestOperation op, String destination) throws AzureBlobFileSystemException
renameRequestStartTime - startTime for the rename requestop - Rename request REST operation responsedestination - rename destination pathAzureBlobFileSystemException - if GetFileStatus hits any exceptionpublic AbfsRestOperation append(String path, byte[] buffer, AppendRequestParameters reqParams, String cachedSasToken) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic boolean appendSuccessCheckOp(AbfsRestOperation op, String path, long length) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation flush(String path, long position, boolean retainUncommittedData, boolean isClose, String cachedSasToken, String leaseId) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation setPathProperties(String path, String properties) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation getPathStatus(String path, boolean includeProperties) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation read(String path, long position, byte[] buffer, int bufferOffset, int bufferLength, String eTag, String cachedSasToken) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation deletePath(String path, boolean recursive, String continuation) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation deleteIdempotencyCheckOp(AbfsRestOperation op)
op - Delete request REST operation responsepublic AbfsRestOperation setOwner(String path, String owner, String group) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation setPermission(String path, String permission) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation setAcl(String path, String aclSpecString) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation setAcl(String path, String aclSpecString, String eTag) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation getAclStatus(String path) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation getAclStatus(String path, boolean useUPN) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic AbfsRestOperation checkAccess(String path, String rwx) throws AzureBlobFileSystemException
path - Path for which access check needs to be performedrwx - The permission to be checked on the pathAbfsRestOperation object for the operationAzureBlobFileSystemException - in case of bad requestspublic static String getDirectoryQueryParameter(String path)
path - the path to be listed.protected URL createRequestUrl(String path, String query) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic static String urlEncode(String value) throws AzureBlobFileSystemException
AzureBlobFileSystemExceptionpublic String getAccessToken() throws IOException
IOExceptionpublic AuthType getAuthType()
public SASTokenProvider getSasTokenProvider()
protected AbfsCounters getAbfsCounters()
public int getNumLeaseThreads()
public <V> org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit timeUnit)
public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<?> submit(Runnable runnable)
public <V> void addCallback(org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<V> future,
org.apache.hadoop.thirdparty.com.google.common.util.concurrent.FutureCallback<V> callback)
Copyright © 2008–2021 Apache Software Foundation. All rights reserved.