Author: tgraves
Date: Mon Dec 17 18:03:39 2012
New Revision: 1423066

URL: http://svn.apache.org/viewvc?rev=1423066&view=rev
Log:
Revert HDFS-4307

Modified:
    
hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
    
hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/SocketCache.java

Modified: 
hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1423066&r1=1423065&r2=1423066&view=diff
==============================================================================
--- 
hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt 
(original)
+++ 
hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt 
Mon Dec 17 18:03:39 2012
@@ -26,9 +26,6 @@ Release 0.23.6 - UNRELEASED
     HDFS-4248. Renaming directories may incorrectly remove the paths in leases
     under the tree.  (daryn via szetszwo)
 
-    HDFS-4307. SocketCache should use monotonic time (Colin Patrick McCabe
-    via tgraves)
-
     HDFS-4315. DNs with multiple BPs can have BPOfferServices fail to start
     due to unsynchronized map access. (atm via tgraves)
 

Modified: 
hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/SocketCache.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/SocketCache.java?rev=1423066&r1=1423065&r2=1423066&view=diff
==============================================================================
--- 
hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/SocketCache.java
 (original)
+++ 
hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/SocketCache.java
 Mon Dec 17 18:03:39 2012
@@ -34,7 +34,6 @@ import org.apache.commons.logging.LogFac
 import org.apache.hadoop.io.IOUtils;
 import org.apache.hadoop.util.Daemon;
 import org.apache.hadoop.util.StringUtils;
-import org.apache.hadoop.util.Time;
 
 /**
  * A cache of input stream sockets to Data Node.
@@ -55,7 +54,7 @@ class SocketCache {
     public SocketProp(Socket s)
     {
       this.s=s;
-      this.createTime = Time.monotonicNow();
+      this.createTime = System.currentTimeMillis();
     }
 
     public long getCreateTime() {
@@ -185,7 +184,7 @@ class SocketCache {
 
       // if oldest socket expired, remove it
       if (entry == null || 
-        Time.monotonicNow() - entry.getValue().getCreateTime() < 
+        System.currentTimeMillis() - entry.getValue().getCreateTime() < 
         expiryPeriod) {
         break;
       }
@@ -215,13 +214,13 @@ class SocketCache {
    * older than expiryPeriod minutes
    */
   private void run() throws InterruptedException {
-    for(long lastExpiryTime = Time.monotonicNow();
+    for(long lastExpiryTime = System.currentTimeMillis();
         !Thread.interrupted();
         Thread.sleep(expiryPeriod)) {
-      final long elapsed = Time.monotonicNow() - lastExpiryTime;
+      final long elapsed = System.currentTimeMillis() - lastExpiryTime;
       if (elapsed >= expiryPeriod) {
         evictExpired(expiryPeriod);
-        lastExpiryTime = Time.monotonicNow();
+        lastExpiryTime = System.currentTimeMillis();
       }
     }
     clear();


Reply via email to