本文整理汇总了Java中org.springframework.boot.autoconfigure.cassandra.CassandraProperties类的典型用法代码示例。如果您正苦于以下问题:Java CassandraProperties类的具体用法?Java CassandraProperties怎么用?Java CassandraProperties使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CassandraProperties类属于org.springframework.boot.autoconfigure.cassandra包,在下文中一共展示了CassandraProperties类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getQueryOptions
import org.springframework.boot.autoconfigure.cassandra.CassandraProperties; //导入依赖的package包/类
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;
}
示例2: getQueryOptions
import org.springframework.boot.autoconfigure.cassandra.CassandraProperties; //导入依赖的package包/类
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;
}
示例3: getPort
import org.springframework.boot.autoconfigure.cassandra.CassandraProperties; //导入依赖的package包/类
/**
* 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;
}
}
示例4: CassandraDataAutoConfiguration
import org.springframework.boot.autoconfigure.cassandra.CassandraProperties; //导入依赖的package包/类
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.");
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:CassandraDataAutoConfiguration.java
示例5: getSocketOptions
import org.springframework.boot.autoconfigure.cassandra.CassandraProperties; //导入依赖的package包/类
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;
}
示例6: getPort
import org.springframework.boot.autoconfigure.cassandra.CassandraProperties; //导入依赖的package包/类
protected int getPort(CassandraProperties properties) {
return properties.getPort();
}
示例7: getSocketOptions
import org.springframework.boot.autoconfigure.cassandra.CassandraProperties; //导入依赖的package包/类
private SocketOptions getSocketOptions(CassandraProperties properties) {
SocketOptions options = new SocketOptions();
options.setConnectTimeoutMillis(properties.getConnectTimeoutMillis());
options.setReadTimeoutMillis(properties.getReadTimeoutMillis());
return options;
}
示例8: session
import org.springframework.boot.autoconfigure.cassandra.CassandraProperties; //导入依赖的package包/类
@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();
}
示例9: getSocketOptions
import org.springframework.boot.autoconfigure.cassandra.CassandraProperties; //导入依赖的package包/类
private static SocketOptions getSocketOptions(CassandraProperties properties) {
SocketOptions options = new SocketOptions();
options.setConnectTimeoutMillis(properties.getConnectTimeoutMillis());
options.setReadTimeoutMillis(properties.getReadTimeoutMillis());
return options;
}
示例10: session
import org.springframework.boot.autoconfigure.cassandra.CassandraProperties; //导入依赖的package包/类
@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();
}
示例11: CassandraDataAutoConfiguration
import org.springframework.boot.autoconfigure.cassandra.CassandraProperties; //导入依赖的package包/类
public CassandraDataAutoConfiguration(CassandraProperties properties,
Cluster cluster) {
this.properties = properties;
this.cluster = cluster;
}
示例12: getProperties
import org.springframework.boot.autoconfigure.cassandra.CassandraProperties; //导入依赖的package包/类
public CassandraProperties getProperties() {
if (activeProperties == null) setActiveProperty();
return activeProperties;
}