Я создал два компонента ClusterBuilderCustomizer: один для операций чтения, а другой - для операций записи. может кто-нибудь помочь получить cqltemplates, используя нижеприведенные beans.
@Bean(name = "cassandraWriteBuilder")
public ClusterBuilderCustomizer cassandraWriteBuilder() {
return new CassandraWriteBuilderCustomization();
}
@Bean(name = "cassandraReadBuilder")
public ClusterBuilderCustomizer cassandraReadBuilder() {
return new CassandraReadBuilderCustomization();
}
public static class CassandraWriteBuilderCustomization implements
ClusterBuilderCustomizer {
@Override
public void customize(Builder builder) {
PoolingOptions poolOptions = new PoolingOptions();
poolOptions.setMaxRequestsPerConnection(HostDistance.LOCAL, 200);
builder.withPoolingOptions(poolOptions);
}
public static class CassandraReadBuilderCustomization implements
ClusterBuilderCustomizer {
@Override
public void customize(Builder builder) {
PoolingOptions poolOptions = new PoolingOptions();
poolOptions.setMaxRequestsPerConnection(HostDistance.LOCAL, 100);
builder.withPoolingOptions(poolOptions);
}
}