Gary Dusbabek already did this, only better: https://issues.apache.org/jira/browse/CASSANDRA-535, http://issues.apache.org/jira/browse/CASSANDRA-596
On Mon, Dec 7, 2009 at 1:40 PM, Mark Robson <[email protected]> wrote: > 2009/12/7 Ramzi Rabah <[email protected]> >> >> TSocket socket = new TSocket(hostName, port); >> TBinaryProtocol binaryProtocol = new >> TBinaryProtocol(socket, false, false); >> Cassandra.Client client = new >> Cassandra.Client(binaryProtocol); >> socket.open(); >> Map<String,String> tokenToHostMap = (Map<String,String>) >> new >> >> JSONTokener(client.get_string_property(CassandraServer.TOKEN_MAP)).nextValue(); >> >> this will return a list of servers in the cluster (both up or down). >> >> You will obviously need to connect to a live node in the cluster to be >> able to run this. > > Right, and an application could connect to a known live node (seed node, > etc) periodically and store the result (retaining the previous values if it > was unable to connect). > > That wouldn't solve the problem of being able to connect to a node which is > available, *right now*. To do that reliably and with minimal latency you'd > need something which Cassandra doesn't easily have, a load-balancer/ high > availability setup. > > Personally I'd like to see Cassandra implement a "Front-end-only" node, > which could run as a thrift protocol server but not join the ring itself > hence not requiring persistent storage. This would mean that app servers > could run a local front-end-only server and just talk to that. > > Mark >
