org.springframework.boot.autoconfigure.cassandra.CassandraProperties Java Examples

The following examples show how to use org.springframework.boot.autoconfigure.cassandra.CassandraProperties. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CassandraConfiguration.java    From tutorials with MIT License 5 votes vote down vote up
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;
}
 
Example #2
Source File: CassandraDataInitializer.java    From spring-fu with Apache License 2.0 4 votes vote down vote up
public CassandraDataInitializer(CassandraProperties properties) {
	this.properties = properties;
}
 
Example #3
Source File: CassandraConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
protected int getPort(CassandraProperties properties) {
    return properties.getPort();
}
 
Example #4
Source File: CassandraConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
private SocketOptions getSocketOptions(CassandraProperties properties) {
    SocketOptions options = new SocketOptions();
    options.setConnectTimeoutMillis(properties.getConnectTimeoutMillis());
    options.setReadTimeoutMillis(properties.getReadTimeoutMillis());
    return options;
}
 
Example #5
Source File: CassandraConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@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();
}