Search in sources :

Example 1 with CommitLogSegment

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.");
}
Also used : TableId(org.apache.cassandra.schema.TableId) CommitLogSegment(org.apache.cassandra.db.commitlog.CommitLogSegment) FSWriteError(org.apache.cassandra.io.FSWriteError) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

ExecutionException (java.util.concurrent.ExecutionException)1 CommitLogSegment (org.apache.cassandra.db.commitlog.CommitLogSegment)1 FSWriteError (org.apache.cassandra.io.FSWriteError)1 TableId (org.apache.cassandra.schema.TableId)1