class DiskLogger extends LifeCycleThread {

    public LSN switchLogFile(boolean incrementViewId) throws IOException {
        if (!hasLock()) {
            throw new IllegalStateException("the lock is held by another thread or the logger is not locked.");
        }

        // get last synchronized LSN and increment the viewId if needed
        LSN lastSyncedLSN = null;
        if (incrementViewId) {
            int view = currentViewId.getAndIncrement();
            long seq = nextLogSequenceNo.getAndSet(1L) - 1L;

            assert (seq != 0) : "Checkpoint after checkpoint is not allowed!";

            lastSyncedLSN = new LSN(view, seq);
        } else {
            lastSyncedLSN = new LSN(currentViewId.get(), nextLogSequenceNo.get() - 1L);
        }

        dropLogFile();
        loadLogFile();

        return lastSyncedLSN;
    }

    public  DiskLogger(String logfileDir, LSN initLSN, SyncMode syncMode, int pseudoSyncWait, int maxQ);

}