@InterfaceAudience.Public @InterfaceStability.Unstable public interface MultipartUploader extends Closeable, org.apache.hadoop.fs.statistics.IOStatisticsSource
IOStatisticsSource
so that there is no
need to cast an instance to see if is a source of statistics.
However, implementations MAY return null for their actual statistics.Modifier and Type | Method and Description |
---|---|
CompletableFuture<Void> |
abort(UploadHandle uploadId,
Path filePath)
Aborts a multipart upload.
|
CompletableFuture<Integer> |
abortUploadsUnderPath(Path path)
Best effort attempt to aborts multipart uploads under a path.
|
CompletableFuture<PathHandle> |
complete(UploadHandle uploadId,
Path filePath,
Map<Integer,PartHandle> handles)
Complete a multipart upload.
|
CompletableFuture<PartHandle> |
putPart(UploadHandle uploadId,
int partNumber,
Path filePath,
InputStream inputStream,
long lengthInBytes)
Put part as part of a multipart upload.
|
CompletableFuture<UploadHandle> |
startUpload(Path filePath)
Initialize a multipart upload.
|
CompletableFuture<UploadHandle> startUpload(Path filePath) throws IOException
filePath
- Target path for upload.IOException
- IO failureCompletableFuture<PartHandle> putPart(UploadHandle uploadId, int partNumber, Path filePath, InputStream inputStream, long lengthInBytes) throws IOException
uploadId
- Identifier from startUpload(Path)
.partNumber
- Index of the part relative to others.filePath
- Target path for upload (as startUpload(Path)
).inputStream
- Data for this part. Implementations MUST close this
stream after reading in the data.lengthInBytes
- Target length to read from the stream.IOException
- IO failureCompletableFuture<PathHandle> complete(UploadHandle uploadId, Path filePath, Map<Integer,PartHandle> handles) throws IOException
uploadId
- Identifier from startUpload(Path)
.filePath
- Target path for upload (as startUpload(Path)
.handles
- non-empty map of part number to part handle.
from putPart(UploadHandle, int, Path, InputStream, long)
.IOException
- IO failureCompletableFuture<Void> abort(UploadHandle uploadId, Path filePath) throws IOException
uploadId
- Identifier from startUpload(Path)
.filePath
- Target path for upload (same as startUpload(Path)
.IOException
- IO failureCompletableFuture<Integer> abortUploadsUnderPath(Path path) throws IOException
path
- path to abort uploads under.IOException
- IO failureCopyright © 2021 Apache Software Foundation. All rights reserved.