hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject svn commit: r742176 - in /hadoop/core/branches/branch-0.19: CHANGES.txt src/hdfs/org/apache/hadoop/hdfs/server/namenode/EditLogOutputStream.java src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
Date Sun, 08 Feb 2009 21:44:38 GMT
Author: shv
Date: Sun Feb  8 21:44:38 2009
New Revision: 742176

URL: http://svn.apache.org/viewvc?rev=742176&view=rev
Log:
HADOOP-5193. Merge -r 742170:742171 from trunk to branch 0.19.

Modified:
    hadoop/core/branches/branch-0.19/CHANGES.txt
    hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/EditLogOutputStream.java
    hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java

Modified: hadoop/core/branches/branch-0.19/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/CHANGES.txt?rev=742176&r1=742175&r2=742176&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.19/CHANGES.txt Sun Feb  8 21:44:38 2009
@@ -92,6 +92,8 @@
     HADOOP-5161. Accepted sockets do not get placed in
     DataXceiverServer#childSockets. (hairong)
 
+    HADOOP-5193. Correct calculation of edits modification time. (shv)
+
 Release 0.19.0 - 2008-11-18
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/EditLogOutputStream.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/EditLogOutputStream.java?rev=742176&r1=742175&r2=742176&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/EditLogOutputStream.java
(original)
+++ hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/EditLogOutputStream.java
Sun Feb  8 21:44:38 2009
@@ -93,15 +93,11 @@
 
   /**
    * Return the size of the current edits log.
+   * Length is used to check when it is large enough to start a checkpoint.
    */
   abstract long length() throws IOException;
 
   /**
-   * Returns the time the edits log stream was last modified. 
-   */
-  abstract long lastModified();
-
-  /**
    * Return total time spent in {@link #flushAndSync()}
    */
   long getTotalSyncTime() {

Modified: hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java?rev=742176&r1=742175&r2=742176&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
(original)
+++ hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
Sun Feb  8 21:44:38 2009
@@ -215,14 +215,6 @@
       // file size + size of both buffers
       return fc.size() + bufReady.size() + bufCurrent.size();
     }
-    
-    /**
-     * Returns the time the edits log file was last modified. 
-     */
-    @Override
-    long lastModified() {
-      return file.lastModified();
-    }
 
     // allocate a big chunk of data
     private void preallocate() throws IOException {
@@ -1203,7 +1195,10 @@
    * Returns the timestamp of the edit log
    */
   synchronized long getFsEditTime() {
-    return editStreams.get(0).lastModified();
+    Iterator<StorageDirectory> it = fsimage.dirIterator(NameNodeDirType.EDITS);
+    if(it.hasNext())
+      return getEditFile(it.next()).lastModified();
+    return 0;
   }
 
   // sets the initial capacity of the flush buffer.



Mime
View raw message