use of com.datastax.driver.core.ProtocolVersion in project apex-malhar by apache.
the class CassandraStore method buildCluster.
/**
* Creates a cluster object.
*/
public void buildCluster() {
try {
if (protocolVersion != null && protocolVersion.length() != 0) {
ProtocolVersion version = getCassandraProtocolVersion();
cluster = Cluster.builder().addContactPoint(node).withCredentials(userName, password).withProtocolVersion(version).build();
} else {
cluster = Cluster.builder().addContactPoint(node).withCredentials(userName, password).build();
}
} catch (DriverException ex) {
throw new RuntimeException("closing database resource", ex);
} catch (Throwable t) {
DTThrowable.rethrow(t);
}
}
Aggregations