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