From f4759f05e79706f6774f326772b45a8d275a3684 Mon Sep 17 00:00:00 2001 From: Calle Wilund Date: Wed, 17 Aug 2016 08:33:25 +0000 Subject: [PATCH] EndpointSnitchInfo: update to c3 compat --- .../org/apache/cassandra/locator/EndpointSnitchInfo.java | 9 +++++++++ .../cassandra/locator/EndpointSnitchInfoMBean.java | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/main/java/org/apache/cassandra/locator/EndpointSnitchInfo.java b/src/main/java/org/apache/cassandra/locator/EndpointSnitchInfo.java index 02b4f15..0cf82bc 100644 --- a/src/main/java/org/apache/cassandra/locator/EndpointSnitchInfo.java +++ b/src/main/java/org/apache/cassandra/locator/EndpointSnitchInfo.java @@ -101,4 +101,13 @@ public class EndpointSnitchInfo implements EndpointSnitchInfoMBean { return c.getStringValue("/snitch/name"); } + @Override + public String getRack() { + return c.getStringValue("/snitch/rack", null, 10000); + } + + @Override + public String getDatacenter() { + return c.getStringValue("/snitch/datacenter", null, 10000); + } } diff --git a/src/main/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java b/src/main/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java index 84d2499..6de5022 100644 --- a/src/main/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java +++ b/src/main/java/org/apache/cassandra/locator/EndpointSnitchInfoMBean.java @@ -38,6 +38,15 @@ public interface EndpointSnitchInfoMBean */ public String getDatacenter(String host) throws UnknownHostException; + /** + * Provides the Rack name depending on the respective snitch used for this node + */ + public String getRack(); + + /** + * Provides the Datacenter name depending on the respective snitch used for this node + */ + public String getDatacenter(); /** * Provides the snitch name of the cluster