accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1462237 - in /accumulo/trunk: ./ assemble/ core/ core/src/test/resources/ examples/ examples/simple/src/test/resources/ fate/src/main/java/org/apache/accumulo/fate/ fate/src/main/java/org/apache/accumulo/fate/zookeeper/ fate/src/test/resou...
Date Thu, 28 Mar 2013 17:51:14 GMT
Author: kturner
Date: Thu Mar 28 17:51:13 2013
New Revision: 1462237

URL: http://svn.apache.org/r1462237
Log:
ACCUMULO-1212 Add a whole bunch of log4j.properties that pretty much turn down the logging
level on the same 5 classes.
ACCUMULO-1212 Fix formatting in start/pom.xml
ACCUMULO-1205 Stub in an onload for the "Show Trace" page which display:table-row's any trace
line which has the 'addl data' checkbox already checked.
ACCUMULO-1215 add some extra time to tests to accumodate slower build servers
ACCUMULO-1206 Override compareTo to sort the trace entries by start time instead of their
toString(). Add a simple test to make sure the Comparator compares correctly.

Added:
    accumulo/trunk/core/src/test/resources/log4j.properties
      - copied unchanged from r1462231, accumulo/branches/1.5/core/src/test/resources/log4j.properties
    accumulo/trunk/examples/simple/src/test/resources/
      - copied from r1462231, accumulo/branches/1.5/examples/simple/src/test/resources/
    accumulo/trunk/examples/simple/src/test/resources/log4j.properties
      - copied unchanged from r1462231, accumulo/branches/1.5/examples/simple/src/test/resources/log4j.properties
    accumulo/trunk/proxy/src/test/resources/
      - copied from r1462231, accumulo/branches/1.5/proxy/src/test/resources/
    accumulo/trunk/proxy/src/test/resources/log4j.properties
      - copied unchanged from r1462231, accumulo/branches/1.5/proxy/src/test/resources/log4j.properties
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ShowTraceLinkType.java
      - copied unchanged from r1461548, accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ShowTraceLinkType.java
    accumulo/trunk/server/src/test/java/org/apache/accumulo/server/monitor/ShowTraceLinkTypeTest.java
      - copied unchanged from r1461548, accumulo/branches/1.5/server/src/test/java/org/apache/accumulo/server/monitor/ShowTraceLinkTypeTest.java
    accumulo/trunk/server/src/test/resources/
      - copied from r1462231, accumulo/branches/1.5/server/src/test/resources/
    accumulo/trunk/server/src/test/resources/log4j.properties
      - copied unchanged from r1462231, accumulo/branches/1.5/server/src/test/resources/log4j.properties
    accumulo/trunk/start/src/test/resources/log4j.properties
      - copied unchanged from r1462231, accumulo/branches/1.5/start/src/test/resources/log4j.properties
    accumulo/trunk/test/src/test/resources/log4j.properties
      - copied unchanged from r1462231, accumulo/branches/1.5/test/src/test/resources/log4j.properties
Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/assemble/   (props changed)
    accumulo/trunk/core/   (props changed)
    accumulo/trunk/examples/   (props changed)
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java   (props changed)
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java 
 (props changed)
    accumulo/trunk/fate/src/test/resources/log4j.properties
    accumulo/trunk/server/   (props changed)
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ListType.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ShowTrace.java
    accumulo/trunk/src/   (props changed)
    accumulo/trunk/start/pom.xml
    accumulo/trunk/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java
    accumulo/trunk/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5:r1461331-1461548,1461550-1461551,1461553-1461554,1461556-1461566,1461568-1461745,1461747-1461779,1461781-1462231

Propchange: accumulo/trunk/assemble/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/assemble:r1461318-1461548,1461550-1461551,1461553-1461554,1461556-1461566,1461568-1461745,1461747-1461779,1461781-1462231

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/core:r1461331-1461548,1461550-1461551,1461553-1461554,1461556-1461566,1461568-1461745,1461747-1461779,1461781-1462231

Propchange: accumulo/trunk/examples/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/examples:r1461318-1461548,1461550-1461551,1461553-1461554,1461556-1461566,1461568-1461745,1461747-1461779,1461781-1462231

Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1461318-1461548,1461550-1461551,1461553-1461554,1461556-1461566,1461568-1461745,1461747-1461779,1461781-1462231

Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java:r1461318-1461548,1461550-1461551,1461553-1461554,1461556-1461566,1461568-1461745,1461747-1461779,1461781-1462231

Modified: accumulo/trunk/fate/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/accumulo/trunk/fate/src/test/resources/log4j.properties?rev=1462237&r1=1462236&r2=1462237&view=diff
==============================================================================
--- accumulo/trunk/fate/src/test/resources/log4j.properties (original)
+++ accumulo/trunk/fate/src/test/resources/log4j.properties Thu Mar 28 17:51:13 2013
@@ -4,6 +4,7 @@ log4j.appender.CA.layout=org.apache.log4
 log4j.appender.CA.layout.ConversionPattern=[%t] %-5p %c %x - %m%n
 
 log4j.logger.org.apache.zookeeper=ERROR,CA
+log4j.logger.org.apache.accumulo.fate.zookeeper.DistributedReadWriteLock=WARN
 log4j.logger.org.apache.accumulo.core.client.impl.ServerClient=ERROR
 log4j.logger.org.apache.accumulo.server.security.Auditor=off
 

Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/server:r1461331-1461548,1461550-1461551,1461553-1461554,1461556-1461566,1461568-1461745,1461747-1461779,1461781-1462231

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java?rev=1462237&r1=1462236&r2=1462237&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java
Thu Mar 28 17:51:13 2013
@@ -153,7 +153,7 @@ abstract public class BasicServlet exten
     sb.append("</head>\n");
     
     // BEGIN BODY OPENING
-    sb.append("\n<body>\n");
+    sb.append("\n<body ").append(getBodyAttributes()).append(">\n");
     sb.append("<div id='content-wrapper'>\n");
     sb.append("<div id='content'>\n");
     sb.append("<div id='header'>");
@@ -222,6 +222,16 @@ abstract public class BasicServlet exten
     sb.append("</body>\n");
     sb.append("</html>\n");
   }
+
+  /**
+   * Allow the concrete servlet implementation to provide attributes on the body HTML tag,
+   * such as 'onload', which can be used to call Javascript methods on page load.
+   * By default, nothing is specified.
+   * @return
+   */
+  protected String getBodyAttributes() {
+    return "";
+  }
   
   public static String encode(String s) {
     try {

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ListType.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ListType.java?rev=1462237&r1=1462236&r2=1462237&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ListType.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ListType.java
Thu Mar 28 17:51:13 2013
@@ -16,13 +16,11 @@
  */
 package org.apache.accumulo.server.monitor.servlets.trace;
 
-import java.util.Date;
 import java.util.Map.Entry;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.accumulo.trace.thrift.RemoteSpan;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Range;
@@ -31,6 +29,7 @@ import org.apache.accumulo.core.trace.Tr
 import org.apache.accumulo.server.monitor.util.Table;
 import org.apache.accumulo.server.monitor.util.celltypes.DurationType;
 import org.apache.accumulo.server.monitor.util.celltypes.StringType;
+import org.apache.accumulo.trace.thrift.RemoteSpan;
 import org.apache.hadoop.io.Text;
 
 
@@ -46,16 +45,6 @@ public class ListType extends Basic {
     return getIntParameter(req, "minutes", Summary.DEFAULT_MINUTES);
   }
   
-  private static class ShowTraceLinkType extends StringType<RemoteSpan> {
-    
-    public String format(Object obj) {
-      if (obj == null)
-        return "-";
-      RemoteSpan span = (RemoteSpan) obj;
-      return String.format("<a href='/trace/show?id=%s'>%s</a>", Long.toHexString(span.traceId),
TraceFormatter.formatDate(new Date(span.start)));
-    }
-  }
-  
   @Override
   public void pageBody(HttpServletRequest req, HttpServletResponse resp, StringBuilder sb)
throws Exception {
     String type = getType(req);

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ShowTrace.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ShowTrace.java?rev=1462237&r1=1462236&r2=1462237&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ShowTrace.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ShowTrace.java
Thu Mar 28 17:51:13 2013
@@ -41,6 +41,8 @@ import org.apache.hadoop.io.Text;
 public class ShowTrace extends Basic {
   
   private static final long serialVersionUID = 1L;
+  private static final String checkboxIdSuffix = "_checkbox";
+  private static final String pageLoadFunctionName = "pageload";
   
   String getTraceId(HttpServletRequest req) {
     return getStringParameter(req, "id", null);
@@ -87,6 +89,18 @@ public class ShowTrace extends Basic {
     sb.append("    elt.style.display='none';\n ");
     sb.append(" }\n");
     sb.append("}\n");
+
+    sb.append("function ").append(pageLoadFunctionName).append("() {\n");
+    sb.append("  var checkboxes = document.getElementsByTagName('input');\n");
+    sb.append("  for (var i = 0; i < checkboxes.length; i++) {\n");
+    sb.append("    if (checkboxes[i].checked) {\n");
+    sb.append("      var idSuffixOffset = checkboxes[i].id.indexOf('").append(checkboxIdSuffix).append("');\n");
+    sb.append("      var id = checkboxes[i].id.substring(0, idSuffixOffset);\n");
+    sb.append("      document.getElementById(id).style.display='table-row';\n");
+    sb.append("    }\n");
+    sb.append("  }\n");
+    sb.append("}\n");
+
     sb.append("</script>\n");
     sb.append("<div>");
     sb.append("<table><caption>");
@@ -102,10 +116,15 @@ public class ShowTrace extends Basic {
         sb.append(String.format("<td style='text-indent: %dpx'>%s@%s</td>%n",
level * 5, node.svc, node.sender));
         sb.append("<td>" + node.description + "</td>");
         boolean hasData = node.data != null && !node.data.isEmpty();
-        if (hasData)
-          sb.append("<td><input type='checkbox' onclick='toggle(\"" + Long.toHexString(node.spanId)
+ "\")'></td>\n");
-        else
+        if (hasData) {
+          String hexSpanId = Long.toHexString(node.spanId);
+          sb.append("<td><input type='checkbox' id=\"");
+          sb.append(hexSpanId);
+          sb.append(checkboxIdSuffix);
+          sb.append("\" onclick='toggle(\"" + Long.toHexString(node.spanId) + "\")'></td>\n");
+        } else {
           sb.append("<td></td>\n");
+        }
         sb.append("</tr>\n");
         sb.append("<tr id='" + Long.toHexString(node.spanId) + "' style='display:none'>");
         sb.append("<td colspan='5'>\n");
@@ -133,4 +152,9 @@ public class ShowTrace extends Basic {
     sb.append("</table>\n");
     sb.append("</div>\n");
   }
+  
+  @Override
+  protected String getBodyAttributes() {
+    return " onload=\"" + pageLoadFunctionName + "()\" ";
+  }
 }

Propchange: accumulo/trunk/src/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/src:r1461318-1461548,1461550-1461551,1461553-1461554,1461556-1461566,1461568-1461745,1461747-1461779,1461781-1462231

Modified: accumulo/trunk/start/pom.xml
URL: http://svn.apache.org/viewvc/accumulo/trunk/start/pom.xml?rev=1462237&r1=1462236&r2=1462237&view=diff
==============================================================================
--- accumulo/trunk/start/pom.xml (original)
+++ accumulo/trunk/start/pom.xml Thu Mar 28 17:51:13 2013
@@ -46,12 +46,12 @@
             </archive>
           </configuration>
         </plugin>
-		<plugin>
-			<artifactId>maven-surefire-plugin</artifactId>
-			<configuration>
-				<forkMode>always</forkMode>
-			</configuration>
-		</plugin>
+    <plugin>
+      <artifactId>maven-surefire-plugin</artifactId>
+      <configuration>
+        <forkMode>always</forkMode>
+      </configuration>
+    </plugin>
         
       </plugins>
     </pluginManagement>
@@ -118,47 +118,47 @@
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
     </dependency>
-	<dependency>
-		<groupId>org.apache.commons</groupId>
-		<artifactId>commons-vfs2</artifactId>
-		<version>2.0</version>
-	</dependency>
-	<!-- TEST DEPENDENCIES -->
-	<dependency>
-		<groupId>junit</groupId>
-		<artifactId>junit</artifactId>
-		<scope>test</scope>
-	</dependency>
-	<dependency>
-		<groupId>javax.ws.rs</groupId>
-		<artifactId>jsr311-api</artifactId>
-		<version>1.0</version>
-		<scope>test</scope>
-	</dependency>
-	<dependency>
-		<groupId>org.slf4j</groupId>
-		<artifactId>slf4j-nop</artifactId>
-		<version>1.7.2</version>
-		<scope>test</scope>
-	</dependency>
-	<dependency>
-		<groupId>org.powermock</groupId>
-		<artifactId>powermock-module-junit4</artifactId>
-		<version>1.4.12</version>
-		<scope>test</scope>
-	</dependency>
-	<dependency>
-		<groupId>org.powermock</groupId>
-		<artifactId>powermock-api-easymock</artifactId>
-		<version>1.4.12</version>
-		<scope>test</scope>
-	</dependency>
-	<dependency>
-		<groupId>org.easymock</groupId>
-		<artifactId>easymock</artifactId>
-		<version>3.1</version>
-		<scope>test</scope>
-	</dependency>    
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-vfs2</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <!-- TEST DEPENDENCIES -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.ws.rs</groupId>
+      <artifactId>jsr311-api</artifactId>
+      <version>1.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-nop</artifactId>
+      <version>1.7.2</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.powermock</groupId>
+      <artifactId>powermock-module-junit4</artifactId>
+      <version>1.4.12</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.powermock</groupId>
+      <artifactId>powermock-api-easymock</artifactId>
+      <version>1.4.12</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.easymock</groupId>
+      <artifactId>easymock</artifactId>
+      <version>3.1</version>
+      <scope>test</scope>
+    </dependency>    
   </dependencies>
 
 </project>

Modified: accumulo/trunk/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java?rev=1462237&r1=1462236&r2=1462237&view=diff
==============================================================================
--- accumulo/trunk/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java
(original)
+++ accumulo/trunk/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java
Thu Mar 28 17:51:13 2013
@@ -135,7 +135,7 @@ public class MiniAccumuloClusterTest {
     conn.tableOperations().delete("table1");
   }
   
-  @Test(timeout = 30000)
+  @Test(timeout = 60000)
   public void testPerTableClasspath() throws Exception {
     
     Connector conn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers()).getConnector("root",
new PasswordToken("superSecret"));

Modified: accumulo/trunk/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java?rev=1462237&r1=1462236&r2=1462237&view=diff
==============================================================================
--- accumulo/trunk/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java (original)
+++ accumulo/trunk/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java Thu Mar
28 17:51:13 2013
@@ -650,6 +650,7 @@ public class ShellServerTest {
     exec("insert a b c value", true);
     exec("scan -np", true, "value", true);
     exec("deletetable -f t");
+    exec("sleep 1");
     String trace = exec("trace off");
     //System.out.println("trace: " + trace);
     assertTrue(trace.contains("binMutations"));



Mime
View raw message