HADOOP-14774. S3A case "testRandomReadOverBuffer" failed due to improper range parameter.

Contributed by Yonger.

(cherry picked from commit 83449abb40)
This commit is contained in:
Steve Loughran 2017-09-07 19:58:40 +01:00
parent 48279f7876
commit 6e20ae954c
No known key found for this signature in database
GPG Key ID: 950CC3E032B79CA2
1 changed files with 1 additions and 1 deletions

View File

@ -152,7 +152,7 @@ public class S3AInputStream extends FSInputStream implements CanSetReadahead {
streamStatistics.streamOpened(); streamStatistics.streamOpened();
try { try {
GetObjectRequest request = new GetObjectRequest(bucket, key) GetObjectRequest request = new GetObjectRequest(bucket, key)
.withRange(targetPos, contentRangeFinish); .withRange(targetPos, contentRangeFinish - 1);
if (S3AEncryptionMethods.SSE_C.equals(serverSideEncryptionAlgorithm) && if (S3AEncryptionMethods.SSE_C.equals(serverSideEncryptionAlgorithm) &&
StringUtils.isNotBlank(serverSideEncryptionKey)){ StringUtils.isNotBlank(serverSideEncryptionKey)){
request.setSSECustomerKey(new SSECustomerKey(serverSideEncryptionKey)); request.setSSECustomerKey(new SSECustomerKey(serverSideEncryptionKey));