org.apache.cassandra.db

## Class Memtable

- java.lang.Object
- - org.apache.cassandra.db.Memtable

All Implemented Interfaces:
  java.lang.Comparable<Memtable>

    public class Memtable
    extends java.lang.Object
    implements java.lang.Comparable<Memtable>

### Nested Class Summary

Nested Classes
`static class` `Memtable.LastCommitLogPosition`
`static class` `Memtable.MemtableUnfilteredPartitionIterator`

### Field Summary

Fields
`ColumnFamilyStore` `cfs`
`ClusteringComparator` `initialComparator`
`static MemtablePool` `MEMORY_POOL`

### Constructor Summary

Constructors
Constructor and Description
`Memtable(java.util.concurrent.atomic.AtomicReference<CommitLogPosition> commitLogLowerBound, ColumnFamilyStore cfs)`
`Memtable(CFMetaData metadata)`

### Method Summary

All Methods Instance Methods Concrete Methods
`java.lang.Throwable` `abortRunnables(java.util.List<org.apache.cassandra.db.Memtable.FlushRunnable> runnables, java.lang.Throwable t)`
`boolean` `accepts(OpOrder.Group opGroup, CommitLogPosition commitLogPosition)`
`int` `compareTo(Memtable that)`
`java.util.List<org.apache.cassandra.db.Memtable.FlushRunnable>` `flushRunnables(LifecycleTransaction txn)`
`MemtableAllocator` `getAllocator()`
`CommitLogPosition` `getCommitLogLowerBound()`
`CommitLogPosition` `getCommitLogUpperBound()`
`long` `getLiveDataSize()`
`long` `getMinTimestamp()`
`long` `getOperations()`
`Partition` `getPartition(DecoratedKey key)`
`boolean` `isClean()`
`boolean` `isExpired()`
`boolean` `isLive()`
`Memtable.MemtableUnfilteredPartitionIterator` `makePartitionIterator(ColumnFilter columnFilter, DataRange dataRange, boolean isForThrift)`
`void` `makeUnflushable()` For testing only.
`boolean` `mayContainDataBefore(CommitLogPosition position)`
`int` `partitionCount()`
`void` `setDiscarding(OpOrder.Barrier writeBarrier, java.util.concurrent.atomic.AtomicReference<CommitLogPosition> commitLogUpperBound)`
`java.lang.String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### MEMORY_POOL

    public static final MemtablePool MEMORY_POOL

#### cfs

    public final ColumnFamilyStore cfs

#### initialComparator

    public final ClusteringComparator initialComparator

### Constructor Detail

#### Memtable

    public Memtable(java.util.concurrent.atomic.AtomicReference<CommitLogPosition> commitLogLowerBound,
                    ColumnFamilyStore cfs)

#### Memtable

    public Memtable(CFMetaData metadata)

### Method Detail

#### compareTo

    public int compareTo(Memtable that)

Specified by:
  `compareTo` in interface `java.lang.Comparable<Memtable>`

#### getAllocator

    public MemtableAllocator getAllocator()

#### getLiveDataSize

    public long getLiveDataSize()

#### getOperations

    public long getOperations()

#### setDiscarding

    public void setDiscarding(OpOrder.Barrier writeBarrier,
                              java.util.concurrent.atomic.AtomicReference<CommitLogPosition> commitLogUpperBound)

#### accepts

    public boolean accepts(OpOrder.Group opGroup,
                           CommitLogPosition commitLogPosition)

#### getCommitLogLowerBound

    public CommitLogPosition getCommitLogLowerBound()

#### getCommitLogUpperBound

    public CommitLogPosition getCommitLogUpperBound()

#### isLive

    public boolean isLive()

#### isClean

    public boolean isClean()

#### mayContainDataBefore

    public boolean mayContainDataBefore(CommitLogPosition position)

#### isExpired

    public boolean isExpired()

Returns:
  true if this memtable is expired. Expiration time is determined by CF's memtable_flush_period_in_ms.

#### partitionCount

    public int partitionCount()

#### flushRunnables

    public java.util.List<org.apache.cassandra.db.Memtable.FlushRunnable> flushRunnables(LifecycleTransaction txn)

#### abortRunnables

    public java.lang.Throwable abortRunnables(java.util.List<org.apache.cassandra.db.Memtable.FlushRunnable> runnables,
                                              java.lang.Throwable t)

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`

#### makePartitionIterator

    public Memtable.MemtableUnfilteredPartitionIterator makePartitionIterator(ColumnFilter columnFilter,
                                                                              DataRange dataRange,
                                                                              boolean isForThrift)

#### getPartition

    public Partition getPartition(DecoratedKey key)

#### getMinTimestamp

    public long getMinTimestamp()

#### makeUnflushable

    public void makeUnflushable()

For testing only. Give this memtable too big a size to make it always fail flushing.