Skip to content

Commit

Permalink
[cassandra] replace consistency ONE with QUORUM (#1487)
Browse files Browse the repository at this point in the history
  • Loading branch information
sitano authored Dec 7, 2020
1 parent 7ddc8fe commit 6720467
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions cassandra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ For keyspace `ycsb`, table `usertable`:
* `cassandra.readconsistencylevel`
* `cassandra.writeconsistencylevel`

* Default value is `ONE`
* Default value is `QUORUM`
- Consistency level for reads and writes, respectively. See the [DataStax documentation](http://docs.datastax.com/en/cassandra/2.0/cassandra/dml/dml_config_consistency_c.html) for details.
* *Note that the default setting does not provide durability in the face of node failure. Changing this setting will affect observed performance.* See also `replication_factor`, above.

* `cassandra.maxconnections`
* `cassandra.coreconnections`
Expand Down
8 changes: 4 additions & 4 deletions cassandra/src/main/java/site/ycsb/db/CassandraCQLClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public class CassandraCQLClient extends DB {
private static AtomicReference<PreparedStatement> deleteStmt =
new AtomicReference<PreparedStatement>();

private static ConsistencyLevel readConsistencyLevel = ConsistencyLevel.ONE;
private static ConsistencyLevel writeConsistencyLevel = ConsistencyLevel.ONE;
private static ConsistencyLevel readConsistencyLevel = ConsistencyLevel.QUORUM;
private static ConsistencyLevel writeConsistencyLevel = ConsistencyLevel.QUORUM;

public static final String YCSB_KEY = "y_id";
public static final String KEYSPACE_PROPERTY = "cassandra.keyspace";
Expand All @@ -97,10 +97,10 @@ public class CassandraCQLClient extends DB {

public static final String READ_CONSISTENCY_LEVEL_PROPERTY =
"cassandra.readconsistencylevel";
public static final String READ_CONSISTENCY_LEVEL_PROPERTY_DEFAULT = "ONE";
public static final String READ_CONSISTENCY_LEVEL_PROPERTY_DEFAULT = readConsistencyLevel.name();
public static final String WRITE_CONSISTENCY_LEVEL_PROPERTY =
"cassandra.writeconsistencylevel";
public static final String WRITE_CONSISTENCY_LEVEL_PROPERTY_DEFAULT = "ONE";
public static final String WRITE_CONSISTENCY_LEVEL_PROPERTY_DEFAULT = writeConsistencyLevel.name();

public static final String MAX_CONNECTIONS_PROPERTY =
"cassandra.maxconnections";
Expand Down

0 comments on commit 6720467

Please sign in to comment.