1. This question is better asked on the Java driver mailing list 2. You can use: cluster.getMetadata().getAllHosts() and the Host class contains the details you are looking for.
On Wed, May 27, 2015 at 9:49 AM, Cyril Scetbon <cyril.scet...@free.fr> wrote: > Hi, > > I have a Cluster instance and I'd like to get all hosts from it to check > in which datacenter they are. Is there a way to do that ? I tried by > accessing the cluster metadata and using allHosts, but this function is > only private :( > Actually, I have a cluster instance and an ip address and I'd like to get > the datacenter corresponding to this host. Is there an easy way to do it > with the datastax java driver ? > > Thanks -- Bests, Alex Popescu | @al3xandru Sen. Product Manager @ DataStax