Wrapped the describeRing() in CassandraTemplate with the
SessionCallback. Added Unit Test for CassandraOperations, which uses the cassandra-unit embedded Cassandra DB.
This commit is contained in:
@@ -75,7 +75,14 @@ public class CassandraTemplate implements CassandraOperations {
|
||||
/*
|
||||
* Get the cluster metadata for this session
|
||||
*/
|
||||
Metadata clusterMetadata = session.getCluster().getMetadata();
|
||||
Metadata clusterMetadata = execute(new SessionCallback<Metadata>() {
|
||||
|
||||
@Override
|
||||
public Metadata doInSession(Session s) throws DataAccessException {
|
||||
return s.getCluster().getMetadata();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/*
|
||||
* Get all hosts in the cluster
|
||||
|
||||
Reference in New Issue
Block a user