Package org.apache.hadoop.fs.s3a
Class S3AFileSystem.ListingOperationCallbacksImpl
java.lang.Object
org.apache.hadoop.fs.s3a.S3AFileSystem.ListingOperationCallbacksImpl
- All Implemented Interfaces:
ListingOperationCallbacks
- Enclosing class:
- S3AFileSystem
protected class S3AFileSystem.ListingOperationCallbacksImpl
extends Object
implements ListingOperationCallbacks
Callbacks from
Listing.
Auditing: the listing object is long-lived; the audit span
for a single listing is passed in from the listing
method calls and then down to the callbacks.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncontinueListObjectsAsync(S3ListRequest request, S3ListResult prevResult, org.apache.hadoop.fs.statistics.DurationTrackerFactory trackerFactory, org.apache.hadoop.fs.store.audit.AuditSpan span) List the next set of objects.createListObjectsRequest(String key, String delimiter, org.apache.hadoop.fs.store.audit.AuditSpan span) Create aListObjectsRequestrequest against this bucket, with the maximum keys returned in a query set in the FS config.longgetDefaultBlockSize(org.apache.hadoop.fs.Path path) Return the number of bytes that large input files should be optimally be split into to minimize I/O time.intGet the maximum key count.longgetObjectSize(software.amazon.awssdk.services.s3.model.S3Object s3Object) Get the S3 object size.listObjectsAsync(S3ListRequest request, org.apache.hadoop.fs.statistics.DurationTrackerFactory trackerFactory, org.apache.hadoop.fs.store.audit.AuditSpan span) Initiate alistObjectsAsyncoperation, incrementing metrics in the process.toLocatedFileStatus(S3AFileStatus status) Build aS3ALocatedFileStatusfrom aFileStatusinstance.
-
Constructor Details
-
ListingOperationCallbacksImpl
protected ListingOperationCallbacksImpl()
-
-
Method Details
-
listObjectsAsync
public CompletableFuture<S3ListResult> listObjectsAsync(S3ListRequest request, org.apache.hadoop.fs.statistics.DurationTrackerFactory trackerFactory, org.apache.hadoop.fs.store.audit.AuditSpan span) Description copied from interface:ListingOperationCallbacksInitiate alistObjectsAsyncoperation, incrementing metrics in the process. Retry policy: failures will come from the future.- Specified by:
listObjectsAsyncin interfaceListingOperationCallbacks- Parameters:
request- request to initiatetrackerFactory- tracker with statistics to updatespan- audit span for this operation- Returns:
- the results
-
continueListObjectsAsync
@RetryRaw public CompletableFuture<S3ListResult> continueListObjectsAsync(S3ListRequest request, S3ListResult prevResult, org.apache.hadoop.fs.statistics.DurationTrackerFactory trackerFactory, org.apache.hadoop.fs.store.audit.AuditSpan span) Description copied from interface:ListingOperationCallbacksList the next set of objects. Retry policy: failures will come from the future.- Specified by:
continueListObjectsAsyncin interfaceListingOperationCallbacks- Parameters:
request- last list objects request to continueprevResult- last paged result to continue fromtrackerFactory- tracker with statistics to updatespan- audit span for the IO- Returns:
- the next result object
-
toLocatedFileStatus
Description copied from interface:ListingOperationCallbacksBuild aS3ALocatedFileStatusfrom aFileStatusinstance.- Specified by:
toLocatedFileStatusin interfaceListingOperationCallbacks- Parameters:
status- file status- Returns:
- a located status with block locations set up from this FS.
- Throws:
IOException- IO Problems.
-
createListObjectsRequest
public S3ListRequest createListObjectsRequest(String key, String delimiter, org.apache.hadoop.fs.store.audit.AuditSpan span) Description copied from interface:ListingOperationCallbacksCreate aListObjectsRequestrequest against this bucket, with the maximum keys returned in a query set in the FS config. The active span for the FS is handed the request to prepare it before this method returns.ListingOperationCallbacks.getMaxKeys().- Specified by:
createListObjectsRequestin interfaceListingOperationCallbacks- Parameters:
key- key for requestdelimiter- any delimiterspan- span within which the request takes place.- Returns:
- the request
-
getDefaultBlockSize
public long getDefaultBlockSize(org.apache.hadoop.fs.Path path) Description copied from interface:ListingOperationCallbacksReturn the number of bytes that large input files should be optimally be split into to minimize I/O time. The given path will be used to locate the actual filesystem. The full path does not have to exist.- Specified by:
getDefaultBlockSizein interfaceListingOperationCallbacks- Parameters:
path- path of file- Returns:
- the default block size for the path's filesystem
-
getObjectSize
public long getObjectSize(software.amazon.awssdk.services.s3.model.S3Object s3Object) throws IOException Get the S3 object size. If the object is encrypted, the unpadded size will be returned.- Specified by:
getObjectSizein interfaceListingOperationCallbacks- Parameters:
s3Object- S3object- Returns:
- plaintext S3 object size
- Throws:
IOException- IO problems
-
getMaxKeys
public int getMaxKeys()Description copied from interface:ListingOperationCallbacksGet the maximum key count.- Specified by:
getMaxKeysin interfaceListingOperationCallbacks- Returns:
- a value, valid after initialization
-