You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ra...@apache.org on 2008/10/17 23:39:28 UTC

svn commit: r705763 - in /hadoop/core/branches/branch-0.19: ./ CHANGES.txt src/hdfs/org/apache/hadoop/hdfs/server/namenode/INode.java

Author: rangadi
Date: Fri Oct 17 14:39:27 2008
New Revision: 705763

URL: http://svn.apache.org/viewvc?rev=705763&view=rev
Log:
HADOOP-4398. No need to truncate access time in INode. Also fixes NPE
in CreateEditsLog. (Raghu Angadi)

Modified:
    hadoop/core/branches/branch-0.19/   (props changed)
    hadoop/core/branches/branch-0.19/CHANGES.txt
    hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INode.java

Propchange: hadoop/core/branches/branch-0.19/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Oct 17 14:39:27 2008
@@ -1 +1 @@
-/hadoop/core/trunk:697306,698176,699056,699098,699415,699424,699444,699490,699517,700163,700628,700923,701273,701398,703923,704203,704261,704701,704703,704707,704712,704732,704748,704989,705391,705420,705430
+/hadoop/core/trunk:697306,698176,699056,699098,699415,699424,699444,699490,699517,700163,700628,700923,701273,701398,703923,704203,704261,704701,704703,704707,704712,704732,704748,704989,705391,705420,705430,705762

Modified: hadoop/core/branches/branch-0.19/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/CHANGES.txt?rev=705763&r1=705762&r2=705763&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.19/CHANGES.txt Fri Oct 17 14:39:27 2008
@@ -923,6 +923,9 @@
 
     HADOOP-4292. Do not support append() for LocalFileSystem. (hairong)
 
+    HADOOP-4398. No need to truncate access time in INode. Also fixes NPE 
+    in CreateEditsLog. (Raghu Angadi) 
+
 Release 0.18.1 - 2008-09-17
 
   IMPROVEMENTS

Modified: hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INode.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INode.java?rev=705763&r1=705762&r2=705763&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INode.java (original)
+++ hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INode.java Fri Oct 17 14:39:27 2008
@@ -27,7 +27,6 @@
 import org.apache.hadoop.hdfs.protocol.Block;
 import org.apache.hadoop.hdfs.protocol.LocatedBlock;
 import org.apache.hadoop.hdfs.protocol.LocatedBlocks;
-import org.apache.hadoop.hdfs.server.namenode.FSNamesystem;
 
 /**
  * We keep an in-memory representation of the file/block hierarchy.
@@ -38,7 +37,7 @@
   protected byte[] name;
   protected INodeDirectory parent;
   protected long modificationTime;
-  protected int accessTime; // precise to the last hour
+  protected long accessTime;
 
   /** Simple wrapper for two counters : 
    *  nsCount (namespace consumed) and dsCount (diskspace consumed).
@@ -291,19 +290,14 @@
    * @return access time
    */
   public long getAccessTime() {
-    return this.accessTime * FSNamesystem.getFSNamesystem().getAccessTimePrecision();
+    return accessTime;
   }
 
   /**
    * Set last access time of inode.
    */
   void setAccessTime(long atime) {
-    long precision = FSNamesystem.getFSNamesystem().getAccessTimePrecision();
-    if (precision == 0) {
-      this.accessTime = 0;
-    } else {
-      this.accessTime = (int)(atime/precision);
-    }
+    accessTime = atime;
   }
 
   /**