sadanand48 commented on code in PR #6551:
URL: https://github.com/apache/hadoop/pull/6551#discussion_r1740147516


##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java:
##########
@@ -3862,6 +3869,11 @@ protected EnumSet<CreateFlag> getFlags() {
      */
     @Override
     public FSDataOutputStream build() throws IOException {
+      if (getOptionalKeys().contains(
+          Options.OpenFileOptions.FS_OPTION_OPENFILE_EC_POLICY)) {
+        ecPolicyName(getOptions().get(

Review Comment:
   Done.



##########
hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/mapred/RetriableDirectoryCreateCommand.java:
##########
@@ -66,11 +68,12 @@ protected Object doExecute(Object... arguments) throws 
Exception {
     boolean preserveEC = getFileAttributeSettings(context)
         .contains(DistCpOptions.FileAttribute.ERASURECODINGPOLICY);
     if (preserveEC && sourceStatus.isErasureCoded()
-        && targetFS instanceof DistributedFileSystem) {
-      ErasureCodingPolicy ecPolicy =
-          ((HdfsFileStatus) sourceStatus).getErasureCodingPolicy();
-      DistributedFileSystem dfs = (DistributedFileSystem) targetFS;
-      dfs.setErasureCodingPolicy(target, ecPolicy.getName());
+        && targetFS instanceof WithErasureCoding) {
+      ErasureCodingPolicy ecPolicy = SystemErasureCodingPolicies.getByName(

Review Comment:
   Done.



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