RE: How to fetch replication factor of a given keyspace

2017-12-21 Thread Tyagi, Preetika
, December 20, 2017 6:09 PM To: dev Subject: Re: How to fetch replication factor of a given keyspace I think you want: Schema.instance.getKeyspaceMetadata There is a ReplicationParams nested under there which should have everything you need fully populated. On Thu, Dec 21, 2017 at 2:02 PM, Tyagi

Re: How to fetch replication factor of a given keyspace

2017-12-20 Thread kurt greaves
Did you look at how status fetches and initialises the keyspace? Have a look at org.apache.cassandra.service.StorageService#effectiveOwnership. It uses a keyspace and its RF to measure ownership. The same method should work for any nodetool command that needs a keyspace. Note that depending on what

Re: How to fetch replication factor of a given keyspace

2017-12-20 Thread Nate McCall
I think you want: Schema.instance.getKeyspaceMetadata There is a ReplicationParams nested under there which should have everything you need fully populated. On Thu, Dec 21, 2017 at 2:02 PM, Tyagi, Preetika wrote: > Hi, > > If I need to get the replication factor of a given keyspace in nodetool

How to fetch replication factor of a given keyspace

2017-12-20 Thread Tyagi, Preetika
Hi, If I need to get the replication factor of a given keyspace in nodetool commands (e.g. status), how can I do that? I'm trying to figure it out for a JIRA item I'm working on. I tried using the below: Keyspace keyspace = Keyspace.open(keyspaceName); Int rf = keyspace.getReplicationStrategy()