Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding an exception for Consistency level

  • Loading branch information...
commit ada3ddf93c86f3fe875d397f77aab50095244ddf 1 parent 03df4ed
@easility easility authored
View
8 src/main/java/com/alvazan/orm/layer9z/spi/db/cassandra/CassandraSession.java
@@ -38,6 +38,7 @@
import com.netflix.astyanax.MutationBatch;
import com.netflix.astyanax.connectionpool.OperationResult;
import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
+import com.netflix.astyanax.connectionpool.exceptions.TokenRangeOfflineException;
import com.netflix.astyanax.ddl.KeyspaceDefinition;
import com.netflix.astyanax.ddl.SchemaChangeResult;
import com.netflix.astyanax.model.ByteBufferRange;
@@ -137,7 +138,12 @@ public void sendChangesImpl(List<Action> actions, MetaLookup ormSession) throws
}
long time = System.currentTimeMillis();
- m.execute();
+ try {
+ m.execute();
+ } catch (TokenRangeOfflineException e) {
+ throw new RuntimeException(
+ "It appears your CL_LEVEL is CL_QUOROM and there are not enough nodes on line to service that request. Either lower your CL_LEVEL or make sure all nodes are operational");
+ }
if(log.isTraceEnabled()) {
long total = System.currentTimeMillis()-time;
Please sign in to comment.
Something went wrong with that request. Please try again.