ajfabbri commented on a change in pull request #1679: HDFS-13934. Multipart
uploaders to be created through FileSystem/FileContext.
URL: https://github.com/apache/hadoop/pull/1679#discussion_r388676922
##########
File path:
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/impl/FileSystemMultipartUploader.java
##########
@@ -106,17 +165,30 @@ private PathHandle getPathHandle(Path filePath) throws
IOException {
private long totalPartsLen(List<Path> partHandles) throws IOException {
long totalLen = 0;
- for (Path p: partHandles) {
+ for (Path p : partHandles) {
totalLen += fs.getFileStatus(p).getLen();
}
return totalLen;
}
@Override
- @SuppressWarnings("deprecation") // rename w/ OVERWRITE
- public PathHandle complete(Path filePath, Map<Integer, PartHandle> handleMap,
+ public CompletableFuture<PathHandle> complete(
+ UploadHandle uploadId,
+ Path filePath,
+ Map<Integer, PartHandle> handleMap) throws IOException {
+
+ checkPath(filePath);
+ return FutureIOSupport.eval(() ->
+ innerComplete(filePath, handleMap, uploadId));
+ }
+
+ public PathHandle innerComplete(
+ Path filePath,
+ Map<Integer, PartHandle> handleMap,
UploadHandle multipartUploadId) throws IOException {
+ checkPath(filePath);
Review comment:
The caller already did this.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]