use of org.apache.cassandra.db.commitlog.CommitLogSegment in project cassandra by apache.
the class OutOfSpaceTest method flushAndExpectError.
public void flushAndExpectError() throws InterruptedException, ExecutionException {
try {
Keyspace.open(KEYSPACE).getColumnFamilyStore(currentTable()).forceFlush().get();
fail("FSWriteError expected.");
} catch (ExecutionException e) {
// Correct path.
Assert.assertTrue(e.getCause() instanceof FSWriteError);
}
// Make sure commit log wasn't discarded.
TableId tableId = currentTableMetadata().id;
for (CommitLogSegment segment : CommitLog.instance.segmentManager.getActiveSegments()) if (segment.getDirtyTableIds().contains(tableId))
return;
fail("Expected commit log to remain dirty for the affected table.");
}
Aggregations