hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ji...@apache.org
Subject svn commit: r1564418 - in /hadoop/common/branches/HDFS-5698/hadoop-hdfs-project/hadoop-hdfs: CHANGES_HDFS-5698.txt src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java
Date Tue, 04 Feb 2014 18:55:10 GMT
Author: jing9
Date: Tue Feb  4 18:55:09 2014
New Revision: 1564418

URL: http://svn.apache.org/r1564418
Log:
HDFS-5871. Use PBHelper to serialize CacheDirectiveInfoExpirationProto. Contributed by Haohui
Mai.

Modified:
    hadoop/common/branches/HDFS-5698/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5698.txt
    hadoop/common/branches/HDFS-5698/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java

Modified: hadoop/common/branches/HDFS-5698/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5698.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-5698/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5698.txt?rev=1564418&r1=1564417&r2=1564418&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-5698/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5698.txt
(original)
+++ hadoop/common/branches/HDFS-5698/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5698.txt
Tue Feb  4 18:55:09 2014
@@ -31,3 +31,6 @@ HDFS-5698 subtasks
     HDFS-5797. Implement offline image viewer. (Haohui Mai via jing9)
 
     HDFS-5771. Track progress when loading fsimage. (Haohui Mai via cnauroth)
+
+    HDFS-5871. Use PBHelper to serialize CacheDirectiveInfoExpirationProto.
+    (Haohui Mai via jing9)

Modified: hadoop/common/branches/HDFS-5698/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-5698/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java?rev=1564418&r1=1564417&r2=1564418&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-5698/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java
(original)
+++ hadoop/common/branches/HDFS-5698/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java
Tue Feb  4 18:55:09 2014
@@ -67,6 +67,7 @@ import org.apache.hadoop.hdfs.protocol.L
 import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.CacheDirectiveInfoExpirationProto;
 import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.CacheDirectiveInfoProto;
 import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.CachePoolInfoProto;
+import org.apache.hadoop.hdfs.protocolPB.PBHelper;
 import org.apache.hadoop.hdfs.server.blockmanagement.BlockManager;
 import org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor;
 import org.apache.hadoop.hdfs.server.blockmanagement.DatanodeDescriptor;
@@ -993,18 +994,23 @@ public final class CacheManager {
       CacheDirectiveInfo info = directive.toInfo();
       CacheDirectiveInfoProto.Builder b = CacheDirectiveInfoProto.newBuilder();
 
-      if (info.getPath() != null)
+      if (info.getPath() != null) {
         b.setPath(info.getPath().toUri().getPath());
+      }
 
-      if (info.getReplication() != null)
+      if (info.getReplication() != null) {
         b.setReplication(info.getReplication());
+      }
 
-      if (info.getPool() != null)
+      if (info.getPool() != null) {
         b.setPool(info.getPool());
+      }
 
-      if (info.getExpiration() != null)
-        b.setExpiration(CacheDirectiveInfoExpirationProto.newBuilder()
-            .setMillis(info.getExpiration().getMillis()));
+      Expiration expiry = info.getExpiration();
+      if (expiry != null) {
+        assert (!expiry.isRelative());
+        b.setExpiration(PBHelper.convert(expiry));
+      }
 
       directives.add(b.build());
     }



Mime
View raw message