I have the following code written on the datastax driver to establish a cassandra connection.
val cluster = Cluster.builder()
.withCompression(ProtocolOptions.Compression.LZ4)
.addContactPoints(List("a", "b").asJava)
.withCredentials("foo", "bar")
.withPort(1111)
.withProtocolVersion(ProtocolVersion.V4)
.withPoolingOptions(new PoolingOptions()
.setConnectionsPerHost(HostDistance.LOCAL, 1, 12)
.setConnectionsPerHost(HostDistance.REMOTE, 1, 12)
.setMaxRequestsPerConnection(HostDistance.LOCAL, 1028)
.setMaxRequestsPerConnection(HostDistance.REMOTE, 1028)
)
.withQueryOptions(new QueryOptions().setConsistencyLevel(ConsistencyLevel.QUORUM))
I am trying to migrate this code to start using PhantomDSL.
I want to build a PhantomDSL CassandraConnection with all the options like the one above.
I looked in the code here
and tried
val phantomConnection = new CassandraConnection("foo", cluster, false)
The error I get is
[error] MyConnection.scala:37: type mismatch;
[error] found : com.datastax.driver.core.Cluster.Builder
[error] required: com.outworkers.phantom.connectors.ClusterBuilder
[error] (which expands to) com.datastax.driver.core.Cluster.Builder => com.datastax.driver.core.Cluster.Builder
[error] Error occurred in an application involving default arguments.
[error] new CassandraConnection("foo", cluster, false)
[error] ^