incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bil...@apache.org
Subject svn commit: r1215239 - in /incubator/accumulo/trunk: ./ src/core/src/main/java/org/apache/accumulo/core/conf/ src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/ src...
Date Fri, 16 Dec 2011 18:26:27 GMT
Author: billie
Date: Fri Dec 16 18:26:27 2011
New Revision: 1215239

URL: http://svn.apache.org/viewvc?rev=1215239&view=rev
Log:
ACCUMULO-224 merged to trunk

Modified:
    incubator/accumulo/trunk/   (props changed)
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java
    incubator/accumulo/trunk/src/server/src/main/resources/web/screen.css

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 16 18:26:27 2011
@@ -1,7 +1,6 @@
 logs
 walogs
 target
-
 .project
-
 .settings
+.pydevproject

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 16 18:26:27 2011
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320
 /incubator/accumulo/branches/1.3.5rc:1209938
-/incubator/accumulo/branches/1.4:1201902-1214461
+/incubator/accumulo/branches/1.4:1201902-1215237

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java?rev=1215239&r1=1215238&r2=1215239&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java
Fri Dec 16 18:26:27 2011
@@ -181,6 +181,10 @@ public enum Property {
   MONITOR_PREFIX("monitor.", null, PropertyType.PREFIX, "Properties in this category affect
the behavior of the monitor web server."),
   MONITOR_PORT("monitor.port.client", "50095", PropertyType.PORT, "The listening port for
the monitor's http service"),
   MONITOR_LOG4J_PORT("monitor.port.log4j", "4560", PropertyType.PORT, "The listening port
for the monitor's log4j logging collection."),
+  MONITOR_BANNER_TEXT("monitor.banner.text", "", PropertyType.STRING, "The banner text displayed
on the monitor page."),
+  MONITOR_BANNER_COLOR("monitor.banner.color", "#c4c4c4", PropertyType.STRING, "The color
of the banner text displayed on the monitor page."),
+  MONITOR_BANNER_BACKGROUND("monitor.banner.background", "#304065", PropertyType.STRING,
+      "The background color of the banner text displayed on the monitor page."),
   
   TRACE_PREFIX("trace.", null, PropertyType.PREFIX, "Properties in this category affect the
behavior of distributed tracing."),
   TRACE_PORT("trace.port.client", "12234", PropertyType.PORT, "The listening port for the
trace server"),
@@ -348,7 +352,8 @@ public enum Property {
   public static boolean isValidZooPropertyKey(String key) {
     // white list prefixes
     return key.startsWith(Property.TABLE_PREFIX.getKey()) || key.startsWith(Property.TSERV_PREFIX.getKey())
|| key.startsWith(Property.LOGGER_PREFIX.getKey())
-        || key.startsWith(Property.MASTER_PREFIX.getKey()) || key.startsWith(Property.GC_PREFIX.getKey());
+        || key.startsWith(Property.MASTER_PREFIX.getKey()) || key.startsWith(Property.GC_PREFIX.getKey())
+        || key.startsWith(Property.MONITOR_PREFIX.getKey() + "banner.");
   }
   
   public static Property getPropertyByKey(String key) {

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java?rev=1215239&r1=1215238&r2=1215239&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
Fri Dec 16 18:26:27 2011
@@ -33,8 +33,8 @@ import org.apache.accumulo.core.conf.Pro
 import org.apache.accumulo.core.security.ColumnVisibility;
 import org.apache.accumulo.core.util.BadArgumentException;
 import org.apache.accumulo.core.util.shell.Shell;
-import org.apache.accumulo.core.util.shell.Token;
 import org.apache.accumulo.core.util.shell.Shell.Command;
+import org.apache.accumulo.core.util.shell.Token;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.OptionGroup;
@@ -104,7 +104,7 @@ public class ConfigCommand extends Comma
         Shell.log.debug("Successfully set table configuration option.");
       } else {
         if (!Property.isValidZooPropertyKey(property))
-          throw new BadArgumentException("Property cannot be modified in zookeepr", fullCommand,
fullCommand.indexOf(property));
+          throw new BadArgumentException("Property cannot be modified in zookeeper", fullCommand,
fullCommand.indexOf(property));
         
         shellState.getConnector().instanceOperations().setProperty(property, value);
         Shell.log.debug("Successfully set system configuration option");

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java?rev=1215239&r1=1215238&r2=1215239&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java
Fri Dec 16 18:26:27 2011
@@ -32,7 +32,9 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.server.client.HdfsZooInstance;
+import org.apache.accumulo.server.conf.ServerConfiguration;
 import org.apache.accumulo.server.monitor.LogService;
 import org.apache.accumulo.server.monitor.Monitor;
 import org.apache.accumulo.server.util.time.SimpleTimer;
@@ -43,6 +45,9 @@ abstract public class BasicServlet exten
   private static final long serialVersionUID = 1L;
   protected static final Logger log = Logger.getLogger(BasicServlet.class);
   static String cachedInstanceName = null;
+  private String bannerText;
+  private String bannerColor;
+  private String bannerBackground;
   
   abstract protected String getTitle(HttpServletRequest req);
   
@@ -50,6 +55,9 @@ abstract public class BasicServlet exten
     StringBuilder sb = new StringBuilder();
     try {
       Monitor.fetchData();
+      bannerText = sanitize(ServerConfiguration.getSystemConfiguration().get(Property.MONITOR_BANNER_TEXT));
+      bannerColor = ServerConfiguration.getSystemConfiguration().get(Property.MONITOR_BANNER_COLOR).replace("'",
"'");
+      bannerBackground = ServerConfiguration.getSystemConfiguration().get(Property.MONITOR_BANNER_BACKGROUND).replace("'",
"'");
       pageStart(req, resp, sb);
       pageBody(req, resp, sb);
       pageEnd(req, resp, sb);
@@ -132,11 +140,19 @@ abstract public class BasicServlet exten
     sb.append("\n<body>\n");
     sb.append("<div id='content-wrapper'>\n");
     sb.append("<div id='content'>\n");
-    sb.append("<div id='header'><h1>").append(getTitle(req)).append("</h1></div>\n");
+    sb.append("<div id='header'>");
+    if (!bannerText.isEmpty()) {
+      sb.append("<div id='banner' style='color:").append(bannerColor).append(";background:").append(bannerBackground).append("'>").append(bannerText)
+          .append("</div>\n");
+    }
+    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)
         .append("\n");
     sb.append("<br><span class='smalltext'>Instance&nbsp;ID:&nbsp;").append(HdfsZooInstance.getInstance().getInstanceID()).append("</span>\n");
-    sb.append("<br><span class='smalltext'>").append(new Date().toString().replace("
", "&nbsp;")).append("</span></div>\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'>
     
     // BEGIN LEFT SIDE
     sb.append("<div id='nav'>\n");
@@ -162,7 +178,10 @@ abstract public class BasicServlet exten
     sb.append(refresh < 1 ? "en" : "dis").append("able&nbsp;auto-refresh</a>]</div>\n");
     sb.append("</div>\n"); // end <div id='nav'>
     
-    sb.append("<div id='main'>\n");
+    sb.append("<div id='main'");
+    if (bannerText.isEmpty())
+      sb.append(" style='bottom:0'");
+    sb.append(">\n");
     sb.append("<!-- BEGIN MAIN BODY CONTENT -->\n\n");
   }
   
@@ -177,6 +196,10 @@ abstract public class BasicServlet exten
     // BEGIN FOOTER
     sb.append("</div>\n"); // end <div id='content'>
     sb.append("</div>\n"); // end <div id='content-wrapper'>
+    if (!bannerText.isEmpty()) {
+      sb.append("<div id='footer' style='color:").append(bannerColor).append(";background:").append(bannerBackground).append("'>").append(bannerText)
+          .append("</div>\n");
+    }
     sb.append("</body>\n");
     sb.append("</html>\n");
   }

Modified: incubator/accumulo/trunk/src/server/src/main/resources/web/screen.css
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/resources/web/screen.css?rev=1215239&r1=1215238&r2=1215239&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/resources/web/screen.css (original)
+++ incubator/accumulo/trunk/src/server/src/main/resources/web/screen.css Fri Dec 16 18:26:27
2011
@@ -52,17 +52,37 @@ html,body {
 	height: 8.0em;
 	color: #c4c4c4;
 	background-color: #304065;
+	text-align: center;
+}
+
+#banner {
+	height: 1.5em;
+	font-size: 1.0em;
+}
+
+#headertitle {
+	position: absolute;
+	top: 0;
+	left: 0;
+	right: 0;
 }
 
 #subheader {
 	position: absolute;
-	top: 4.5em;
+	bottom: 0;
 	left: 0;
 	right: 0;
-	color: #c4c4c4;
 	font-size: .92em;
-	text-align: center;
+}
+
+#footer {
+	position: absolute;
+	bottom: 0;
+	left: 0;
 	right: 0;
+	padding: 0;
+	height: 1.5em;
+	font-size: 1.0em;
 }
 
 #main {
@@ -70,7 +90,7 @@ html,body {
 	top: 8.0em;
 	left: 11em;
 	right: 0;
-	bottom: 0;
+	bottom: 1.5em;
 	padding: 0.6em;
 	overflow: scroll;
 }



Mime
View raw message