hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weic...@apache.org
Subject [hadoop] branch branch-3.2 updated: HDFS-14686. HttpFS: HttpFSFileSystem#getErasureCodingPolicy always returns null (#1192) Contributed by Siyao Meng.
Date Fri, 04 Oct 2019 16:40:37 GMT
This is an automated email from the ASF dual-hosted git repository.

weichiu pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.2 by this push:
     new 673c9d5  HDFS-14686. HttpFS: HttpFSFileSystem#getErasureCodingPolicy always returns
null (#1192) Contributed by Siyao Meng.
673c9d5 is described below

commit 673c9d53ca5926c818815e01cb178612d1cd433e
Author: Siyao Meng <50227127+smengcl@users.noreply.github.com>
AuthorDate: Thu Aug 1 17:15:22 2019 -0700

    HDFS-14686. HttpFS: HttpFSFileSystem#getErasureCodingPolicy always returns null (#1192)
Contributed by Siyao Meng.
    
    (cherry picked from commit 17e8cf501b384af93726e4f2e6f5e28c6e3a8f65)
---
 .../src/main/java/org/apache/hadoop/hdfs/web/JsonUtilClient.java      | 4 +++-
 .../main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java  | 4 +++-
 .../src/main/java/org/apache/hadoop/fs/http/server/FSOperations.java  | 2 ++
 .../java/org/apache/hadoop/fs/http/client/BaseTestHttpFSWith.java     | 2 ++
 4 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/JsonUtilClient.java
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/JsonUtilClient.java
index 34ad50f..f9b847c 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/JsonUtilClient.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/JsonUtilClient.java
@@ -432,10 +432,12 @@ public class JsonUtilClient {
     final long length = ((Number) m.get("length")).longValue();
     final long fileCount = ((Number) m.get("fileCount")).longValue();
     final long directoryCount = ((Number) m.get("directoryCount")).longValue();
+    final String ecPolicy = ((String) m.get("ecPolicy"));
     ContentSummary.Builder builder = new ContentSummary.Builder()
         .length(length)
         .fileCount(fileCount)
-        .directoryCount(directoryCount);
+        .directoryCount(directoryCount)
+        .erasureCodingPolicy(ecPolicy);
     builder = buildQuotaUsage(builder, m, ContentSummary.Builder.class);
     return builder.build();
   }
diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java
b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java
index 1efafe7..ac909dd 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java
@@ -193,6 +193,7 @@ public class HttpFSFileSystem extends FileSystem
 
   public static final String CONTENT_SUMMARY_JSON = "ContentSummary";
   public static final String CONTENT_SUMMARY_DIRECTORY_COUNT_JSON = "directoryCount";
+  public static final String CONTENT_SUMMARY_ECPOLICY_JSON = "ecPolicy";
   public static final String CONTENT_SUMMARY_FILE_COUNT_JSON = "fileCount";
   public static final String CONTENT_SUMMARY_LENGTH_JSON = "length";
 
@@ -1140,7 +1141,8 @@ public class HttpFSFileSystem extends FileSystem
     ContentSummary.Builder builder = new ContentSummary.Builder()
         .length((Long) json.get(CONTENT_SUMMARY_LENGTH_JSON))
         .fileCount((Long) json.get(CONTENT_SUMMARY_FILE_COUNT_JSON))
-        .directoryCount((Long) json.get(CONTENT_SUMMARY_DIRECTORY_COUNT_JSON));
+        .directoryCount((Long) json.get(CONTENT_SUMMARY_DIRECTORY_COUNT_JSON))
+        .erasureCodingPolicy((String) json.get(CONTENT_SUMMARY_ECPOLICY_JSON));
     builder = buildQuotaUsage(builder, json, ContentSummary.Builder.class);
     return builder.build();
   }
diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/FSOperations.java
b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/FSOperations.java
index 3f79256..043f3e1 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/FSOperations.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/FSOperations.java
@@ -265,6 +265,8 @@ public class FSOperations {
     Map json = new LinkedHashMap();
     json.put(HttpFSFileSystem.CONTENT_SUMMARY_DIRECTORY_COUNT_JSON,
         contentSummary.getDirectoryCount());
+    json.put(HttpFSFileSystem.CONTENT_SUMMARY_ECPOLICY_JSON,
+        contentSummary.getErasureCodingPolicy());
     json.put(HttpFSFileSystem.CONTENT_SUMMARY_FILE_COUNT_JSON,
         contentSummary.getFileCount());
     json.put(HttpFSFileSystem.CONTENT_SUMMARY_LENGTH_JSON,
diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/BaseTestHttpFSWith.java
b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/BaseTestHttpFSWith.java
index d8e1379..08cdb12 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/BaseTestHttpFSWith.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/BaseTestHttpFSWith.java
@@ -682,6 +682,8 @@ public abstract class BaseTestHttpFSWith extends HFSTestCase {
     fs.close();
     assertEquals(hdfsContentSummary.getDirectoryCount(),
         httpContentSummary.getDirectoryCount());
+    assertEquals(hdfsContentSummary.getErasureCodingPolicy(),
+        httpContentSummary.getErasureCodingPolicy());
     assertEquals(hdfsContentSummary.getFileCount(),
         httpContentSummary.getFileCount());
     assertEquals(hdfsContentSummary.getLength(),


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message