You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/02/19 04:50:59 UTC

[GitHub] [druid] clintropolis commented on a change in pull request #9372: Add config option for namespacePrefix

clintropolis commented on a change in pull request #9372: Add config option for namespacePrefix
URL: https://github.com/apache/druid/pull/9372#discussion_r381075918
 
 

 ##########
 File path: extensions-contrib/opentsdb-emitter/src/main/java/org/apache/druid/emitter/opentsdb/EventConverter.java
 ##########
 @@ -41,17 +41,24 @@
   private static final Pattern WHITESPACE = Pattern.compile("[\\s]+");
 
   private final Map<String, Set<String>> metricMap;
+  private final String namespacePrefix;
 
-  public EventConverter(ObjectMapper mapper, String metricMapPath)
+  public EventConverter(ObjectMapper mapper, String metricMapPath, String namespacePrefix)
   {
     metricMap = readMap(mapper, metricMapPath);
+    this.namespacePrefix = namespacePrefix;
   }
 
   protected String sanitize(String metric)
   {
     return WHITESPACE.matcher(metric.trim()).replaceAll("_").replace('/', '.');
   }
 
+  private String buildNamespace()
+  {
+    return (namespacePrefix == null || "".equals(namespacePrefix)) ? "" : sanitize(namespacePrefix) + ".";
 
 Review comment:
   can `namespacePrefix` actually be empty here (other than the unit tests creating an `EventConverter` directly) since `OpentsdbEmitterConfig` looks like it will coerce the value to `null` in its constructor? 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org