Example usage for org.apache.cassandra.db.commitlog CommitLog resetUnsafe

List of usage examples for org.apache.cassandra.db.commitlog CommitLog resetUnsafe

Introduction

In this page you can find the example usage for org.apache.cassandra.db.commitlog CommitLog resetUnsafe.

Prototype

@VisibleForTesting
synchronized public int resetUnsafe(boolean deleteSegments) throws IOException 

Source Link

Document

FOR TESTING PURPOSES

Usage

From source file:org.springframework.cassandra.test.integration.EmbeddedCassandraServerHelper.java

License:Apache License

private static void cleanupAndRecreateDirectories() throws IOException {

    createCassandraDirectories();/*from  w  w  w. j  a  va2 s .c o  m*/
    cleanup();
    createCassandraDirectories();

    CommitLog commitLog = CommitLog.instance;
    commitLog.getContext(); // wait for commit log allocator instantiation to avoid hanging on a race condition
    commitLog.resetUnsafe(true); // cleanup screws w/ CommitLog, this brings it back to safe state
}

From source file:org.springframework.data.cassandra.test.util.EmbeddedCassandraServerHelper.java

License:Apache License

private static void cleanupAndRecreateDirectories() throws IOException {

    DatabaseDescriptor.daemonInitialization();
    createCassandraDirectories();/*from w ww .j  a  va  2  s . c om*/
    cleanup();
    createCassandraDirectories();

    CommitLog commitLog = CommitLog.instance;

    commitLog.getCurrentPosition(); // wait for commit log allocator instantiation to avoid hanging on a race condition
    commitLog.resetUnsafe(true); // cleanup screws w/ CommitLog, this brings it back to safe state
}

From source file:org.springframework.data.cql.EmbeddedCassandraServerHelper.java

License:Apache License

private static void cleanupAndRecreateDirectories() throws IOException {

    DatabaseDescriptor.daemonInitialization();
    createCassandraDirectories();// www.  ja v a  2 s  .  c  om
    cleanup();
    createCassandraDirectories();

    CommitLog commitLog = CommitLog.instance;
    commitLog.getCurrentPosition(); // wait for commit log allocator instantiation to avoid hanging on a race condition
    commitLog.resetUnsafe(true); // cleanup screws w/ CommitLog, this brings it back to safe state
}