You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by mi...@apache.org on 2023/02/08 22:54:30 UTC

[impala] 02/02: IMPALA-11903: Ozone emits NONE when not erasure-coded

This is an automated email from the ASF dual-hosted git repository.

michaelsmith pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 5abbb9bd17373c8aafe6d213d328e16934cdca07
Author: Michael Smith <mi...@cloudera.com>
AuthorDate: Tue Feb 7 13:05:57 2023 -0800

    IMPALA-11903: Ozone emits NONE when not erasure-coded
    
    Updates Ozone support for identifying erasure-coded files/tables to emit
    NONE if not erasure-coded rather than the Ratis replication factor (e.g.
    ONE, THREE, etc). Chose to do this for consistency as the output
    specifically identifies the Erasure Coding Policy.
    
    Testing:
    - ran E2E tests with Ozone with and without EC
    
    Change-Id: I1c3a34d4e108fed38b66f3dabefe867be5441b35
    Reviewed-on: http://gerrit.cloudera.org:8080/19482
    Reviewed-by: Joe McDonnell <jo...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 fe/src/main/java/org/apache/impala/common/FileSystemUtil.java | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fe/src/main/java/org/apache/impala/common/FileSystemUtil.java b/fe/src/main/java/org/apache/impala/common/FileSystemUtil.java
index 5ed8b4cae..e50fb85ba 100644
--- a/fe/src/main/java/org/apache/impala/common/FileSystemUtil.java
+++ b/fe/src/main/java/org/apache/impala/common/FileSystemUtil.java
@@ -241,6 +241,12 @@ public class FileSystemUtil {
     } else if (isOzoneFileSystem(p)) {
       try {
         FileSystem fs = p.getFileSystem(CONF);
+        if (!fs.getFileStatus(p).isErasureCoded()) {
+          // Ozone will return the replication factor (ONE, THREE, etc) for Ratis
+          // replication. We avoid returning that for consistency.
+          return NO_ERASURE_CODE_LABEL;
+        }
+
         if (fs instanceof BasicRootedOzoneFileSystem) {
           BasicRootedOzoneFileSystem ofs = (BasicRootedOzoneFileSystem) fs;
           Preconditions.checkState(