You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2017/02/10 17:45:03 UTC
lucene-solr:jira/solr-9858: SOLR-9858 Sanitize domain and reporter
name so that they don't contain separators.
Repository: lucene-solr
Updated Branches:
refs/heads/jira/solr-9858 32ab5aa4e -> 722fecc1d
SOLR-9858 Sanitize domain and reporter name so that they don't contain separators.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/722fecc1
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/722fecc1
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/722fecc1
Branch: refs/heads/jira/solr-9858
Commit: 722fecc1d0f8f188df8c84a39cab92a76328cc67
Parents: 32ab5aa
Author: Andrzej Bialecki <ab...@apache.org>
Authored: Fri Feb 10 09:43:52 2017 -0800
Committer: Andrzej Bialecki <ab...@apache.org>
Committed: Fri Feb 10 09:43:52 2017 -0800
----------------------------------------------------------------------
.../apache/solr/metrics/reporters/JmxObjectNameFactory.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/722fecc1/solr/core/src/java/org/apache/solr/metrics/reporters/JmxObjectNameFactory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/metrics/reporters/JmxObjectNameFactory.java b/solr/core/src/java/org/apache/solr/metrics/reporters/JmxObjectNameFactory.java
index 4df5257..1f5b4f0 100644
--- a/solr/core/src/java/org/apache/solr/metrics/reporters/JmxObjectNameFactory.java
+++ b/solr/core/src/java/org/apache/solr/metrics/reporters/JmxObjectNameFactory.java
@@ -41,9 +41,9 @@ public class JmxObjectNameFactory implements ObjectNameFactory {
* @param additionalProperties additional properties as key, value pairs.
*/
public JmxObjectNameFactory(String reporterName, String domain, String... additionalProperties) {
- this.reporterName = reporterName;
+ this.reporterName = reporterName.replaceAll(":", "_");
this.domain = domain;
- this.subdomains = domain.split("\\.");
+ this.subdomains = domain.replaceAll(":", "_").split("\\.");
if (additionalProperties != null && (additionalProperties.length % 2) != 0) {
throw new IllegalArgumentException("additionalProperties length must be even: " + Arrays.toString(additionalProperties));
}
@@ -83,7 +83,7 @@ public class JmxObjectNameFactory implements ObjectNameFactory {
}
sb.append(','); // separate from other properties
} else {
- sb.append(currentDomain);
+ sb.append(currentDomain.replaceAll(":", "_"));
sb.append(':');
}
} else {