From 20878d052cebc715c2494a97362fdff08885a77f Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Thu, 23 Mar 2017 12:52:22 +0000 Subject: [PATCH] HADOOP-14120 needless S3AFileSystem.setOptionalPutRequestParameters in S3ABlockOutputStream putObject(). Contributed by Yuanbo Liu --- .../java/org/apache/hadoop/fs/s3a/S3ABlockOutputStream.java | 5 ++--- .../main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3ABlockOutputStream.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3ABlockOutputStream.java index 1b0929b5c80..3fbdcb06ba8 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3ABlockOutputStream.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3ABlockOutputStream.java @@ -378,9 +378,8 @@ class S3ABlockOutputStream extends OutputStream { int size = block.dataSize(); final S3ADataBlocks.BlockUploadData uploadData = block.startUpload(); final PutObjectRequest putObjectRequest = uploadData.hasFile() ? - writeOperationHelper.newPutRequest(uploadData.getFile()) - : writeOperationHelper.newPutRequest(uploadData.getUploadStream(), size); - fs.setOptionalPutRequestParameters(putObjectRequest); + writeOperationHelper.newPutRequest(uploadData.getFile()) : + writeOperationHelper.newPutRequest(uploadData.getUploadStream(), size); long transferQueueTime = now(); BlockUploadProgress callback = new BlockUploadProgress( diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java index d4d97b70404..53a0321b183 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java @@ -1869,7 +1869,7 @@ public class S3AFileSystem extends FileSystem { } } - protected void setOptionalPutRequestParameters(PutObjectRequest request) { + private void setOptionalPutRequestParameters(PutObjectRequest request) { switch (serverSideEncryptionAlgorithm) { case SSE_KMS: request.setSSEAwsKeyManagementParams(generateSSEAwsKeyParams());