accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [accumulo] branch master updated: Fix trace views (allow types like "shell:root")
Date Fri, 22 Feb 2019 00:05:14 GMT
This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/master by this push:
     new 95ad66f  Fix trace views (allow types like "shell:root")
95ad66f is described below

commit 95ad66f2ecd100edae4ca9214864c140f0190ed3
Author: Christopher Tubbs <ctubbsii@apache.org>
AuthorDate: Thu Feb 21 19:03:18 2019 -0500

    Fix trace views (allow types like "shell:root")
    
    Fix monitor rest service by unbanning trace link types of the form
    "shell:root". Previously, it was not possible to view these traces in
    the monitor, but after this change, those trace link types are
    permitted.
---
 .../java/org/apache/accumulo/monitor/rest/trace/TracesResource.java    | 3 ++-
 .../src/main/java/org/apache/accumulo/monitor/view/WebViews.java       | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/trace/TracesResource.java
b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/trace/TracesResource.java
index 572893b..80bc8d0 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/trace/TracesResource.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/trace/TracesResource.java
@@ -19,6 +19,7 @@ package org.apache.accumulo.monitor.rest.trace;
 import static java.lang.Math.min;
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static org.apache.accumulo.monitor.util.ParameterValidator.ALPHA_NUM_REGEX;
+import static org.apache.accumulo.monitor.util.ParameterValidator.RESOURCE_REGEX;
 
 import java.io.IOException;
 import java.security.PrivilegedAction;
@@ -137,7 +138,7 @@ public class TracesResource {
   @Path("listType/{type}/{minutes}")
   @GET
   public TraceType getTracesType(
-      @PathParam("type") @NotNull @Pattern(regexp = ALPHA_NUM_REGEX) final String type,
+      @PathParam("type") @NotNull @Pattern(regexp = RESOURCE_REGEX) final String type,
       @PathParam("minutes") @Min(0) @Max(2592000) int minutes) throws Exception {
 
     TraceType typeTraces = new TraceType(type);
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/view/WebViews.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/view/WebViews.java
index 25b4c99..1a26b4b 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/view/WebViews.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/view/WebViews.java
@@ -20,6 +20,7 @@ import static org.apache.accumulo.monitor.util.ParameterValidator.ALPHA_NUM_REGE
 import static org.apache.accumulo.monitor.util.ParameterValidator.ALPHA_NUM_REGEX_BLANK_OK;
 import static org.apache.accumulo.monitor.util.ParameterValidator.ALPHA_NUM_REGEX_TABLE_ID;
 import static org.apache.accumulo.monitor.util.ParameterValidator.HOSTNAME_PORT_REGEX;
+import static org.apache.accumulo.monitor.util.ParameterValidator.RESOURCE_REGEX;
 import static org.apache.commons.lang.StringUtils.isBlank;
 import static org.apache.commons.lang.StringUtils.isEmpty;
 import static org.apache.commons.lang.StringUtils.isNotBlank;
@@ -340,7 +341,7 @@ public class WebViews {
   @Path("trace/listType")
   @Template(name = "/default.ftl")
   public Map<String,Object> getTracesForType(
-      @QueryParam("type") @NotNull @Pattern(regexp = ALPHA_NUM_REGEX) String type,
+      @QueryParam("type") @NotNull @Pattern(regexp = RESOURCE_REGEX) String type,
       @QueryParam("minutes") @DefaultValue("10") @Min(0) @Max(2592000) int minutes) {
     Map<String,Object> model = getModel();
     model.put("title",


Mime
View raw message