[ 
https://issues.apache.org/jira/browse/HDFS-17381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17878439#comment-17878439
 ] 

ASF GitHub Bot commented on HDFS-17381:
---------------------------------------

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.





> Distcp of EC files should not be limited to DFS.
> ------------------------------------------------
>
>                 Key: HDFS-17381
>                 URL: https://issues.apache.org/jira/browse/HDFS-17381
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: distcp
>            Reporter: Sadanand Shenoy
>            Assignee: Sadanand Shenoy
>            Priority: Major
>              Labels: pull-request-available
>
> Currently EC file support in distcp is limited to DFS and the code checks if 
> the given FS instance is DistributedFileSystem, In Ozone, EC is supported 
> now, and this limitation can be removed and a general contract for any 
> filesystem that supports EC files should be allowed by implementing few 
> interfaces/methods.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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