本文整理汇总了Java中com.datastax.driver.core.ConsistencyLevel.ONE属性的典型用法代码示例。如果您正苦于以下问题:Java ConsistencyLevel.ONE属性的具体用法?Java ConsistencyLevel.ONE怎么用?Java ConsistencyLevel.ONE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.datastax.driver.core.ConsistencyLevel
的用法示例。
在下文中一共展示了ConsistencyLevel.ONE属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDefaultReadConsistencyLevel
protected ConsistencyLevel getDefaultReadConsistencyLevel() {
if (defaultReadConsistencyLevel == null) {
if (readConsistencyLevel != null) {
defaultReadConsistencyLevel = ConsistencyLevel.valueOf(readConsistencyLevel.toUpperCase());
} else {
defaultReadConsistencyLevel = ConsistencyLevel.ONE;
}
}
return defaultReadConsistencyLevel;
}
示例2: getDefaultWriteConsistencyLevel
protected ConsistencyLevel getDefaultWriteConsistencyLevel() {
if (defaultWriteConsistencyLevel == null) {
if (writeConsistencyLevel != null) {
defaultWriteConsistencyLevel = ConsistencyLevel.valueOf(writeConsistencyLevel.toUpperCase());
} else {
defaultWriteConsistencyLevel = ConsistencyLevel.ONE;
}
}
return defaultWriteConsistencyLevel;
}
示例3: CassandraConfiguration
protected CassandraConfiguration() {
try {
seed = JavaConversions.asScalaBuffer(Arrays.asList(InetAddress.getByName("localhost")));
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
CassandraCluster cc = new CassandraCluster(seed, 9042,null, 8000, 120000, 1000,6000,
new ProtocolOptions().getCompression().LZ4, ConsistencyLevel.ONE);
session = cc.session();
}
示例4: readConsistency
protected static ConsistencyLevel readConsistency(AuthzTrans trans, String table) {
String prop = trans.getProperty(CASS_READ_CONSISTENCY+'.'+table);
if(prop==null) {
prop = trans.getProperty(CASS_READ_CONSISTENCY);
if(prop==null) {
return ConsistencyLevel.ONE; // this is Cassandra Default
}
}
return ConsistencyLevel.valueOf(prop);
}
示例5: writeConsistency
protected static ConsistencyLevel writeConsistency(AuthzTrans trans, String table) {
String prop = trans.getProperty(CASS_WRITE_CONSISTENCY+'.'+table);
if(prop==null) {
prop = trans.getProperty(CASS_WRITE_CONSISTENCY);
if(prop==null) {
return ConsistencyLevel.ONE; // this is Cassandra Default\
}
}
return ConsistencyLevel.valueOf(prop);
}