## org.apache.cassandra.db.commitlog
Class CommitLog

    java.lang.Object
      org.apache.cassandra.db.commitlog.CommitLog

All Implemented Interfaces:
  CommitLogMBean

    public class CommitLog

extends java.lang.Object
implements CommitLogMBean

Field Summary
`static CommitLog` `instance`

Method Summary
`void` `add(RowMutation rowMutation)`
`void` `discardCompletedSegments(java.lang.Integer cfId, ReplayPosition context)`
`void` `forceNewSegment()`
`long` `getCompletedTasks()` Get the number of completed tasks
`ReplayPosition` `getContext()`
`long` `getPendingTasks()` Get the number of tasks waiting to be executed
`long` `getSize()`
`long` `getTotalCommitlogSize()` Get the current size used by all the commitlog segments.
`static int` `recover()`
`static int` `recover(java.io.File[] clogs)`
`void` `resetUnsafe()`
`int` `segmentsCount()`
`void` `shutdownBlocking()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### instance

    public static final CommitLog instance

Method Detail

### resetUnsafe

    public void resetUnsafe()

### recover

    public static int recover()
                       throws java.io.IOException

  Throws:
    `java.io.IOException`

### recover

    public static int recover(java.io.File[] clogs)
                       throws java.io.IOException

  Throws:
    `java.io.IOException`

### getContext

    public ReplayPosition getContext()

### segmentsCount

    public int segmentsCount()

### add

    public void add(RowMutation rowMutation)
             throws java.io.IOException

  Throws:
    `java.io.IOException`

### discardCompletedSegments

    public void discardCompletedSegments(java.lang.Integer cfId,
                                         ReplayPosition context)
                                  throws java.io.IOException

  Throws:
    `java.io.IOException`

### getSize

    public long getSize()

  Returns:
    the total size occupied by the commitlog segments expressed in bytes.

### getCompletedTasks

    public long getCompletedTasks()

  Description copied from interface: `CommitLogMBean`
  Get the number of completed tasks

  Specified by:
    `getCompletedTasks` in interface `CommitLogMBean`

### getPendingTasks

    public long getPendingTasks()

  Description copied from interface: `CommitLogMBean`
  Get the number of tasks waiting to be executed

  Specified by:
    `getPendingTasks` in interface `CommitLogMBean`

### getTotalCommitlogSize

    public long getTotalCommitlogSize()

  Description copied from interface: `CommitLogMBean`
  Get the current size used by all the commitlog segments.

  Specified by:
    `getTotalCommitlogSize` in interface `CommitLogMBean`

### forceNewSegment

    public void forceNewSegment()
                         throws java.util.concurrent.ExecutionException,
                                java.lang.InterruptedException

  Throws:
    `java.util.concurrent.ExecutionException`
    `java.lang.InterruptedException`

### shutdownBlocking

    public void shutdownBlocking()
                          throws java.lang.InterruptedException

  Throws:
    `java.lang.InterruptedException`

Copyright © 2012 The Apache Software Foundation