本文整理匯總了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);
}