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

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

Introduction

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

Prototype

public CommitLogPosition getCurrentPosition() 

Source Link

Usage

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

License:Apache License

private static void cleanupAndRecreateDirectories() throws IOException {

    DatabaseDescriptor.daemonInitialization();
    createCassandraDirectories();/*w  w w  . j a  v a 2s  . 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();//from  ww  w.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
}