accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [3/4] accumulo git commit: ACCUMULO-3837 compare current value against the default, not null
Date Tue, 26 May 2015 15:52:56 GMT
ACCUMULO-3837 compare current value against the default, not null


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

Branch: refs/heads/1.6
Commit: af8d3bf1111b151aef6d2a2c85ca94a7653f1b2d
Parents: 80a7bb1
Author: Eric C. Newton <eric.newton@gmail.com>
Authored: Tue May 26 11:26:06 2015 -0400
Committer: Eric C. Newton <eric.newton@gmail.com>
Committed: Tue May 26 11:26:06 2015 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/accumulo/monitor/Monitor.java   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/af8d3bf1/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
index 60f5772..0113fb6 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
@@ -58,7 +58,6 @@ import org.apache.accumulo.core.zookeeper.ZooUtil;
 import org.apache.accumulo.fate.zookeeper.ZooLock.LockLossReason;
 import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeExistsPolicy;
 import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeMissingPolicy;
-import org.apache.accumulo.monitor.servlets.BasicServlet;
 import org.apache.accumulo.monitor.servlets.DefaultServlet;
 import org.apache.accumulo.monitor.servlets.GcStatusServlet;
 import org.apache.accumulo.monitor.servlets.JSONServlet;
@@ -171,7 +170,8 @@ public class Monitor {
 
   private ZooLock monitorLock;
 
-  public static AtomicReference<String> cachedInstanceName = new AtomicReference<String>("(Unavailable)");
+  private static final String DEFAULT_INSTANCE_NAME = "(Unavailable)";
+  public static AtomicReference<String> cachedInstanceName = new AtomicReference<String>(DEFAULT_INSTANCE_NAME);
 
   private static class EventCounter {
 
@@ -249,12 +249,12 @@ public class Monitor {
 
     synchronized (Monitor.class) {
       // Learn our instance name asynchronously so we don't hang up if zookeeper is down
-      if (Monitor.cachedInstanceName.get() == null) {
+      if (cachedInstanceName.get().equals(DEFAULT_INSTANCE_NAME)) {
         SimpleTimer.getInstance().schedule(new TimerTask() {
           @Override
           public void run() {
             synchronized (Monitor.class) {
-              if (cachedInstanceName.get() == null) {
+              if (cachedInstanceName.get().equals(DEFAULT_INSTANCE_NAME)) {
                 cachedInstanceName.set(HdfsZooInstance.getInstance().getInstanceName());
               }
             }


Mime
View raw message