@InterfaceAudience.Private @InterfaceStability.Evolving public class S3AFileSystem extends org.apache.hadoop.fs.FileSystem implements org.apache.hadoop.fs.StreamCapabilities, AWSPolicyProvider, DelegationTokenProvider, org.apache.hadoop.fs.statistics.IOStatisticsSource, org.apache.hadoop.fs.store.audit.AuditSpanSource<AuditSpanS3A>, org.apache.hadoop.fs.store.audit.ActiveThreadSpanSource<AuditSpanS3A>
FileSystem.get(Configuration)
and variants to
create one.
If cast to S3AFileSystem
, extra methods and features may be accessed.
Consider those private and unstable.
Because it prints some of the state of the instrumentation,
the output of toString()
must also be considered unstable.Modifier and Type | Class and Description |
---|---|
protected class |
S3AFileSystem.CopyFromLocalCallbacksImpl |
protected class |
S3AFileSystem.GetContentSummaryCallbacksImpl
Callbacks from the
GetContentSummaryOperation . |
protected class |
S3AFileSystem.HeaderProcessingCallbacksImpl
Operations needed for Header Processing.
|
protected class |
S3AFileSystem.ListingOperationCallbacksImpl
Callbacks from
Listing . |
protected class |
S3AFileSystem.MkdirOperationCallbacksImpl
Callbacks from the
MkdirOperation . |
org.apache.hadoop.fs.FileSystem.DirectoryEntries, org.apache.hadoop.fs.FileSystem.DirListingIterator<T extends org.apache.hadoop.fs.FileStatus>, org.apache.hadoop.fs.FileSystem.Statistics
org.apache.hadoop.fs.StreamCapabilities.StreamCapability
AWSPolicyProvider.AccessLevel
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BLOCKSIZE
Default blocksize as used in blocksize and FS status queries.
|
static org.slf4j.Logger |
LOG |
DEFAULT_FS, FS_DEFAULT_NAME_KEY, SHUTDOWN_HOOK_PRIORITY, statistics, TRASH_PREFIX, USER_HOME_PREFIX
Constructor and Description |
---|
S3AFileSystem() |
Modifier and Type | Method and Description |
---|---|
void |
abortMultipartUpload(software.amazon.awssdk.services.s3.model.MultipartUpload upload)
Abort a multipart upload.
|
void |
abortMultipartUpload(String destKey,
String uploadId)
Abort a multipart upload.
|
void |
abortOutstandingMultipartUploads(long seconds)
Abort all outstanding MPUs older than a given age.
|
void |
access(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsAction mode)
Soft check of access by forwarding to the audit manager
and so on to the auditor.
|
boolean |
allowAuthoritative(org.apache.hadoop.fs.Path path)
Is a path to be considered as authoritative?
is a store with the supplied path under
one of the paths declared as authoritative.
|
org.apache.hadoop.fs.FSDataOutputStream |
append(org.apache.hadoop.fs.Path f,
int bufferSize,
org.apache.hadoop.util.Progressable progress)
Append to an existing file (optional operation).
|
boolean |
cancelDeleteOnExit(org.apache.hadoop.fs.Path f)
Cancel the scheduled deletion of the path when the FileSystem is closed.
|
protected URI |
canonicalizeUri(URI rawUri)
Override the base canonicalization logic and relay to
S3xLoginHelper.canonicalizeUri(URI, int) . |
void |
checkPath(org.apache.hadoop.fs.Path path)
Check that a Path belongs to this FileSystem.
|
void |
close()
Close the filesystem.
|
protected S3ListResult |
continueListObjects(S3ListRequest request,
S3ListResult prevResult,
org.apache.hadoop.fs.statistics.DurationTrackerFactory trackerFactory)
List the next set of objects.
|
void |
copyFromLocalFile(boolean delSrc,
boolean overwrite,
org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst)
The src file is on the local disk.
|
org.apache.hadoop.fs.FSDataOutputStream |
create(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission permission,
boolean overwrite,
int bufferSize,
short replication,
long blockSize,
org.apache.hadoop.util.Progressable progress)
Create an FSDataOutputStream at the indicated Path with write-progress
reporting.
|
protected CopyFromLocalOperation.CopyFromLocalOperationCallbacks |
createCopyFromLocalCallbacks(AuditSpanS3A span)
Create the CopyFromLocalCallbacks;
protected to assist in mocking.
|
DelegationOperations |
createDelegationOperations()
Create an instance of the delegation operations.
|
org.apache.hadoop.fs.FSDataOutputStreamBuilder |
createFile(org.apache.hadoop.fs.Path path)
Create instance of an FSDataOutputStreamBuilder for
creating a file at the given path.
|
protected GetContentSummaryOperation.GetContentSummaryCallbacks |
createGetContentSummaryCallbacks()
Override point: create the callbacks for getContentSummary.
|
protected HeaderProcessing.HeaderProcessingCallbacks |
createHeaderProcessingCallbacks()
Create the callbacks.
|
S3ListRequest |
createListObjectsRequest(String key,
String delimiter)
Create a
ListObjectsRequest request against this bucket,
with the maximum keys returned in a query set by maxKeys . |
MarkerToolOperations |
createMarkerToolOperations(String target)
Create a marker tools operations binding for this store.
|
MkdirOperation.MkdirCallbacks |
createMkdirOperationCallbacks()
Override point: create the callbacks for Mkdir.
|
S3AMultipartUploaderBuilder |
createMultipartUploader(org.apache.hadoop.fs.Path basePath) |
org.apache.hadoop.fs.FSDataOutputStream |
createNonRecursive(org.apache.hadoop.fs.Path p,
org.apache.hadoop.fs.permission.FsPermission permission,
EnumSet<org.apache.hadoop.fs.CreateFlag> flags,
int bufferSize,
short replication,
long blockSize,
org.apache.hadoop.util.Progressable progress)
The S3A implementations downgrades to the recursive creation, to avoid
any race conditions with parent entries "disappearing".
|
protected S3AReadOpContext |
createReadContext(org.apache.hadoop.fs.FileStatus fileStatus,
org.apache.hadoop.fs.store.audit.AuditSpan auditSpan)
Create the read context for reading from the referenced file,
using FS state as well as the status.
|
protected RequestFactory |
createRequestFactory()
Build the request factory.
|
protected S3AInternals |
createS3AInternals()
Create the S3AInternals; left as something mocking
subclasses may want to override.
|
AuditSpanS3A |
createSpan(String operation,
String path1,
String path2)
Start an operation; this informs the audit service of the event
and then sets it as the active span.
|
protected static S3AStorageStatistics |
createStorageStatistics(org.apache.hadoop.fs.statistics.IOStatistics ioStatistics)
Create the storage statistics or bind to an existing one.
|
StoreContext |
createStoreContext()
Build an immutable store context.
|
WriteOperationHelper |
createWriteOperationHelper(org.apache.hadoop.fs.store.audit.AuditSpan auditSpan)
Create a Write Operation Helper with the given span.
|
protected void |
decrementGauge(Statistic statistic,
long count)
Decrement a gauge by a specific value.
|
boolean |
delete(org.apache.hadoop.fs.Path f,
boolean recursive)
Delete a Path.
|
protected void |
deleteObject(String key)
Delete an object.
|
boolean |
deleteOnExit(org.apache.hadoop.fs.Path f)
This override bypasses checking for existence.
|
protected boolean |
deleteWithoutCloseCheck(org.apache.hadoop.fs.Path f,
boolean recursive)
Same as delete(), except that it does not check if fs is closed.
|
protected org.apache.hadoop.fs.store.audit.AuditSpan |
entryPoint(Statistic operation,
org.apache.hadoop.fs.Path path)
Entry point to an operation.
|
protected org.apache.hadoop.fs.store.audit.AuditSpan |
entryPoint(Statistic operation,
String path1,
String path2)
Entry point to an operation.
|
boolean |
exists(org.apache.hadoop.fs.Path f)
Override superclass so as to add statistic collection.
|
AuditSpanS3A |
getActiveAuditSpan()
Get the active audit span.
|
org.apache.hadoop.security.token.DelegationTokenIssuer[] |
getAdditionalTokenIssuers()
Ask any DT plugin for any extra token issuers.
|
AuditManagerS3A |
getAuditManager()
The audit manager.
|
OperationAuditor |
getAuditor()
Get the auditor; valid once initialized.
|
org.apache.hadoop.fs.store.audit.AuditSpanSource |
getAuditSpanSource()
Get the audit span source; allows for components like the committers
to have a source of spans without being hard coded to the FS only.
|
String |
getBucket()
Get the bucket of this filesystem.
|
String |
getBucketLocation()
S3AInternals method.
|
protected software.amazon.awssdk.services.s3.model.HeadBucketResponse |
getBucketMetadata()
Request bucket metadata.
|
String |
getCanonicalServiceName()
Return a service name iff delegation tokens are enabled and the
token binding is issuing delegation tokens.
|
URI |
getCanonicalUri()
Get the canonical URI.
|
ChangeDetectionPolicy |
getChangeDetectionPolicy()
Get the change detection policy for this FS instance.
|
org.apache.hadoop.fs.ContentSummary |
getContentSummary(org.apache.hadoop.fs.Path f)
This is a very slow operation against object storage.
|
long |
getDefaultBlockSize()
Return the number of bytes that large input files should be optimally
be split into to minimize I/O time.
|
int |
getDefaultPort() |
org.apache.hadoop.security.token.Token<AbstractS3ATokenIdentifier> |
getDelegationToken(String renewer)
Get a delegation token if the FS is set up for them.
|
Optional<S3ADelegationTokens> |
getDelegationTokens()
Get the delegation token support for this filesystem;
not null iff delegation support is enabled.
|
DirectoryPolicy |
getDirectoryMarkerPolicy()
Get the directory marker policy of this filesystem.
|
protected org.apache.hadoop.fs.statistics.DurationTrackerFactory |
getDurationTrackerFactory()
Get the factory for duration tracking.
|
EncryptionSecrets |
getEncryptionSecrets()
Get the encryption secrets.
|
org.apache.hadoop.fs.store.EtagChecksum |
getFileChecksum(org.apache.hadoop.fs.Path f,
long length)
When enabled, get the etag of a object at the path via HEAD request and
return it as a checksum object.
|
org.apache.hadoop.fs.FileStatus |
getFileStatus(org.apache.hadoop.fs.Path f)
Return a file status object that represents the path.
|
org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> |
getFsDelegationToken() |
org.apache.hadoop.fs.FileSystem.Statistics |
getFsStatistics()
Get FS Statistic for this S3AFS instance.
|
S3AInputPolicy |
getInputPolicy()
Get the input policy for this FS instance.
|
S3AInstrumentation |
getInstrumentation()
Get S3A Instrumentation.
|
org.apache.hadoop.fs.statistics.IOStatistics |
getIOStatistics()
Get the instrumentation's IOStatistics.
|
Listing |
getListing()
Get current listing instance.
|
long |
getMultiPartThreshold()
Get the threshold for multipart files.
|
software.amazon.awssdk.services.s3.model.HeadObjectResponse |
getObjectMetadata(org.apache.hadoop.fs.Path path)
Deprecated.
use S3AInternals API.
|
protected software.amazon.awssdk.services.s3.model.HeadObjectResponse |
getObjectMetadata(String key,
ChangeTracker changeTracker,
Invoker changeInvoker,
String operation)
Request object metadata; increments counters in the process.
|
org.apache.hadoop.security.UserGroupInformation |
getOwner()
Get the owner of this FS: who created it?
|
long |
getPartitionSize()
Get the partition size for multipart operations.
|
RequestFactory |
getRequestFactory()
Get the request factory which uses this store's audit span.
|
S3AInternals |
getS3AInternals()
Get the S3AInternals.
|
S3AEncryptionMethods |
getS3EncryptionAlgorithm()
Get the encryption algorithm of this connector.
|
String |
getScheme()
Return the protocol scheme for the FileSystem.
|
S3AStorageStatistics |
getStorageStatistics()
Get the storage statistics of this filesystem.
|
URI |
getUri()
Returns a URI whose scheme and authority identify this FileSystem.
|
String |
getUsername()
Get the username of the FS.
|
org.apache.hadoop.fs.Path |
getWorkingDirectory()
Get the current working directory for the given file system.
|
WriteOperationHelper |
getWriteOperationHelper()
Create a Write Operation Helper with the current active span.
|
byte[] |
getXAttr(org.apache.hadoop.fs.Path path,
String name) |
Map<String,byte[]> |
getXAttrs(org.apache.hadoop.fs.Path path) |
Map<String,byte[]> |
getXAttrs(org.apache.hadoop.fs.Path path,
List<String> names) |
org.apache.hadoop.fs.FileStatus[] |
globStatus(org.apache.hadoop.fs.Path pathPattern)
Increments the statistic
Statistic.INVOCATION_GLOB_STATUS . |
org.apache.hadoop.fs.FileStatus[] |
globStatus(org.apache.hadoop.fs.Path pathPattern,
org.apache.hadoop.fs.PathFilter filter)
Increments the statistic
Statistic.INVOCATION_GLOB_STATUS . |
boolean |
hasCapability(String capability)
Deprecated.
|
boolean |
hasPathCapability(org.apache.hadoop.fs.Path path,
String capability) |
protected void |
incrementGauge(Statistic statistic,
long count)
Increment a gauge by a specific value.
|
void |
incrementPutCompletedStatistics(boolean success,
long bytes)
At the end of a put/multipart upload operation, update the
relevant counters and gauges.
|
void |
incrementPutProgressStatistics(String key,
long bytes)
Callback for use in progress callbacks from put/multipart upload events.
|
void |
incrementPutStartStatistics(long bytes)
At the start of a put/multipart upload operation, update the
relevant counters.
|
void |
incrementReadOperations()
Increment read operations.
|
protected void |
incrementStatistic(Statistic statistic)
Increment a statistic by 1.
|
protected void |
incrementStatistic(Statistic statistic,
long count)
Increment a statistic by a specific value.
|
void |
incrementWriteOperations()
Increment the write operation counter.
|
void |
initialize(URI name,
org.apache.hadoop.conf.Configuration originalConf)
Called after a new FileSystem instance is constructed.
|
protected void |
initializeAuditService()
Initialize and launch the audit manager and service.
|
static void |
initializeClass()
This is purely for testing, as it force initializes all static
initializers.
|
protected void |
initializeStatisticsBinding()
Initialize the statistics binding.
|
boolean |
isCSEEnabled()
a method to know if Client side encryption is enabled or not.
|
boolean |
isDirectory(org.apache.hadoop.fs.Path f)
Optimized probe for a path referencing a dir.
|
boolean |
isFile(org.apache.hadoop.fs.Path f)
Optimized probe for a path referencing a file.
|
boolean |
isMagicCommitEnabled()
Is magic commit enabled?
|
boolean |
isMagicCommitPath(org.apache.hadoop.fs.Path path)
Predicate: is a path a magic commit path?
True if magic commit is enabled and the path qualifies as special,
and is not a a .pending or .pendingset file,
|
boolean |
isMultipartUploadEnabled() |
org.apache.hadoop.fs.Path |
keyToQualifiedPath(String key)
Convert a key to a fully qualified path.
|
List<RoleModel.Statement> |
listAWSPolicyRules(Set<AWSPolicyProvider.AccessLevel> access)
Build the AWS policy for restricted access to the resources needed
by this bucket.
|
org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus> |
listFiles(org.apache.hadoop.fs.Path f,
boolean recursive)
.
|
org.apache.hadoop.fs.RemoteIterator<S3ALocatedFileStatus> |
listFilesAndEmptyDirectories(org.apache.hadoop.fs.Path f,
boolean recursive)
Recursive List of files and empty directories.
|
org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus> |
listLocatedStatus(org.apache.hadoop.fs.Path f)
Override superclass so as to add statistic collection.
|
org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus> |
listLocatedStatus(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.PathFilter filter)
.
|
List<software.amazon.awssdk.services.s3.model.MultipartUpload> |
listMultipartUploads(String prefix)
Listing all multipart uploads; limited to the first few hundred.
|
protected S3ListResult |
listObjects(S3ListRequest request,
org.apache.hadoop.fs.statistics.DurationTrackerFactory trackerFactory)
Initiate a
listObjects operation, incrementing metrics
in the process. |
org.apache.hadoop.fs.FileStatus[] |
listStatus(org.apache.hadoop.fs.Path f)
List the statuses of the files/directories in the given path if the path is
a directory.
|
org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.FileStatus> |
listStatusIterator(org.apache.hadoop.fs.Path p)
Override subclass such that we benefit for async listing done
in
S3AFileSystem . |
org.apache.hadoop.fs.RemoteIterator<software.amazon.awssdk.services.s3.model.MultipartUpload> |
listUploads(String prefix)
List any pending multipart uploads whose keys begin with prefix, using
an iterator that can handle an unlimited number of entries.
|
org.apache.hadoop.fs.RemoteIterator<software.amazon.awssdk.services.s3.model.MultipartUpload> |
listUploadsUnderPrefix(StoreContext storeContext,
String prefix)
List any pending multipart uploads whose keys begin with prefix, using
an iterator that can handle an unlimited number of entries.
|
List<String> |
listXAttrs(org.apache.hadoop.fs.Path path) |
org.apache.hadoop.fs.Path |
makeQualified(org.apache.hadoop.fs.Path path) |
String |
maybeAddTrailingSlash(String key)
Turns a path (relative or otherwise) into an S3 key, adding a trailing
"/" if the path is not the root and does not already have a "/"
at the end.
|
protected void |
maybeCreateFakeParentDirectory(org.apache.hadoop.fs.Path path)
Create a fake parent directory if required.
|
boolean |
mkdirs(org.apache.hadoop.fs.Path p,
org.apache.hadoop.fs.permission.FsPermission permission)
Make the given path and all non-existent parents into
directories.
|
CommitterStatistics |
newCommitterStatistics()
Create a new instance of the committer statistics.
|
software.amazon.awssdk.services.s3.model.PutObjectRequest.Builder |
newPutObjectRequestBuilder(String key,
long length,
boolean isDirectoryMarker)
Create a putObject request builder.
|
protected org.apache.hadoop.fs.statistics.DurationTrackerFactory |
nonNullDurationTrackerFactory(org.apache.hadoop.fs.statistics.DurationTrackerFactory factory)
Given a possibly null duration tracker factory, return a non-null
one for use in tracking durations -either that or the FS tracker
itself.
|
org.apache.hadoop.fs.FSDataInputStream |
open(org.apache.hadoop.fs.Path f,
int bufferSize)
Opens an FSDataInputStream at the indicated Path.
|
CompletableFuture<org.apache.hadoop.fs.FSDataInputStream> |
openFileWithOptions(org.apache.hadoop.fs.Path rawPath,
org.apache.hadoop.fs.impl.OpenFileParameters parameters)
Initiate the open() operation.
|
void |
operationRetried(Exception ex)
Callback when an operation was retried.
|
void |
operationRetried(String text,
Exception ex,
int retries,
boolean idempotent)
Callback from
Invoker when an operation is retried. |
String |
pathToKey(org.apache.hadoop.fs.Path path)
Turns a path (relative or otherwise) into an S3 key.
|
protected void |
processDeleteOnExit()
Delete all paths that were marked as delete-on-exit.
|
UploadInfo |
putObject(software.amazon.awssdk.services.s3.model.PutObjectRequest putObjectRequest,
File file,
ProgressableProgressListener listener)
Start a transfer-manager managed async PUT of an object,
incrementing the put requests and put bytes
counters.
|
org.apache.hadoop.fs.Path |
qualify(org.apache.hadoop.fs.Path path)
Qualify a path.
|
void |
removeKeys(List<software.amazon.awssdk.services.s3.model.ObjectIdentifier> keysToDelete,
boolean deleteFakeDir)
Invoke
removeKeysS3(List, boolean) . |
boolean |
rename(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst)
Renames Path src to Path dst.
|
protected void |
setAmazonS3Client(software.amazon.awssdk.services.s3.S3Client client)
Set the client -used in mocking tests to force in a different client.
|
protected void |
setBucket(String bucket)
Set the bucket.
|
protected void |
setEncryptionSecrets(EncryptionSecrets secrets)
Set the encryption secrets for requests.
|
void |
setInputPolicy(S3AInputPolicy inputPolicy)
Deprecated.
use openFile() options
|
protected void |
setUri(URI fsUri,
boolean canonicalize)
Set the URI field through
S3xLoginHelper and
optionally canonicalizeUri(URI)
Exported for testing. |
void |
setWorkingDirectory(org.apache.hadoop.fs.Path newDir)
Set the current working directory for the given file system.
|
AWSCredentialProviderList |
shareCredentials(String purpose)
Get a shared copy of the AWS credentials, with its reference
counter updated.
|
protected void |
stopAllServices()
Stop all services.
|
String |
toString() |
protected void |
verifyBucketExists()
Verify that the bucket exists.
|
append, append, append, append, appendFile, areSymlinksEnabled, clearStatistics, closeAll, closeAllForUGI, completeLocalOutput, concat, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, create, create, createDataInputStreamBuilder, createDataInputStreamBuilder, createDataOutputStreamBuilder, createNewFile, createNonRecursive, createNonRecursive, createPathHandle, createSnapshot, createSnapshot, createSymlink, delete, deleteSnapshot, enableSymlinks, fixRelativePart, get, get, get, getAclStatus, getAllStatistics, getAllStoragePolicies, getBlockSize, getChildFileSystems, getDefaultBlockSize, getDefaultReplication, getDefaultReplication, getDefaultUri, getEnclosingRoot, getFileBlockLocations, getFileBlockLocations, getFileChecksum, getFileLinkStatus, getFileSystemClass, getFSofPath, getGlobalStorageStatistics, getHomeDirectory, getInitialWorkingDirectory, getLength, getLinkTarget, getLocal, getName, getNamed, getPathHandle, getQuotaUsage, getReplication, getServerDefaults, getServerDefaults, getStatistics, getStatistics, getStatus, getStatus, getStoragePolicy, getTrashRoot, getTrashRoots, getUsed, getUsed, listCorruptFileBlocks, listStatus, listStatus, listStatus, listStatusBatch, mkdirs, mkdirs, modifyAclEntries, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, msync, newInstance, newInstance, newInstance, newInstanceLocal, open, open, open, openFile, openFile, openFileWithOptions, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, removeAcl, removeAclEntries, removeDefaultAcl, removeXAttr, rename, renameSnapshot, resolveLink, resolvePath, satisfyStoragePolicy, setAcl, setDefaultUri, setDefaultUri, setOwner, setPermission, setQuota, setQuotaByStorageType, setReplication, setStoragePolicy, setTimes, setVerifyChecksum, setWriteChecksum, setXAttr, setXAttr, startLocalOutput, supportsSymlinks, truncate, unsetStoragePolicy
public static final int DEFAULT_BLOCKSIZE
public static final org.slf4j.Logger LOG
public void initialize(URI name, org.apache.hadoop.conf.Configuration originalConf) throws IOException
initialize
in class org.apache.hadoop.fs.FileSystem
name
- a uri whose authority section names the host, port, etc.
for this FileSystemoriginalConf
- the configuration to use for the FS. The
bucket-specific options are patched over the base ones before any use is
made of the config.IOException
protected void initializeStatisticsBinding()
IntegratedS3AStatisticsContext
with callbacks to get the FS's instrumentation and FileSystem.statistics
field; the latter may change after initialize(URI, Configuration)
,
so needs to be dynamically adapted.
Protected so that (mock) subclasses can replace it with a
different statistics binding, if desired.protected static S3AStorageStatistics createStorageStatistics(org.apache.hadoop.fs.statistics.IOStatistics ioStatistics)
ioStatistics
- IOStatistics to build the storage statistics from.@Retries.RetryTranslated protected void verifyBucketExists() throws UnknownStoreException, IOException
UnknownStoreException
- the bucket is absentIOException
- any other problem talking to S3@VisibleForTesting public S3AInstrumentation getInstrumentation()
@VisibleForTesting public org.apache.hadoop.fs.FileSystem.Statistics getFsStatistics()
public Listing getListing()
protected void initializeAuditService() throws IOException
IOException
- failure to instantiate/initialize.@InterfaceAudience.Private public AuditManagerS3A getAuditManager()
@InterfaceAudience.Private public OperationAuditor getAuditor()
@InterfaceAudience.Private public AuditSpanS3A getActiveAuditSpan()
getActiveAuditSpan
in interface org.apache.hadoop.fs.store.audit.ActiveThreadSpanSource<AuditSpanS3A>
@InterfaceAudience.Private public org.apache.hadoop.fs.store.audit.AuditSpanSource getAuditSpanSource()
public AuditSpanS3A createSpan(String operation, @Nullable String path1, @Nullable String path2) throws IOException
createSpan
in interface org.apache.hadoop.fs.store.audit.AuditSpanSource<AuditSpanS3A>
operation
- operation name.path1
- first path of operationpath2
- second path of operationIOException
- failureprotected RequestFactory createRequestFactory()
@VisibleForTesting public RequestFactory getRequestFactory()
@VisibleForTesting public DelegationOperations createDelegationOperations()
protected void setEncryptionSecrets(EncryptionSecrets secrets)
secrets
- secretspublic EncryptionSecrets getEncryptionSecrets()
@Retries.RetryTranslated public void abortOutstandingMultipartUploads(long seconds) throws IOException
seconds
- time in secondsIOException
- on any failure, other than 403 "permission denied"public String getScheme()
getScheme
in class org.apache.hadoop.fs.FileSystem
public URI getUri()
getUri
in class org.apache.hadoop.fs.FileSystem
@VisibleForTesting protected void setUri(URI fsUri, boolean canonicalize)
S3xLoginHelper
and
optionally canonicalizeUri(URI)
Exported for testing.fsUri
- filesystem URI.canonicalize
- true if the URI should be canonicalized.public URI getCanonicalUri()
getCanonicalUri
in class org.apache.hadoop.fs.FileSystem
@VisibleForTesting public int getDefaultPort()
getDefaultPort
in class org.apache.hadoop.fs.FileSystem
protected void setAmazonS3Client(software.amazon.awssdk.services.s3.S3Client client)
client
- client.@AuditEntryPoint @Retries.RetryTranslated public String getBucketLocation() throws IOException
IOException
protected S3AInternals createS3AInternals()
public S3AInternals getS3AInternals()
@InterfaceStability.Unstable public S3AInputPolicy getInputPolicy()
@VisibleForTesting public ChangeDetectionPolicy getChangeDetectionPolicy()
public S3AEncryptionMethods getS3EncryptionAlgorithm()
@InterfaceAudience.Public @InterfaceStability.Stable public String getBucket()
@VisibleForTesting protected void setBucket(String bucket)
bucket
- the bucket@InterfaceStability.Unstable @Deprecated public void setInputPolicy(S3AInputPolicy inputPolicy)
inputPolicy
- new policy@VisibleForTesting public String pathToKey(org.apache.hadoop.fs.Path path)
path
- input path, may be relative to the working dir@InterfaceAudience.Private public String maybeAddTrailingSlash(String key)
key
- s3 key or ""public org.apache.hadoop.fs.Path keyToQualifiedPath(String key)
Path.normalizePath()
.key
- input keypublic org.apache.hadoop.fs.Path makeQualified(org.apache.hadoop.fs.Path path)
makeQualified
in class org.apache.hadoop.fs.FileSystem
public org.apache.hadoop.fs.Path qualify(org.apache.hadoop.fs.Path path)
Path.normalizePath()
.path
- path to qualifypublic void checkPath(org.apache.hadoop.fs.Path path)
checkPath
in class org.apache.hadoop.fs.FileSystem
path
- to checkIllegalArgumentException
- if there is an FS mismatchprotected URI canonicalizeUri(URI rawUri)
S3xLoginHelper.canonicalizeUri(URI, int)
.
This allows for the option of changing this logic for better DT handling.canonicalizeUri
in class org.apache.hadoop.fs.FileSystem
rawUri
- raw URI.@Retries.RetryTranslated public org.apache.hadoop.fs.FSDataInputStream open(org.apache.hadoop.fs.Path f, int bufferSize) throws IOException
open
in class org.apache.hadoop.fs.FileSystem
f
- the file name to openbufferSize
- the size of the buffer to be used.IOException
@VisibleForTesting protected S3AReadOpContext createReadContext(org.apache.hadoop.fs.FileStatus fileStatus, org.apache.hadoop.fs.store.audit.AuditSpan auditSpan)
fileStatus
- file status.auditSpan
- audit span.@AuditEntryPoint public org.apache.hadoop.fs.FSDataOutputStream create(org.apache.hadoop.fs.Path f, org.apache.hadoop.fs.permission.FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, org.apache.hadoop.util.Progressable progress) throws IOException
create
in class org.apache.hadoop.fs.FileSystem
f
- the file name to openpermission
- the permission to set.overwrite
- if a file with this name already exists, then if true,
the file will be overwritten, and if false an error will be thrown.bufferSize
- the size of the buffer to be used.replication
- required block replication for the file.blockSize
- the requested block size.progress
- the progress reporter.IOException
- in the event of IO related errors.FileSystem.setPermission(Path, FsPermission)
@InterfaceAudience.Private public WriteOperationHelper getWriteOperationHelper()
@InterfaceAudience.Private public WriteOperationHelper createWriteOperationHelper(org.apache.hadoop.fs.store.audit.AuditSpan auditSpan)
auditSpan
- audit span@AuditEntryPoint public org.apache.hadoop.fs.FSDataOutputStreamBuilder createFile(org.apache.hadoop.fs.Path path)
createFile
in class org.apache.hadoop.fs.FileSystem
path
- path to createUncheckedIOException
- for problems creating the audit span@AuditEntryPoint public org.apache.hadoop.fs.FSDataOutputStream createNonRecursive(org.apache.hadoop.fs.Path p, org.apache.hadoop.fs.permission.FsPermission permission, EnumSet<org.apache.hadoop.fs.CreateFlag> flags, int bufferSize, short replication, long blockSize, org.apache.hadoop.util.Progressable progress) throws IOException
createNonRecursive
in class org.apache.hadoop.fs.FileSystem
IOException
public org.apache.hadoop.fs.FSDataOutputStream append(org.apache.hadoop.fs.Path f, int bufferSize, org.apache.hadoop.util.Progressable progress) throws IOException
append
in class org.apache.hadoop.fs.FileSystem
f
- the existing file to be appended.bufferSize
- the size of the buffer to be used.progress
- for reporting progress if it is not null.IOException
- indicating that append is not supported.@AuditEntryPoint @Retries.RetryTranslated public boolean rename(org.apache.hadoop.fs.Path src, org.apache.hadoop.fs.Path dst) throws IOException
Fails if src is a file and dst is a directory. Fails if src is a directory and dst is a file. Fails if the parent of dst does not exist or is a file. Fails if dst is a directory that is not empty.
rename
in class org.apache.hadoop.fs.FileSystem
src
- path to be renameddst
- new path after renameIOException
- on IO failurepublic org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> getFsDelegationToken() throws IOException
getFsDelegationToken
in interface DelegationTokenProvider
IOException
@AuditEntryPoint @InterfaceAudience.LimitedPrivate(value="utilities") @Retries.RetryTranslated @Deprecated public software.amazon.awssdk.services.s3.model.HeadObjectResponse getObjectMetadata(org.apache.hadoop.fs.Path path) throws IOException
path
- path to the object. This will be qualified.IOException
- IO and object access problems.protected org.apache.hadoop.fs.store.audit.AuditSpan entryPoint(Statistic operation, org.apache.hadoop.fs.Path path) throws IOException
operation
- The operation being invokedpath
- first path of operationIOException
- failure of audit serviceprotected org.apache.hadoop.fs.store.audit.AuditSpan entryPoint(Statistic operation, @Nullable String path1, @Nullable String path2) throws IOException
operation
- The operation being invokedpath1
- first path of operationpath2
- second path of operationIOException
- failure of audit serviceprotected void incrementStatistic(Statistic statistic)
statistic
- The operation to incrementprotected void incrementStatistic(Statistic statistic, long count)
statistic
- The operation to incrementcount
- the count to incrementprotected void decrementGauge(Statistic statistic, long count)
statistic
- The operation to decrementcount
- the count to decrementprotected void incrementGauge(Statistic statistic, long count)
statistic
- The operation to incrementcount
- the count to incrementpublic void operationRetried(Exception ex)
ex
- exception.public void operationRetried(String text, Exception ex, int retries, boolean idempotent)
Invoker
when an operation is retried.text
- text of the operationex
- exceptionretries
- number of retriesidempotent
- is the method idempotentpublic S3AStorageStatistics getStorageStatistics()
getStorageStatistics
in class org.apache.hadoop.fs.FileSystem
public org.apache.hadoop.fs.statistics.IOStatistics getIOStatistics()
getIOStatistics
in interface org.apache.hadoop.fs.statistics.IOStatisticsSource
protected org.apache.hadoop.fs.statistics.DurationTrackerFactory getDurationTrackerFactory()
protected org.apache.hadoop.fs.statistics.DurationTrackerFactory nonNullDurationTrackerFactory(org.apache.hadoop.fs.statistics.DurationTrackerFactory factory)
factory
- factory.@Retries.RetryRaw protected software.amazon.awssdk.services.s3.model.HeadObjectResponse getObjectMetadata(String key, ChangeTracker changeTracker, Invoker changeInvoker, String operation) throws IOException
key
- keychangeTracker
- the change tracker to detect unexpected object versionchangeInvoker
- the invoker providing the retry policyoperation
- the operation (e.g. "read" or "copy") triggering this callIOException
- if the retry invocation raises one (it shouldn't).RemoteFileChangedException
- if an unexpected version is detected@AuditEntryPoint @Retries.RetryTranslated protected software.amazon.awssdk.services.s3.model.HeadBucketResponse getBucketMetadata() throws IOException
UnknownStoreException
- the bucket is absentIOException
- any other problem talking to S3@Retries.RetryRaw protected S3ListResult listObjects(S3ListRequest request, @Nullable org.apache.hadoop.fs.statistics.DurationTrackerFactory trackerFactory) throws IOException
listObjects
operation, incrementing metrics
in the process.
Retry policy: retry untranslated.request
- request to initiatetrackerFactory
- duration trackingIOException
- if the retry invocation raises one (it shouldn't).@Retries.RetryRaw protected S3ListResult continueListObjects(S3ListRequest request, S3ListResult prevResult, org.apache.hadoop.fs.statistics.DurationTrackerFactory trackerFactory) throws IOException
request
- last list objects request to continueprevResult
- last paged result to continue fromtrackerFactory
- duration trackingIOException
- none, just there for retryUntranslated.public void incrementReadOperations()
public void incrementWriteOperations()
@VisibleForTesting @Retries.RetryRaw protected void deleteObject(String key) throws software.amazon.awssdk.core.exception.SdkException, IOException
OBJECT_DELETE_REQUESTS
and write
operation statistics.
This call does not create any mock parent entries.
Retry policy: retry untranslated; delete considered idempotent.key
- key to blob to delete.software.amazon.awssdk.core.exception.SdkException
- problems working with S3org.apache.hadoop.fs.InvalidRequestException
- if the request was rejected due to
a mistaken attempt to delete the root directory.IOException
public software.amazon.awssdk.services.s3.model.PutObjectRequest.Builder newPutObjectRequestBuilder(String key, long length, boolean isDirectoryMarker)
key
- key of objectlength
- length of object to be uploadedisDirectoryMarker
- true if object to be uploaded is a directory marker@Retries.OnceRaw public UploadInfo putObject(software.amazon.awssdk.services.s3.model.PutObjectRequest putObjectRequest, File file, ProgressableProgressListener listener)
putObjectRequest
- the requestfile
- the file to be uploadedlistener
- the progress listener for the requestpublic void incrementPutStartStatistics(long bytes)
bytes
- bytes in the request.public void incrementPutCompletedStatistics(boolean success, long bytes)
success
- did the operation succeed?bytes
- bytes in the request.public void incrementPutProgressStatistics(String key, long bytes)
key
- key to file that is being written (for logging)bytes
- bytes successfully uploaded.@VisibleForTesting @Retries.RetryRaw public void removeKeys(List<software.amazon.awssdk.services.s3.model.ObjectIdentifier> keysToDelete, boolean deleteFakeDir) throws MultiObjectDeleteException, software.amazon.awssdk.awscore.exception.AwsServiceException, IOException
removeKeysS3(List, boolean)
.
If a MultiObjectDeleteException
is raised, the
relevant statistics are updated.keysToDelete
- collection of keys to delete on the s3-backend.
if empty, no request is made of the object store.deleteFakeDir
- indicates whether this is for deleting fake dirsorg.apache.hadoop.fs.InvalidRequestException
- if the request was rejected due to
a mistaken attempt to delete the root directory.MultiObjectDeleteException
- one or more of the keys could not
be deleted in a multiple object delete operation.software.amazon.awssdk.awscore.exception.AwsServiceException
- amazon-layer failure.IOException
- other IO Exception.@Retries.RetryTranslated @AuditEntryPoint public boolean delete(org.apache.hadoop.fs.Path f, boolean recursive) throws IOException
O(files)
, with
added overheads to enumerate the path. It is also not atomic.delete
in class org.apache.hadoop.fs.FileSystem
f
- the path to delete.recursive
- if path is a directory and set to
true, the directory is deleted else throws an exception. In
case of a file the recursive can be set to either true or false.IOException
- due to inability to delete a directory or file.@VisibleForTesting protected boolean deleteWithoutCloseCheck(org.apache.hadoop.fs.Path f, boolean recursive) throws IOException
f
- the path to delete.recursive
- if path is a directory and set to
true, the directory is deleted else throws an exception. In
case of a file the recursive can be set to either true or false.IOException
- due to inability to delete a directory or file.@Retries.RetryTranslated @VisibleForTesting protected void maybeCreateFakeParentDirectory(org.apache.hadoop.fs.Path path) throws IOException, software.amazon.awssdk.core.exception.SdkException
path
- whose parent is created if needed.IOException
- IO problemsoftware.amazon.awssdk.core.exception.SdkException
@AuditEntryPoint public org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.FileStatus> listStatusIterator(org.apache.hadoop.fs.Path p) throws FileNotFoundException, IOException
S3AFileSystem
. See Listing#ObjectListingIterator
.
listStatusIterator
in class org.apache.hadoop.fs.FileSystem
FileNotFoundException
IOException
@AuditEntryPoint public org.apache.hadoop.fs.FileStatus[] listStatus(org.apache.hadoop.fs.Path f) throws FileNotFoundException, IOException
listStatus
in class org.apache.hadoop.fs.FileSystem
f
- given pathFileNotFoundException
- when the path does not exist;
IOException see specific implementationIOException
public boolean allowAuthoritative(org.apache.hadoop.fs.Path path)
path
- path@VisibleForTesting public S3ListRequest createListObjectsRequest(String key, String delimiter)
ListObjectsRequest
request against this bucket,
with the maximum keys returned in a query set by maxKeys
.key
- key for requestdelimiter
- any delimiterpublic void setWorkingDirectory(org.apache.hadoop.fs.Path newDir)
setWorkingDirectory
in class org.apache.hadoop.fs.FileSystem
newDir
- the current working directory.public org.apache.hadoop.fs.Path getWorkingDirectory()
getWorkingDirectory
in class org.apache.hadoop.fs.FileSystem
public String getUsername()
public org.apache.hadoop.security.UserGroupInformation getOwner()
@AuditEntryPoint public boolean mkdirs(org.apache.hadoop.fs.Path p, org.apache.hadoop.fs.permission.FsPermission permission) throws IOException, org.apache.hadoop.fs.FileAlreadyExistsException
'mkdir -p'
.
Existence of the directory hierarchy is not an error.
Parent elements are scanned to see if any are a file,
except under "MAGIC PATH" paths.
There the FS assumes that the destination directory creation
did that scan and that paths in job/task attempts are all
"well formed"mkdirs
in class org.apache.hadoop.fs.FileSystem
p
- path to createpermission
- to apply to pathorg.apache.hadoop.fs.FileAlreadyExistsException
- there is a file at the path specified
or is discovered on one of its ancestors.IOException
- other IO problems@VisibleForTesting public MkdirOperation.MkdirCallbacks createMkdirOperationCallbacks()
@Retries.RetryTranslated @AuditEntryPoint public org.apache.hadoop.fs.ContentSummary getContentSummary(org.apache.hadoop.fs.Path f) throws IOException
getContentSummary
in class org.apache.hadoop.fs.FileSystem
IOException
protected GetContentSummaryOperation.GetContentSummaryCallbacks createGetContentSummaryCallbacks()
@AuditEntryPoint public void access(org.apache.hadoop.fs.Path f, org.apache.hadoop.fs.permission.FsAction mode) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
access
in class org.apache.hadoop.fs.FileSystem
org.apache.hadoop.security.AccessControlException
FileNotFoundException
IOException
@AuditEntryPoint @Retries.RetryTranslated public org.apache.hadoop.fs.FileStatus getFileStatus(org.apache.hadoop.fs.Path f) throws IOException
getFileStatus
in class org.apache.hadoop.fs.FileSystem
f
- The path we want information fromFileNotFoundException
- when the path does not existIOException
- on other problems.@AuditEntryPoint public void copyFromLocalFile(boolean delSrc, boolean overwrite, org.apache.hadoop.fs.Path src, org.apache.hadoop.fs.Path dst) throws IOException
Constants.OPTIMIZED_COPY_FROM_LOCAL
is set to false,
the superclass implementation is used.copyFromLocalFile
in class org.apache.hadoop.fs.FileSystem
delSrc
- whether to delete the srcoverwrite
- whether to overwrite an existing filesrc
- pathdst
- pathIOException
- IO problemorg.apache.hadoop.fs.FileAlreadyExistsException
- the destination file exists and
overwrite==falseprotected CopyFromLocalOperation.CopyFromLocalOperationCallbacks createCopyFromLocalCallbacks(AuditSpanS3A span) throws IOException
span
- audit span.IOException
- failure to get the local fs.public boolean deleteOnExit(org.apache.hadoop.fs.Path f) throws IOException
deleteOnExit
in class org.apache.hadoop.fs.FileSystem
f
- the path to delete; this may be unqualified.IOException
- IO failurepublic boolean cancelDeleteOnExit(org.apache.hadoop.fs.Path f)
cancelDeleteOnExit
in class org.apache.hadoop.fs.FileSystem
f
- the path to cancel deletionprotected void processDeleteOnExit()
O(paths)
, with the actual
time dependent on the time for existence and deletion operations to
complete, successfully or not.processDeleteOnExit
in class org.apache.hadoop.fs.FileSystem
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class org.apache.hadoop.fs.FileSystem
IOException
- IO problemprotected void stopAllServices()
@VisibleForTesting public Optional<S3ADelegationTokens> getDelegationTokens()
public String getCanonicalServiceName()
getCanonicalServiceName
in interface org.apache.hadoop.security.token.DelegationTokenIssuer
getCanonicalServiceName
in class org.apache.hadoop.fs.FileSystem
@AuditEntryPoint public org.apache.hadoop.security.token.Token<AbstractS3ATokenIdentifier> getDelegationToken(String renewer) throws IOException
getDelegationToken
in interface org.apache.hadoop.security.token.DelegationTokenIssuer
getDelegationToken
in class org.apache.hadoop.fs.FileSystem
renewer
- the account name that is allowed to renew the token.IOException
- IO failurepublic org.apache.hadoop.security.token.DelegationTokenIssuer[] getAdditionalTokenIssuers() throws IOException
getAdditionalTokenIssuers
in interface org.apache.hadoop.security.token.DelegationTokenIssuer
getAdditionalTokenIssuers
in class org.apache.hadoop.fs.FileSystem
IOException
@InterfaceAudience.Private public List<RoleModel.Statement> listAWSPolicyRules(Set<AWSPolicyProvider.AccessLevel> access)
listAWSPolicyRules
in interface AWSPolicyProvider
access
- access level desired.public long getDefaultBlockSize()
getDefaultBlockSize
in class org.apache.hadoop.fs.FileSystem
public DirectoryPolicy getDirectoryMarkerPolicy()
public long getPartitionSize()
public long getMultiPartThreshold()
public boolean isMagicCommitEnabled()
public boolean isMagicCommitPath(org.apache.hadoop.fs.Path path)
path
- path to examinepublic org.apache.hadoop.fs.FileStatus[] globStatus(org.apache.hadoop.fs.Path pathPattern) throws IOException
Statistic.INVOCATION_GLOB_STATUS
.
Override superclass so as to disable symlink resolution as symlinks
are not supported by S3A.
globStatus
in class org.apache.hadoop.fs.FileSystem
IOException
@AuditEntryPoint public org.apache.hadoop.fs.FileStatus[] globStatus(org.apache.hadoop.fs.Path pathPattern, org.apache.hadoop.fs.PathFilter filter) throws IOException
Statistic.INVOCATION_GLOB_STATUS
.
Override superclass so as to disable symlink resolution as symlinks
are not supported by S3A.
Although an AuditEntryPoint, the globber itself will talk do
the filesystem through the filesystem API, so its operations will
all appear part of separate operations.
globStatus
in class org.apache.hadoop.fs.FileSystem
IOException
@AuditEntryPoint public boolean exists(org.apache.hadoop.fs.Path f) throws IOException
exists
in class org.apache.hadoop.fs.FileSystem
IOException
@AuditEntryPoint public boolean isDirectory(org.apache.hadoop.fs.Path f) throws IOException
isDirectory
in class org.apache.hadoop.fs.FileSystem
IOException
@AuditEntryPoint public boolean isFile(org.apache.hadoop.fs.Path f) throws IOException
isFile
in class org.apache.hadoop.fs.FileSystem
IOException
@Retries.RetryTranslated @AuditEntryPoint public org.apache.hadoop.fs.store.EtagChecksum getFileChecksum(org.apache.hadoop.fs.Path f, long length) throws IOException
Constants.ETAG_CHECKSUM_ENABLED
is set; turning it on
has caused problems with Distcp (HADOOP-15273).getFileChecksum
in class org.apache.hadoop.fs.FileSystem
f
- The file pathlength
- The length of the file range for checksum calculationIOException
- IO failure@AuditEntryPoint public byte[] getXAttr(org.apache.hadoop.fs.Path path, String name) throws IOException
getXAttr
in class org.apache.hadoop.fs.FileSystem
IOException
@AuditEntryPoint public Map<String,byte[]> getXAttrs(org.apache.hadoop.fs.Path path) throws IOException
getXAttrs
in class org.apache.hadoop.fs.FileSystem
IOException
@AuditEntryPoint public Map<String,byte[]> getXAttrs(org.apache.hadoop.fs.Path path, List<String> names) throws IOException
getXAttrs
in class org.apache.hadoop.fs.FileSystem
IOException
@AuditEntryPoint public List<String> listXAttrs(org.apache.hadoop.fs.Path path) throws IOException
listXAttrs
in class org.apache.hadoop.fs.FileSystem
IOException
protected HeaderProcessing.HeaderProcessingCallbacks createHeaderProcessingCallbacks()
@Retries.RetryTranslated @AuditEntryPoint public org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus> listFiles(org.apache.hadoop.fs.Path f, boolean recursive) throws FileNotFoundException, IOException
ListObjectsRequest
is created requesting a (windowed)
listing of all entries under the given path. This is used to construct
an ObjectListingIterator
instance, iteratively returning the
sequence of lists of elements under the path. This is then iterated
over in a FileStatusListingIterator
, which generates
S3AFileStatus
instances, one per listing entry.
These are then translated into LocatedFileStatus
instances.
This is essentially a nested and wrapped set of iterators, with some
generator classes.listFiles
in class org.apache.hadoop.fs.FileSystem
f
- a pathrecursive
- if the subdirectories need to be traversed recursivelyFileNotFoundException
- if path
does not existIOException
- if any I/O error occurred@InterfaceAudience.Private @Retries.RetryTranslated @AuditEntryPoint public org.apache.hadoop.fs.RemoteIterator<S3ALocatedFileStatus> listFilesAndEmptyDirectories(org.apache.hadoop.fs.Path f, boolean recursive) throws IOException
f
- path to list fromrecursive
- recursive?IOException
- failurepublic org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus> listLocatedStatus(org.apache.hadoop.fs.Path f) throws FileNotFoundException, IOException
listLocatedStatus
in class org.apache.hadoop.fs.FileSystem
FileNotFoundException
IOException
@Retries.OnceTranslated(value="s3guard not retrying") @AuditEntryPoint public org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus> listLocatedStatus(org.apache.hadoop.fs.Path f, org.apache.hadoop.fs.PathFilter filter) throws FileNotFoundException, IOException
listLocatedStatus
in class org.apache.hadoop.fs.FileSystem
f
- a pathfilter
- a path filterFileNotFoundException
- if path
does not existIOException
- if any I/O error occurred@InterfaceAudience.Private @Retries.RetryTranslated @AuditEntryPoint public org.apache.hadoop.fs.RemoteIterator<software.amazon.awssdk.services.s3.model.MultipartUpload> listUploads(@Nullable String prefix) throws IOException
listMultipartUploads(String)
for a non-iterator version of
this.prefix
- optional key prefix to searchIOException
- on failure@InterfaceAudience.Private @Retries.RetryTranslated public org.apache.hadoop.fs.RemoteIterator<software.amazon.awssdk.services.s3.model.MultipartUpload> listUploadsUnderPrefix(StoreContext storeContext, @Nullable String prefix) throws IOException
listMultipartUploads(String)
for a non-iterator version of
this.storeContext
- store conext.prefix
- optional key prefix to searchIOException
- on failure@InterfaceAudience.Private @Retries.RetryTranslated public List<software.amazon.awssdk.services.s3.model.MultipartUpload> listMultipartUploads(String prefix) throws IOException
listUploads(String)
for an iterator-based version that does
not limit the number of entries returned.
Retry policy: retry, translated.prefix
- prefix to scan for, "" for noneIOException
- IO failure, including any uprated SdkException@Retries.OnceTranslated public void abortMultipartUpload(String destKey, String uploadId) throws IOException
destKey
- destination keyuploadId
- Upload IDIOException
- IO failure, including any uprated SdkException@Retries.OnceTranslated public void abortMultipartUpload(software.amazon.awssdk.services.s3.model.MultipartUpload upload) throws IOException
upload
- the listed upload to abort.IOException
- IO failure, including any uprated SdkExceptionpublic CommitterStatistics newCommitterStatistics()
public boolean hasPathCapability(org.apache.hadoop.fs.Path path, String capability) throws IOException
hasPathCapability
in interface org.apache.hadoop.fs.PathCapabilities
hasPathCapability
in class org.apache.hadoop.fs.FileSystem
IOException
@Deprecated public boolean hasCapability(String capability)
hasPathCapability(Path, String)
.hasCapability
in interface org.apache.hadoop.fs.StreamCapabilities
capability
- string to query the stream support for.public AWSCredentialProviderList shareCredentials(String purpose)
close()
on this after
they have finished using it.purpose
- what is this for? This is initially for logging@Retries.RetryTranslated @AuditEntryPoint public CompletableFuture<org.apache.hadoop.fs.FSDataInputStream> openFileWithOptions(org.apache.hadoop.fs.Path rawPath, org.apache.hadoop.fs.impl.OpenFileParameters parameters) throws IOException
openFileWithOptions
in class org.apache.hadoop.fs.FileSystem
rawPath
- path to the fileparameters
- open file parameters from the builder.IOException
- failure to resolve the link.IllegalArgumentException
- unknown mandatory key@AuditEntryPoint public S3AMultipartUploaderBuilder createMultipartUploader(org.apache.hadoop.fs.Path basePath) throws IOException
createMultipartUploader
in class org.apache.hadoop.fs.FileSystem
IOException
@InterfaceAudience.Private public StoreContext createStoreContext()
@AuditEntryPoint @InterfaceAudience.Private public MarkerToolOperations createMarkerToolOperations(String target) throws IOException
target
- target pathIOException
- if raised during span creation@InterfaceAudience.Private public static void initializeClass()
public boolean isCSEEnabled()
public boolean isMultipartUploadEnabled()
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.