Browse Source

HDFS-5911. The id of a CacheDirective instance does not get serialized in the protobuf-fsimage. Contributed by Haohui Mai.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-5698@1565844 13f79535-47bb-0310-9956-ffa450edef68
Jing Zhao 11 năm trước cách đây
mục cha
commit
45ffc3bff6

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5698.txt

@@ -43,3 +43,6 @@ HDFS-5698 subtasks
 
     HDFS-5906. Fixing findbugs and javadoc warnings in the HDFS-5698 branch.
     (Haohui Mai via jing9)
+
+    HDFS-5911. The id of a CacheDirective instance does not get serialized in 
+    the protobuf-fsimage. (Haohui Mai via jing9)

+ 2 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java

@@ -992,7 +992,8 @@ public final class CacheManager {
 
     for (CacheDirective directive : directivesById.values()) {
       CacheDirectiveInfo info = directive.toInfo();
-      CacheDirectiveInfoProto.Builder b = CacheDirectiveInfoProto.newBuilder();
+      CacheDirectiveInfoProto.Builder b = CacheDirectiveInfoProto.newBuilder()
+          .setId(info.getId());
 
       if (info.getPath() != null) {
         b.setPath(info.getPath().toUri().getPath());