private QueryOptions getQueryOptions(CassandraProperties properties) { QueryOptions options = new QueryOptions(); if (properties.getConsistencyLevel() != null) { options.setConsistencyLevel(properties.getConsistencyLevel()); } if (properties.getSerialConsistencyLevel() != null) { options.setSerialConsistencyLevel(properties.getSerialConsistencyLevel()); } options.setFetchSize(properties.getFetchSize()); return options; }
private static QueryOptions getQueryOptions(CassandraProperties properties) { QueryOptions options = new QueryOptions(); if (properties.getConsistencyLevel() != null) { options.setConsistencyLevel(properties.getConsistencyLevel()); } if (properties.getSerialConsistencyLevel() != null) { options.setSerialConsistencyLevel(properties.getSerialConsistencyLevel()); } options.setFetchSize(properties.getFetchSize()); return options; }
/** * Override how to get the port to connect to the Cassandra cluster * When deployed, the port is read by properties * For the tests we need to read the port dynamically to discover on which random port Cassandra-unit has started the * embedded cluster * @param properties * @return */ @Override protected int getPort(CassandraProperties properties) { int port = properties.getPort(); if (port == 0) { // random port for the tests int randomPort = DatabaseDescriptor.getNativeTransportPort(); log.info("Starting the cassandra cluster connection to a random port for the tests: {}", randomPort); return randomPort; } else { return port; } }
public CassandraDataAutoConfiguration(BeanFactory beanFactory, CassandraProperties properties, Cluster cluster, Environment environment) { this.beanFactory = beanFactory; this.properties = properties; this.cluster = cluster; this.propertyResolver = new RelaxedPropertyResolver(environment, "spring.data.cassandra."); }
private SocketOptions getSocketOptions(CassandraProperties properties) { SocketOptions options = new SocketOptions(); if (nonNull(properties.getConnectTimeout())) { options.setConnectTimeoutMillis((int) properties.getConnectTimeout().toMillis()); } if (nonNull(properties.getConnectTimeout())) { options.setReadTimeoutMillis((int) properties.getReadTimeout().toMillis()); } return options; }
protected int getPort(CassandraProperties properties) { return properties.getPort(); }
private SocketOptions getSocketOptions(CassandraProperties properties) { SocketOptions options = new SocketOptions(); options.setConnectTimeoutMillis(properties.getConnectTimeoutMillis()); options.setReadTimeoutMillis(properties.getReadTimeoutMillis()); return options; }
@Bean(destroyMethod = "close") public Session session(CassandraProperties properties, Cluster cluster) { log.debug("Configuring Cassandra session"); return StringUtils.hasText(properties.getKeyspaceName()) ? cluster.connect(properties.getKeyspaceName()) : cluster.connect(); }
private static SocketOptions getSocketOptions(CassandraProperties properties) { SocketOptions options = new SocketOptions(); options.setConnectTimeoutMillis(properties.getConnectTimeoutMillis()); options.setReadTimeoutMillis(properties.getReadTimeoutMillis()); return options; }
public CassandraDataAutoConfiguration(CassandraProperties properties, Cluster cluster) { this.properties = properties; this.cluster = cluster; }
public CassandraProperties getProperties() { if (activeProperties == null) setActiveProperty(); return activeProperties; }