accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [2/8] accumulo git commit: ACCUMULO-3327 merge to 1.7
Date Tue, 26 May 2015 15:53:07 GMT
ACCUMULO-3327 merge to 1.7


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

Branch: refs/heads/1.7
Commit: 81bd5078181f46745cb9fd60b1a4179f4fc4c68f
Parents: 5e2a06d 2a16771
Author: Eric C. Newton <eric.newton@gmail.com>
Authored: Tue May 26 10:43:12 2015 -0400
Committer: Eric C. Newton <eric.newton@gmail.com>
Committed: Tue May 26 10:43:12 2015 -0400

----------------------------------------------------------------------
 .../accumulo/monitor/servlets/BasicServlet.java      | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/81bd5078/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/BasicServlet.java
----------------------------------------------------------------------
diff --cc server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/BasicServlet.java
index 6dd9f52,ea63cf2..43ab121
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/BasicServlet.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/BasicServlet.java
@@@ -47,10 -49,10 +48,10 @@@ abstract public class BasicServlet exte
  
    private static final long serialVersionUID = 1L;
    protected static final Logger log = Logger.getLogger(BasicServlet.class);
-   static String cachedInstanceName = null;
+   static AtomicReference<String> cachedInstanceName = new AtomicReference<String>("(Unavailable)");
 -  private static String bannerText;
 -  private static String bannerColor;
 -  private static String bannerBackground;
 +  private String bannerText;
 +  private String bannerColor;
 +  private String bannerBackground;
  
    abstract protected String getTitle(HttpServletRequest req);
  
@@@ -110,13 -112,13 +111,13 @@@
      }
      synchronized (BasicServlet.class) {
        // Learn our instance name asynchronously so we don't hang up if zookeeper is down
-       if (cachedInstanceName == null) {
+       if (cachedInstanceName.get() == null) {
 -        SimpleTimer.getInstance().schedule(new TimerTask() {
 +        SimpleTimer.getInstance(Monitor.getContext().getConfiguration()).schedule(new TimerTask()
{
            @Override
            public void run() {
              synchronized (BasicServlet.class) {
-               if (cachedInstanceName == null) {
-                 cachedInstanceName = Monitor.getContext().getInstance().getInstanceName();
+               if (cachedInstanceName.get() == null) {
 -                cachedInstanceName.set(HdfsZooInstance.getInstance().getInstanceName());
++                cachedInstanceName.set(Monitor.getContext().getInstance().getInstanceName());
                }
              }
            }
@@@ -172,9 -174,9 +173,9 @@@
      }
      sb.append("<div id='headertitle'>");
      sb.append("<h1>").append(getTitle(req)).append("</h1></div>\n");
-     sb.append("<div id='subheader'>Instance&nbsp;Name:&nbsp;").append(cachedInstanceName).append("&nbsp;&nbsp;&nbsp;Version:&nbsp;").append(Constants.VERSION)
 -    sb.append("<div id='subheader'>Instance&nbsp;Name:&nbsp;").append(cachedInstanceName.get()).append("&nbsp;&nbsp;&nbsp;Version:&nbsp;").append(Constants.VERSION)
--        .append("\n");
 -    sb.append("<br><span class='smalltext'>Instance&nbsp;ID:&nbsp;").append(HdfsZooInstance.getInstance().getInstanceID()).append("</span>\n");
++    sb.append("<div id='subheader'>Instance&nbsp;Name:&nbsp;").append(cachedInstanceName.get()).append("&nbsp;&nbsp;&nbsp;Version:&nbsp;")
++        .append(Constants.VERSION).append("\n");
 +    sb.append("<br><span class='smalltext'>Instance&nbsp;ID:&nbsp;").append(Monitor.getContext().getInstance().getInstanceID()).append("</span>\n");
      sb.append("<br><span class='smalltext'>").append(new Date().toString().replace("
", "&nbsp;")).append("</span>");
      sb.append("</div>\n"); // end <div id='subheader'>
      sb.append("</div>\n"); // end <div id='header'>


Mime
View raw message