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:
dwebb
2013-11-11 14:18:54 -05:00
parent eba84d0423
commit d881a17af0
5 changed files with 829 additions and 3 deletions

View File

@@ -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