We use the java datastax cassandra driver 2.1.2. The version of Cassandra we use 2.0.9.
We have an operator that we build with QueryBuilder, and we explicitly indicate the level of consistency on the operator on TWO.
Select selectStatement = QueryBuilder.select().from(ARTICLES);
selectStatement.where(eq(ORGANIZATION_ID, organizationId));
selectStatement.setConsistencyLevel(ConsistencyLevel.TWO);
final ResultSet rs = session.execute(selectStatement);
List<Row> rows = rs.all();
for (final Row row : rows) {
}
We get an exception like this:
com.datastax.driver.core.exceptions.ReadTimeoutException: Cassandra timeout during read query at consistency ALL (3 responses were required but only 2 replica responded)
com.datastax.driver.core.exceptions.ReadTimeoutException.copy (ReadTimeoutException.java:69)
com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException (DefaultResultSetFuture.java:259)
com.datastax.driver.core.ArrayBackedResultSet$MultiPage.prepareNextRow (ArrayBackedResultSet.java:279)
com.datastax.driver.core.ArrayBackedResultSet$MultiPage.isExhausted (ArrayBackedResultSet.java:239)
com.datastax.driver.core.ArrayBackedResultSet$1.hasNext (ArrayBackedResultSet.java:122)
com.datastax.driver.core.ArrayBackedResultSet.all (ArrayBackedResultSet.java:111)
I know that a call all()to ResultSetforces you to load all the articles for the organization into memory and work with it and creates a load on cassandra. This will be deleted as indicated in the comments. This may lead to a read timeout, but I'm still puzzled why there is an error in the error message ALL.
, , ALL , TWO . all() - CL ALL ?