rakeshadr commented on code in PR #12022:
URL: https://github.com/apache/ozone/pull/12022#discussion_r4596409526


##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/protocol/ClientProtocol.java:
##########
@@ -1279,6 +1279,32 @@ OzoneOutputStream createFile(String volumeName, String 
bucketName,
       String keyName, long size, ReplicationConfig replicationConfig,
       boolean overWrite, boolean recursive) throws IOException;
 
+  /**
+   * Creates an output stream for writing to a file.
+   *
+   * @param volumeName Volume name
+   * @param bucketName Bucket name
+   * @param keyName    Absolute path of the file to be written
+   * @param size       Size of data to be written
+   * @param replicationConfig Replication config
+   * @param overWrite  if true existing file at the location will be 
overwritten
+   * @param recursive  if true file would be created even if parent directories
+   *                   do not exist
+   * @param storagePolicy storage policy for the file, or null to let the OM
+   *                      use the bucket's policy
+   * @return Output stream for writing to the file
+   * @throws OMException if given key is a directory
+   *                     if file exists and isOverwrite flag is false
+   *                     if an ancestor exists as a file
+   *                     if bucket does not exist
+   * @throws IOException if there is error in the db
+   *                     invalid arguments
+   */
+  @SuppressWarnings("checkstyle:parameternumber")
+  OzoneOutputStream createFile(String volumeName, String bucketName,
+      String keyName, long size, ReplicationConfig replicationConfig,
+      boolean overWrite, boolean recursive, @Nullable StoragePolicy 
storagePolicy) throws IOException;

Review Comment:
   The same case https://issues.apache.org/jira/browse/HDDS-17839 is applicable 
here as well. Please take care



##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/protocol/ClientProtocol.java:
##########
@@ -1279,6 +1279,32 @@ OzoneOutputStream createFile(String volumeName, String 
bucketName,
       String keyName, long size, ReplicationConfig replicationConfig,
       boolean overWrite, boolean recursive) throws IOException;
 
+  /**
+   * Creates an output stream for writing to a file.
+   *
+   * @param volumeName Volume name
+   * @param bucketName Bucket name
+   * @param keyName    Absolute path of the file to be written
+   * @param size       Size of data to be written
+   * @param replicationConfig Replication config
+   * @param overWrite  if true existing file at the location will be 
overwritten
+   * @param recursive  if true file would be created even if parent directories
+   *                   do not exist
+   * @param storagePolicy storage policy for the file, or null to let the OM
+   *                      use the bucket's policy
+   * @return Output stream for writing to the file
+   * @throws OMException if given key is a directory
+   *                     if file exists and isOverwrite flag is false
+   *                     if an ancestor exists as a file
+   *                     if bucket does not exist
+   * @throws IOException if there is error in the db
+   *                     invalid arguments
+   */
+  @SuppressWarnings("checkstyle:parameternumber")
+  OzoneOutputStream createFile(String volumeName, String bucketName,
+      String keyName, long size, ReplicationConfig replicationConfig,
+      boolean overWrite, boolean recursive, @Nullable StoragePolicy 
storagePolicy) throws IOException;
+
   @SuppressWarnings("checkstyle:parameternumber")
   OzoneDataStreamOutput createStreamFile(String volumeName, String bucketName,

Review Comment:
   Please add `StoragePolicy storagePolicy` in `#createStreamFile() ` streaming 
api. If a user creates a file via the streaming path, then we can provide that 
option to the users. Raise a separate jira task and work on, if the code 
changes are more.



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