Yeah, I tried doing it. The problem is when I call: Schema.instance.getKeyspaceInstance(keyspaceName) or getKeyspaceMetadata();
It returns null for all keyspace names. Is it expected? Thanks, Preetika -----Original Message----- From: Nate McCall [mailto:zznat...@gmail.com] Sent: Wednesday, December 20, 2017 6:09 PM To: dev <dev@cassandra.apache.org> 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, 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