You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/10/24 01:39:27 UTC

[GitHub] [ozone] guohao-rosicky commented on a change in pull request #2760: HDDS-5879. [Ozone-Streaming] OzoneBucket add the createMultipartStreamKey method

guohao-rosicky commented on a change in pull request #2760:
URL: https://github.com/apache/ozone/pull/2760#discussion_r735049487



##########
File path: hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
##########
@@ -1117,6 +1117,69 @@ public OzoneOutputStream createMultipartKey(String volumeName,
     }
   }
 
+  @Override
+  public OzoneDataStreamOutput createMultipartStreamKey(
+          String volumeName,
+          String bucketName,
+          String keyName,
+          long size,
+          int partNumber,
+          String uploadID,
+          ReplicationConfig replicationConfig)
+          throws IOException {
+    verifyVolumeName(volumeName);
+    verifyBucketName(bucketName);
+    if(checkKeyNameEnabled) {
+      HddsClientUtils.verifyKeyName(keyName);
+    }
+    HddsClientUtils.checkNotNull(keyName, uploadID, replicationConfig);
+    Preconditions.checkArgument(partNumber > 0 && partNumber <=10000, "Part " +
+        "number should be greater than zero and less than or equal to 10000");
+    Preconditions.checkArgument(size >=0, "size should be greater than or " +
+        "equal to zero");
+    String requestId = UUID.randomUUID().toString();
+
+    OmKeyArgs keyArgs = new OmKeyArgs.Builder()
+            .setVolumeName(volumeName)
+            .setBucketName(bucketName)
+            .setKeyName(keyName)
+            .setDataSize(size)
+            .setIsMultipartKey(true)
+            .setMultipartUploadID(uploadID)
+            .setMultipartUploadPartNumber(partNumber)
+            .setAcls(getAclList())
+            .build();
+
+    OpenKeySession openKey = ozoneManagerClient.openKey(keyArgs);
+
+    KeyDataStreamOutput keyOutputStream =
+            new KeyDataStreamOutput.Builder()
+                .setHandler(openKey)
+                .setXceiverClientManager(xceiverClientManager)
+                .setOmClient(ozoneManagerClient)
+                .setRequestID(requestId)
+                .setReplicationConfig(replicationConfig)
+                .setMultipartNumber(partNumber)
+                .setMultipartUploadID(uploadID)
+                .setIsMultipartKey(true)
+                .enableUnsafeByteBufferConversion(unsafeByteBufferConversion)
+                .setConfig(clientConfig)
+                .build();
+    keyOutputStream
+            .addPreallocateBlocks(
+                openKey.getKeyInfo().getLatestVersionLocations(),
+                openKey.getOpenVersion());
+
+    FileEncryptionInfo feInfo = openKey.getKeyInfo().getFileEncryptionInfo();
+    if (feInfo != null) {

Review comment:
       Thanks @bharatviswa504 , new jira url: https://issues.apache.org/jira/browse/HDDS-5892




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org