use of org.apache.cassandra.exceptions.CDCWriteException in project cassandra by apache.
the class CommitLogSegmentManagerCDCTest method bulkWrite.
private void bulkWrite(String tableName, int mutationSize) throws Throwable {
TableMetadata ccfm = Keyspace.open(keyspace()).getColumnFamilyStore(tableName).metadata();
boolean blockWrites = DatabaseDescriptor.getCDCBlockWrites();
// Spin to make sure we hit CDC capacity
try {
for (int i = 0; i < 1000; i++) {
new RowUpdateBuilder(ccfm, 0, i).add("data", randomizeBuffer(mutationSize)).build().applyFuture().get();
}
if (blockWrites)
Assert.fail("Expected CDCWriteException from full CDC but did not receive it.");
} catch (CDCWriteException e) {
if (!blockWrites)
Assert.fail("Excepted no CDCWriteException when not blocking writes but received it.");
}
}
Aggregations