cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sn...@apache.org
Subject [3/6] cassandra git commit: Fix malformed JMX ObjectName containing IPv6 addresses
Date Wed, 25 Mar 2015 10:47:46 GMT
Fix malformed JMX ObjectName containing IPv6 addresses

Patch by Erik Forsberg; Reviewed by Robert Stupp for CASSANDRA-9027


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

Branch: refs/heads/trunk
Commit: 495ae9c7e78b2d5880cf74072be13d1015394abc
Parents: f5f97d8
Author: Erik Forsberg <forsberg@efod.se>
Authored: Wed Mar 25 11:35:52 2015 +0100
Committer: Robert Stupp <snazy@snazy.de>
Committed: Wed Mar 25 11:35:52 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                                     | 1 +
 src/java/org/apache/cassandra/metrics/ConnectionMetrics.java    | 2 +-
 src/java/org/apache/cassandra/metrics/HintedHandoffMetrics.java | 4 ++--
 src/java/org/apache/cassandra/metrics/StreamingMetrics.java     | 2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/495ae9c7/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index f0555dd..bcc59fc 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.14:
+ * Fix malformed JMX ObjectName containing IPv6 addresses (CASSANDRA-9027)
  * Fix potential data loss in CompressedSequentialWriter (CASSANDRA-8949)
  * (cqlsh) Allow increasing CSV field size limit through
    cqlshrc config option (CASSANDRA-8934)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/495ae9c7/src/java/org/apache/cassandra/metrics/ConnectionMetrics.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/metrics/ConnectionMetrics.java b/src/java/org/apache/cassandra/metrics/ConnectionMetrics.java
index eaf29f8..6ab2204 100644
--- a/src/java/org/apache/cassandra/metrics/ConnectionMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/ConnectionMetrics.java
@@ -64,7 +64,7 @@ public class ConnectionMetrics
     public ConnectionMetrics(InetAddress ip, final OutboundTcpConnectionPool connectionPool)
     {
         // ipv6 addresses will contain colons, which are invalid in a JMX ObjectName
-        address = ip.getHostAddress().replaceAll(":", ".");
+        address = ip.getHostAddress().replace(':', '.');
 
         factory = new DefaultNameFactory("Connection", address);
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/495ae9c7/src/java/org/apache/cassandra/metrics/HintedHandoffMetrics.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/metrics/HintedHandoffMetrics.java b/src/java/org/apache/cassandra/metrics/HintedHandoffMetrics.java
index d002e39..ea81a9a 100644
--- a/src/java/org/apache/cassandra/metrics/HintedHandoffMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/HintedHandoffMetrics.java
@@ -55,7 +55,7 @@ public class HintedHandoffMetrics
     {
         public Counter load(InetAddress address)
         {
-            return Metrics.newCounter(factory.createMetricName("Hints_created-" + address.getHostAddress()));
+            return Metrics.newCounter(factory.createMetricName("Hints_created-" + address.getHostAddress().replace(':',
'.')));
         }
     });
 
@@ -88,7 +88,7 @@ public class HintedHandoffMetrics
 
         public DifferencingCounter(InetAddress address)
         {
-            this.meter = Metrics.newCounter(factory.createMetricName("Hints_not_stored-"
+ address.getHostAddress()));
+            this.meter = Metrics.newCounter(factory.createMetricName("Hints_not_stored-"
+ address.getHostAddress().replace(':', '.')));
         }
 
         public long difference()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/495ae9c7/src/java/org/apache/cassandra/metrics/StreamingMetrics.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/metrics/StreamingMetrics.java b/src/java/org/apache/cassandra/metrics/StreamingMetrics.java
index 51b4f8c..4c57812 100644
--- a/src/java/org/apache/cassandra/metrics/StreamingMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/StreamingMetrics.java
@@ -52,7 +52,7 @@ public class StreamingMetrics
 
     public StreamingMetrics(final InetAddress peer)
     {
-        MetricNameFactory factory = new DefaultNameFactory("Streaming", peer.getHostAddress().replaceAll(":",
"."));
+        MetricNameFactory factory = new DefaultNameFactory("Streaming", peer.getHostAddress().replace(':',
'.'));
         incomingBytes = Metrics.newCounter(factory.createMetricName("IncomingBytes"));
         outgoingBytes= Metrics.newCounter(factory.createMetricName("OutgoingBytes"));
     }


Mime
View raw message