sumitagrawl commented on code in PR #4095:
URL: https://github.com/apache/ozone/pull/4095#discussion_r1050358200


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadWithFSO.java:
##########
@@ -311,6 +315,118 @@ public void testUploadPartOverrideWithRatis() throws 
IOException {
         commitUploadPartInfo.getPartName());
   }
 
+  @Test
+  public void testUploadTwiceWithEC() throws IOException {
+
+    String volumeName = UUID.randomUUID().toString();
+    String bucketName = UUID.randomUUID().toString();
+    String keyName = UUID.randomUUID().toString();
+    StringBuilder sb = new StringBuilder("sample Value");
+    for (int i = 0; i < 4096; ++i) {
+      sb.append("01234567890123456789");
+    }
+    String sampleData = sb.toString();
+
+    store.createVolume(volumeName);
+    OzoneVolume volume = store.getVolume(volumeName);
+    OzoneBucket bucket = getOzoneECBucket(volumeName, bucketName);
+
+    // perform upload and complete
+    OmMultipartInfo multipartInfo = bucket.initiateMultipartUpload(keyName,
+        bucket.getReplicationConfig());
+
+    String uploadID = multipartInfo.getUploadID();
+    int partNumber = 1;
+
+    OzoneOutputStream ozoneOutputStream = bucket.createMultipartKey(keyName,
+        sampleData.length(), partNumber, uploadID);
+    ozoneOutputStream.write(string2Bytes(sampleData), 0, sampleData.length());
+    ozoneOutputStream.close();
+
+    OmMultipartCommitUploadPartInfo commitUploadPartInfo = ozoneOutputStream
+        .getCommitUploadPartInfo();
+
+    String partName = commitUploadPartInfo.getPartName();
+    Map<Integer, String> partsMap = new HashMap<>();
+    partsMap.put(partNumber, partName);
+    bucket.completeMultipartUpload(keyName, uploadID, partsMap);
+
+    Assert.assertEquals(volume.getBucket(bucketName).getUsedBytes(), 137228);

Review Comment:
   @sodonnel Updated...



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to