public interface WriteOperations extends org.apache.hadoop.fs.store.audit.AuditSpanSource, Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
abortMultipartCommit(String destKey,
String uploadId)
Abort a multipart commit operation.
|
void |
abortMultipartUpload(com.amazonaws.services.s3.model.MultipartUpload upload)
Abort a multipart commit operation.
|
void |
abortMultipartUpload(String destKey,
String uploadId,
boolean shouldRetry,
Invoker.Retried retrying)
Abort a multipart upload operation.
|
int |
abortMultipartUploadsUnderPath(String prefix)
Abort multipart uploads under a path: limited to the first
few hundred.
|
com.amazonaws.services.s3.model.CompleteMultipartUploadResult |
commitUpload(String destKey,
String uploadId,
List<com.amazonaws.services.s3.model.PartETag> partETags,
long length,
BulkOperationState operationState)
This completes a multipart upload to the destination key via
finalizeMultipartUpload(). |
com.amazonaws.services.s3.model.CompleteMultipartUploadResult |
completeMPUwithRetries(String destKey,
String uploadId,
List<com.amazonaws.services.s3.model.PartETag> partETags,
long length,
AtomicInteger errorCount)
This completes a multipart upload to the destination key via
finalizeMultipartUpload(). |
com.amazonaws.services.s3.model.PutObjectRequest |
createPutObjectRequest(String dest,
File sourceFile)
Create a
PutObjectRequest request to upload a file. |
com.amazonaws.services.s3.model.PutObjectRequest |
createPutObjectRequest(String destKey,
InputStream inputStream,
long length,
Map<String,String> headers)
Create a
PutObjectRequest request against the specific key. |
org.apache.hadoop.conf.Configuration |
getConf()
Get the configuration of this instance; essentially the owning
filesystem configuration.
|
void |
incrementWriteOperations()
Increment the write operation counter
of the filesystem.
|
BulkOperationState |
initiateCommitOperation(org.apache.hadoop.fs.Path path)
Initiate a commit operation through any metastore.
|
String |
initiateMultiPartUpload(String destKey)
Start the multipart upload process.
|
BulkOperationState |
initiateOperation(org.apache.hadoop.fs.Path path,
BulkOperationState.OperationType operationType)
Initiate a commit operation through any metastore.
|
List<com.amazonaws.services.s3.model.MultipartUpload> |
listMultipartUploads(String prefix)
Abort multipart uploads under a path: limited to the first
few hundred.
|
com.amazonaws.services.s3.model.ObjectMetadata |
newObjectMetadata(long length)
Create a new object metadata instance.
|
com.amazonaws.services.s3.model.SelectObjectContentRequest |
newSelectRequest(org.apache.hadoop.fs.Path path)
Create a S3 Select request for the destination path.
|
com.amazonaws.services.s3.model.UploadPartRequest |
newUploadPartRequest(String destKey,
String uploadId,
int partNumber,
int size,
InputStream uploadStream,
File sourceFile,
Long offset)
Create and initialize a part request of a multipart upload.
|
com.amazonaws.services.s3.model.PutObjectResult |
putObject(com.amazonaws.services.s3.model.PutObjectRequest putObjectRequest)
PUT an object directly (i.e.
|
<T> T |
retry(String action,
String path,
boolean idempotent,
org.apache.hadoop.util.functional.CallableRaisingIOE<T> operation)
Execute a function with retry processing.
|
void |
revertCommit(String destKey,
BulkOperationState operationState)
Revert a commit by deleting the file.
|
com.amazonaws.services.s3.model.SelectObjectContentResult |
select(org.apache.hadoop.fs.Path source,
com.amazonaws.services.s3.model.SelectObjectContentRequest request,
String action)
Execute an S3 Select operation.
|
com.amazonaws.services.s3.transfer.model.UploadResult |
uploadObject(com.amazonaws.services.s3.model.PutObjectRequest putObjectRequest)
PUT an object via the transfer manager.
|
com.amazonaws.services.s3.model.UploadPartResult |
uploadPart(com.amazonaws.services.s3.model.UploadPartRequest request)
Upload part of a multi-partition file.
|
void |
writeFailed(Exception ex)
Callback on a write failure.
|
void |
writeSuccessful(long length)
Callback on a successful write.
|
<T> T retry(String action, String path, boolean idempotent, org.apache.hadoop.util.functional.CallableRaisingIOE<T> operation) throws IOException
T - type of return valueaction - action to execute (used in error messages)path - path of work (used in error messages)idempotent - does the operation have semantics
which mean that it can be retried even if was already executed?operation - operation to executeIOException - any IOE raised, or translated exceptioncom.amazonaws.services.s3.model.PutObjectRequest createPutObjectRequest(String destKey, InputStream inputStream, long length, @Nullable Map<String,String> headers)
PutObjectRequest request against the specific key.destKey - destination keyinputStream - source data.length - size, if known. Use -1 for not knownheaders - optional map of custom headers.com.amazonaws.services.s3.model.PutObjectRequest createPutObjectRequest(String dest, File sourceFile)
PutObjectRequest request to upload a file.dest - key to PUT to.sourceFile - source filevoid writeSuccessful(long length)
length - length of the writevoid writeFailed(Exception ex)
ex - Any exception raised which triggered the failure.com.amazonaws.services.s3.model.ObjectMetadata newObjectMetadata(long length)
length - size, if known. Use -1 for not known@Retries.RetryTranslated String initiateMultiPartUpload(String destKey) throws IOException
destKey - destination of uploadIOException - IO problem@Retries.RetryTranslated com.amazonaws.services.s3.model.CompleteMultipartUploadResult completeMPUwithRetries(String destKey, String uploadId, List<com.amazonaws.services.s3.model.PartETag> partETags, long length, AtomicInteger errorCount) throws IOException
finalizeMultipartUpload().
Retry policy: retrying, translated.
Retries increment the errorCount counter.destKey - destinationuploadId - multipart operation IdpartETags - list of partial uploadslength - length of the uploaderrorCount - a counter incremented by 1 on every error; for
use in statisticsIOException - if problems arose which could not be retried, or
the retry count was exceeded@Retries.RetryTranslated void abortMultipartUpload(String destKey, String uploadId, boolean shouldRetry, Invoker.Retried retrying) throws IOException
destKey - destination key of the uploaduploadId - multipart operation IdshouldRetry - should failures trigger a retry?retrying - callback invoked on every retryIOException - failure to abortFileNotFoundException - if the abort ID is unknown@Retries.RetryTranslated void abortMultipartUpload(com.amazonaws.services.s3.model.MultipartUpload upload) throws IOException
upload - upload to abort.IOException - on problems.@Retries.RetryTranslated int abortMultipartUploadsUnderPath(String prefix) throws IOException
prefix - prefix for uploads to abortIOException - trouble; FileNotFoundExceptions are swallowed.List<com.amazonaws.services.s3.model.MultipartUpload> listMultipartUploads(String prefix) throws IOException
prefix - prefix for uploads to abortIOException - trouble; FileNotFoundExceptions are swallowed.@Retries.RetryTranslated void abortMultipartCommit(String destKey, String uploadId) throws IOException
destKey - destination key of ongoing operationuploadId - multipart operation IdIOException - on problems.FileNotFoundException - if the abort ID is unknowncom.amazonaws.services.s3.model.UploadPartRequest newUploadPartRequest(String destKey, String uploadId, int partNumber, int size, InputStream uploadStream, File sourceFile, Long offset) throws IOException
uploadStream or sourceFile
must be specified.
A subset of the file may be posted, by providing the starting point
in offset and a length of block in size equal to
or less than the remaining bytes.destKey - destination key of ongoing operationuploadId - ID of ongoing uploadpartNumber - current part number of the uploadsize - amount of datauploadStream - source of data to uploadsourceFile - optional source file.offset - offset in file to start reading.IllegalArgumentException - if the parameters are invalidorg.apache.hadoop.fs.PathIOException - if the part number is out of range.IOException@Retries.RetryTranslated com.amazonaws.services.s3.model.PutObjectResult putObject(com.amazonaws.services.s3.model.PutObjectRequest putObjectRequest) throws IOException
putObjectRequest - the requestIOException - on problems@Retries.RetryTranslated com.amazonaws.services.s3.transfer.model.UploadResult uploadObject(com.amazonaws.services.s3.model.PutObjectRequest putObjectRequest) throws IOException
putObjectRequest - the requestIOException - on problems@Retries.OnceTranslated void revertCommit(String destKey, @Nullable BulkOperationState operationState) throws IOException
destKey - destination keyoperationState - operational state for a bulk updateIOException - on problems@Retries.RetryTranslated com.amazonaws.services.s3.model.CompleteMultipartUploadResult commitUpload(String destKey, String uploadId, List<com.amazonaws.services.s3.model.PartETag> partETags, long length, @Nullable BulkOperationState operationState) throws IOException
finalizeMultipartUpload().
Retry policy: retrying, translated.
Retries increment the errorCount counter.destKey - destinationuploadId - multipart operation IdpartETags - list of partial uploadslength - length of the uploadoperationState - operational state for a bulk updateIOException - if problems arose which could not be retried, or
the retry count was exceededBulkOperationState initiateCommitOperation(org.apache.hadoop.fs.Path path) throws IOException
path - path under which the writes will all take place.IOException - failure to instantiate.BulkOperationState initiateOperation(org.apache.hadoop.fs.Path path, BulkOperationState.OperationType operationType) throws IOException
path - path under which the writes will all take place.operationType - operation to initiateIOException - failure to instantiate.@Retries.RetryTranslated com.amazonaws.services.s3.model.UploadPartResult uploadPart(com.amazonaws.services.s3.model.UploadPartRequest request) throws IOException
request - requestIOException - on problemsorg.apache.hadoop.conf.Configuration getConf()
com.amazonaws.services.s3.model.SelectObjectContentRequest newSelectRequest(org.apache.hadoop.fs.Path path)
path - pre-qualified path for query@Retries.RetryTranslated com.amazonaws.services.s3.model.SelectObjectContentResult select(org.apache.hadoop.fs.Path source, com.amazonaws.services.s3.model.SelectObjectContentRequest request, String action) throws IOException
source - source for selectionrequest - Select request to issue.action - the action for use in exception creationIOException - failurevoid incrementWriteOperations()
Copyright © 2008–2022 Apache Software Foundation. All rights reserved.