[ 
https://issues.apache.org/jira/browse/HDDS-1942?focusedWorklogId=293873&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-293873
 ]

ASF GitHub Bot logged work on HDDS-1942:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Aug/19 12:40
            Start Date: 13/Aug/19 12:40
    Worklog Time Spent: 10m 
      Work Description: lokeshj1703 commented on pull request #1279: HDDS-1942. 
Support copy during S3 multipart upload part creation
URL: https://github.com/apache/hadoop/pull/1279#discussion_r313367705
 
 

 ##########
 File path: 
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java
 ##########
 @@ -736,4 +761,25 @@ private CopyObjectResponse copyObject(String copyHeader,
       }
     }
   }
+
+  /**
+   * Parse the key and bucket name from copy header.
+   */
+  private Pair<String, String> parseSourceHeader(String copyHeader)
+      throws OS3Exception {
+    String header = copyHeader;
+    if (header.startsWith("/")) {
+      header = copyHeader.substring(1);
+    }
+    int pos = header.indexOf("/");
+    if (pos == -1) {
+      OS3Exception ex = S3ErrorTable.newError(S3ErrorTable
+          .INVALID_ARGUMENT, header);
+      ex.setErrorMessage("Copy Source must mention the source bucket and " +
+          "key: sourcebucket/sourcekey");
+      throw ex;
+    }
+
+    return Pair.of(copyHeader.substring(0, pos), copyHeader.substring(pos + 
1));
 
 Review comment:
   I think this should use header instead of copyHeader 
`Pair.of(header.substring(0, pos), header.substring(pos + 1))`? I think we can 
just use a single variable here for clarity?
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 293873)
    Time Spent: 0.5h  (was: 20m)

> Support copy during S3 multipart upload part creation
> -----------------------------------------------------
>
>                 Key: HDDS-1942
>                 URL: https://issues.apache.org/jira/browse/HDDS-1942
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>          Components: S3
>            Reporter: Elek, Marton
>            Assignee: Elek, Marton
>            Priority: Blocker
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Uploads a part by copying data from an existing object as data source
> Documented here:
> https://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadUploadPartCopy.html



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to