Package org.apache.hadoop.fs.s3a.impl
Interface ListingOperationCallbacks
- All Known Implementing Classes:
S3AFileSystem.ListingOperationCallbacksImpl
public interface ListingOperationCallbacks
These are all the callbacks which
Listing operations
need, derived from the actual appropriate S3AFileSystem
methods.-
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.
-
Method Details
-
listObjectsAsync
@RetryRaw CompletableFuture<S3ListResult> 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. Retry policy: failures will come from the future.- Parameters:
request- request to initiatetrackerFactory- tracker with statistics to updatespan- audit span for this operation- Returns:
- the results
-
continueListObjectsAsync
@RetryRaw CompletableFuture<S3ListResult> continueListObjectsAsync(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. Retry policy: failures will come from the future.- 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
Build aS3ALocatedFileStatusfrom aFileStatusinstance.- Parameters:
status- file status- Returns:
- a located status with block locations set up from this FS.
- Throws:
IOException- IO Problems.
-
createListObjectsRequest
S3ListRequest 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. The active span for the FS is handed the request to prepare it before this method returns.getMaxKeys().- Parameters:
key- key for requestdelimiter- any delimiterspan- span within which the request takes place.- Returns:
- the request
-
getDefaultBlockSize
long getDefaultBlockSize(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. The given path will be used to locate the actual filesystem. The full path does not have to exist.- Parameters:
path- path of file- Returns:
- the default block size for the path's filesystem
-
getObjectSize
Get the S3 object size. If the object is encrypted, the unpadded size will be returned.- Parameters:
s3Object- S3object- Returns:
- plaintext S3 object size
- Throws:
IOException- IO problems
-
getMaxKeys
int getMaxKeys()Get the maximum key count.- Returns:
- a value, valid after initialization
-