hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From min...@apache.org
Subject hadoop git commit: HDFS-11296. Maintenance state expiry should be an epoch time and not jvm monotonic. (Manoj Govindassamy via mingma)
Date Fri, 20 Jan 2017 06:44:55 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 d37408767 -> bed700e98


HDFS-11296. Maintenance state expiry should be an epoch time and not jvm monotonic. (Manoj
Govindassamy via mingma)

(cherry picked from commit f3fb94be05a61a4c4c06ab279897e5de2b181b0e)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/bed700e9
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/bed700e9
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/bed700e9

Branch: refs/heads/branch-2
Commit: bed700e98f08c37db7cd1a42d458add97b2b3409
Parents: d374087
Author: Ming Ma <mingma@apache.org>
Authored: Thu Jan 19 22:31:15 2017 -0800
Committer: Ming Ma <mingma@apache.org>
Committed: Thu Jan 19 22:33:43 2017 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hdfs/protocol/DatanodeInfo.java   |  2 +-
 .../org/apache/hadoop/hdfs/TestMaintenanceState.java    | 12 ++++++------
 .../hadoop/hdfs/server/namenode/TestNameNodeMXBean.java |  2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/bed700e9/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java
index db30075..c6a69ab 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java
@@ -509,7 +509,7 @@ public class DatanodeInfo extends DatanodeID implements Node {
   }
 
   public static boolean maintenanceNotExpired(long maintenanceExpireTimeInMS) {
-    return Time.monotonicNow() < maintenanceExpireTimeInMS;
+    return Time.now() < maintenanceExpireTimeInMS;
   }
   /**
    * Returns true if the node is is entering_maintenance

http://git-wip-us.apache.org/repos/asf/hadoop/blob/bed700e9/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestMaintenanceState.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestMaintenanceState.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestMaintenanceState.java
index c125f45..9cc130b 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestMaintenanceState.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestMaintenanceState.java
@@ -114,7 +114,7 @@ public class TestMaintenanceState extends AdminStatesBaseTest {
 
     // Adjust the expiration.
     takeNodeOutofService(0, nodeOutofService.getDatanodeUuid(),
-        Time.monotonicNow() + EXPIRATION_IN_MS, null, AdminStates.NORMAL);
+        Time.now() + EXPIRATION_IN_MS, null, AdminStates.NORMAL);
 
     cleanupFile(fileSys, file);
   }
@@ -133,8 +133,8 @@ public class TestMaintenanceState extends AdminStatesBaseTest {
     final FileSystem fileSys = getCluster().getFileSystem(0);
     writeFile(fileSys, file, replicas, 1);
 
-    // expiration has to be greater than Time.monotonicNow().
-    takeNodeOutofService(0, null, Time.monotonicNow(), null,
+    // expiration has to be greater than Time.now().
+    takeNodeOutofService(0, null, Time.now(), null,
         AdminStates.NORMAL);
 
     cleanupFile(fileSys, file);
@@ -203,7 +203,7 @@ public class TestMaintenanceState extends AdminStatesBaseTest {
 
     // Adjust the expiration.
     takeNodeOutofService(0, nodeOutofService.getDatanodeUuid(),
-        Time.monotonicNow() + EXPIRATION_IN_MS, null, AdminStates.NORMAL);
+        Time.now() + EXPIRATION_IN_MS, null, AdminStates.NORMAL);
 
     // no change
     assertEquals(deadInMaintenance, ns.getNumInMaintenanceDeadDataNodes());
@@ -257,7 +257,7 @@ public class TestMaintenanceState extends AdminStatesBaseTest {
 
     // Adjust the expiration.
     takeNodeOutofService(0, nodeOutofService.getDatanodeUuid(),
-        Time.monotonicNow() + EXPIRATION_IN_MS, null, AdminStates.NORMAL);
+        Time.now() + EXPIRATION_IN_MS, null, AdminStates.NORMAL);
 
     cleanupFile(fileSys, file);
   }
@@ -398,7 +398,7 @@ public class TestMaintenanceState extends AdminStatesBaseTest {
 
     // Adjust the expiration.
     takeNodeOutofService(0, nodeOutofService.getDatanodeUuid(),
-        Time.monotonicNow() + EXPIRATION_IN_MS, null, AdminStates.NORMAL);
+        Time.now() + EXPIRATION_IN_MS, null, AdminStates.NORMAL);
 
     cleanupFile(fileSys, file);
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/bed700e9/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNameNodeMXBean.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNameNodeMXBean.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNameNodeMXBean.java
index f338a53..68fa631 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNameNodeMXBean.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNameNodeMXBean.java
@@ -359,7 +359,7 @@ public class TestNameNodeMXBean {
       // Add the 1st DataNode to Maintenance list
       Map<String, Long> maintenanceNodes = new HashMap<>();
       maintenanceNodes.put(cluster.getDataNodes().get(0).getDisplayName(),
-          Time.monotonicNow() + expirationInMs);
+          Time.now() + expirationInMs);
       hostsFileWriter.initOutOfServiceHosts(null, maintenanceNodes);
       fsn.getBlockManager().getDatanodeManager().refreshNodes(conf);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message