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
<preetika.ty...@intel.com> wrote:
> 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().getReplicationFactor()
>
> However, it runs into some issues since internally something doesn't get 
> initialized while looking up keyspaces/metatadata.
>
> Any ideas on how I can approach it differently?
>
> Thanks,
> Preetika
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cassandra.apache.org
For additional commands, e-mail: dev-h...@cassandra.apache.org

Reply via email to