You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2014/06/16 20:06:41 UTC

[1/2] git commit: ACCUMULO-2902 Move the configuration of the date format from code into a Property

Repository: accumulo
Updated Branches:
  refs/heads/master 981bf5326 -> c9ed279f3


ACCUMULO-2902 Move the configuration of the date format from code into a Property


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

Branch: refs/heads/master
Commit: 33ffd6fcf031b2de6ba406ee6ab411d8225ed37e
Parents: 981bf53
Author: Josh Elser <el...@apache.org>
Authored: Mon Jun 16 10:44:36 2014 -0700
Committer: Josh Elser <el...@apache.org>
Committed: Mon Jun 16 10:44:36 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/accumulo/core/conf/Property.java  |  2 ++
 .../apache/accumulo/monitor/servlets/LogServlet.java  | 14 +++++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/33ffd6fc/core/src/main/java/org/apache/accumulo/core/conf/Property.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/Property.java b/core/src/main/java/org/apache/accumulo/core/conf/Property.java
index e35a9c3..a58dfe9 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java
@@ -319,6 +319,8 @@ public enum Property {
 
   MONITOR_LOCK_CHECK_INTERVAL("monitor.lock.check.interval", "5s", PropertyType.TIMEDURATION,
       "The amount of time to sleep between checking for the Montior ZooKeeper lock"),
+  MONITOR_LOG_DATE_FORMAT("monitor.log.date.format", "yyyy/MM/dd HH:mm:ss,SSSS", PropertyType.STRING, "The SimpleDateFormat string used to configure "
+      + "the date shown on the 'Recent Logs' 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"),

http://git-wip-us.apache.org/repos/asf/accumulo/blob/33ffd6fc/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/LogServlet.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/LogServlet.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/LogServlet.java
index 268c883..f877664 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/LogServlet.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/LogServlet.java
@@ -21,6 +21,9 @@ import java.text.SimpleDateFormat;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.accumulo.core.conf.AccumuloConfiguration;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.monitor.Monitor;
 import org.apache.accumulo.monitor.util.Table;
 import org.apache.accumulo.monitor.util.celltypes.DateTimeType;
 import org.apache.accumulo.monitor.util.celltypes.StringType;
@@ -40,8 +43,17 @@ public class LogServlet extends BasicServlet {
   
   @Override
   protected void pageBody(HttpServletRequest req, HttpServletResponse resp, StringBuilder sb) {
+    AccumuloConfiguration conf = Monitor.getSystemConfiguration();
     boolean clear = true;
-    SimpleDateFormat fmt = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss,SSSS");
+    final String dateFormatStr = conf.get(Property.MONITOR_LOG_DATE_FORMAT);
+    SimpleDateFormat fmt;
+    try {
+      fmt = new SimpleDateFormat(dateFormatStr);
+    } catch (IllegalArgumentException e) {
+      log.warn("Could not instantiate SimpleDateFormat with format string of '" + dateFormatStr + "', using default format string");
+      fmt = new SimpleDateFormat(Property.MONITOR_LOG_DATE_FORMAT.getDefaultValue());
+    }
+
     Table logTable = new Table("logTable", "Recent&nbsp;Logs");
     logTable.addSortableColumn("Time", new DateTimeType(fmt), null);
     logTable.addSortableColumn("Application");


[2/2] git commit: ACCUMULO-2902 Only need for digits of millis because the most significant will always be 0

Posted by el...@apache.org.
ACCUMULO-2902 Only need for digits of millis because the most significant will always be 0


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

Branch: refs/heads/master
Commit: c9ed279f3f5e84c963fad09b254b1f6d2b87f162
Parents: 33ffd6f
Author: Josh Elser <el...@apache.org>
Authored: Mon Jun 16 10:50:36 2014 -0700
Committer: Josh Elser <el...@apache.org>
Committed: Mon Jun 16 10:50:36 2014 -0700

----------------------------------------------------------------------
 core/src/main/java/org/apache/accumulo/core/conf/Property.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/c9ed279f/core/src/main/java/org/apache/accumulo/core/conf/Property.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/Property.java b/core/src/main/java/org/apache/accumulo/core/conf/Property.java
index a58dfe9..2680908 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java
@@ -319,7 +319,7 @@ public enum Property {
 
   MONITOR_LOCK_CHECK_INTERVAL("monitor.lock.check.interval", "5s", PropertyType.TIMEDURATION,
       "The amount of time to sleep between checking for the Montior ZooKeeper lock"),
-  MONITOR_LOG_DATE_FORMAT("monitor.log.date.format", "yyyy/MM/dd HH:mm:ss,SSSS", PropertyType.STRING, "The SimpleDateFormat string used to configure "
+  MONITOR_LOG_DATE_FORMAT("monitor.log.date.format", "yyyy/MM/dd HH:mm:ss,SSS", PropertyType.STRING, "The SimpleDateFormat string used to configure "
       + "the date shown on the 'Recent Logs' monitor page"),
 
   TRACE_PREFIX("trace.", null, PropertyType.PREFIX, "Properties in this category affect the behavior of distributed tracing."),