mirror of https://github.com/apache/cassandra
Expose StorageServiceMBean#getKeyspaceReplicationInfo (backport from 4.0 and CASSANDRA-13853)
patch by Stefan Miklosovic; reviewed by Mick Semb Wever for CASSANDRA-16447
This commit is contained in:
parent
e9209527f2
commit
ec9b7b9d37
|
|
@ -1,4 +1,5 @@
|
|||
3.11.11
|
||||
* Add StorageServiceMBean.getKeyspaceReplicationInfo(keyspaceName) (CASSANDRA-16447)
|
||||
* Upgrade jackson-databind to 2.9.10.8 (CASSANDRA-16462)
|
||||
Merged from 3.0:
|
||||
* Ignore trailing zeros in hint files (CASSANDRA-16523)
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ import org.apache.cassandra.repair.*;
|
|||
import org.apache.cassandra.repair.messages.RepairOption;
|
||||
import org.apache.cassandra.schema.CompactionParams.TombstoneOption;
|
||||
import org.apache.cassandra.schema.KeyspaceMetadata;
|
||||
import org.apache.cassandra.schema.ReplicationParams;
|
||||
import org.apache.cassandra.schema.SchemaKeyspace;
|
||||
import org.apache.cassandra.service.paxos.CommitVerbHandler;
|
||||
import org.apache.cassandra.service.paxos.PrepareVerbHandler;
|
||||
|
|
@ -2996,6 +2997,15 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
|
|||
return Schema.instance.getVersion().toString();
|
||||
}
|
||||
|
||||
public String getKeyspaceReplicationInfo(String keyspaceName)
|
||||
{
|
||||
Keyspace keyspaceInstance = Schema.instance.getKeyspaceInstance(keyspaceName);
|
||||
if (keyspaceInstance == null)
|
||||
throw new IllegalArgumentException(); // ideally should never happen
|
||||
ReplicationParams replicationParams = keyspaceInstance.getMetadata().params.replication;
|
||||
return replicationParams.klass.getSimpleName() + " " + replicationParams.options.toString();
|
||||
}
|
||||
|
||||
public List<String> getLeavingNodes()
|
||||
{
|
||||
return stringify(tokenMetadata.getLeavingEndpoints());
|
||||
|
|
|
|||
|
|
@ -97,6 +97,11 @@ public interface StorageServiceMBean extends NotificationEmitter
|
|||
*/
|
||||
public String getSchemaVersion();
|
||||
|
||||
/**
|
||||
* Fetch the replication factor for a given keyspace.
|
||||
* @return string representation of replication information
|
||||
*/
|
||||
public String getKeyspaceReplicationInfo(String keyspaceName);
|
||||
|
||||
/**
|
||||
* Get the list of all data file locations from conf
|
||||
|
|
|
|||
Loading…
Reference in New Issue