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:36:50 UTC

svn commit: r705762 - in /hadoop/core/trunk: CHANGES.txt src/hdfs/org/apache/hadoop/hdfs/server/namenode/INode.java

Author: rangadi
Date: Fri Oct 17 14:36:50 2008
New Revision: 705762

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

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INode.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=705762&r1=705761&r2=705762&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Fri Oct 17 14:36:50 2008
@@ -979,6 +979,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/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INode.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INode.java?rev=705762&r1=705761&r2=705762&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INode.java (original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INode.java Fri Oct 17 14:36:50 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;
   }
 
   /**