org.apache.cassandra.db
Class ColumnFamilyStore

java.lang.Object
  extended by org.apache.cassandra.db.ColumnFamilyStore
All Implemented Interfaces:
ColumnFamilyStoreMBean

public final class ColumnFamilyStore
extends java.lang.Object
implements ColumnFamilyStoreMBean

Author : Avinash Lakshman ( alakshman@facebook.com) & Prashant Malik ( pmalik@facebook.com )


Field Summary
 java.lang.String columnFamily_
           
 
Method Summary
 java.lang.String cfStats(java.lang.String newLineSeparator)
           
 int doCompaction(int threshold)
           
 void flushMemtableOnRecovery()
           
 void forceFlush()
          Triggers an immediate memtable flush.
 ColumnFamily getColumnFamily(java.lang.String key, java.lang.String columnFamilyColumn, IFilter filter)
           
 ColumnFamily getColumnFamily(java.lang.String key, java.lang.String columnFamilyColumn, IFilter filter, int gcBefore)
           
static ColumnFamilyStore getColumnFamilyStore(java.lang.String table, java.lang.String columnFamily)
           
protected static int getIndexFromFileName(java.lang.String filename)
           
 int getMemtableColumnsCount()
          Returns the total number of columns present in the memtable.
 int getMemtableDataSize()
          Returns the total amount of data stored in the memtable, including column related overhead.
 int getMemtableSwitchCount()
          Returns the number of times that a flush has resulted in the memtable being switched out.
 int getReadCount()
           
 int getReadDiskHits()
           
 double getReadLatency()
           
 java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock getReadLock()
           
 java.util.SortedSet<java.lang.String> getSSTableFilenames()
          not threadsafe.
static java.util.List<Memtable> getUnflushedMemtables(java.lang.String cfName)
           
 boolean isSuper()
           
 java.util.Iterator<java.lang.String> memtableKeyIterator()
           
static void submitFlush(Memtable memtable, CommitLog.CommitLogContext cLogCtx)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnFamily_

public final java.lang.String columnFamily_
Method Detail

getColumnFamilyStore

public static ColumnFamilyStore getColumnFamilyStore(java.lang.String table,
                                                     java.lang.String columnFamily)
                                              throws java.io.IOException
Throws:
java.io.IOException

cfStats

public java.lang.String cfStats(java.lang.String newLineSeparator)

getIndexFromFileName

protected static int getIndexFromFileName(java.lang.String filename)

forceFlush

public void forceFlush()
Description copied from interface: ColumnFamilyStoreMBean
Triggers an immediate memtable flush.

Specified by:
forceFlush in interface ColumnFamilyStoreMBean

getColumnFamily

public ColumnFamily getColumnFamily(java.lang.String key,
                                    java.lang.String columnFamilyColumn,
                                    IFilter filter)
                             throws java.io.IOException
Throws:
java.io.IOException

getColumnFamily

public ColumnFamily getColumnFamily(java.lang.String key,
                                    java.lang.String columnFamilyColumn,
                                    IFilter filter,
                                    int gcBefore)
                             throws java.io.IOException
Throws:
java.io.IOException

doCompaction

public int doCompaction(int threshold)
                 throws java.io.IOException
Throws:
java.io.IOException

getUnflushedMemtables

public static java.util.List<Memtable> getUnflushedMemtables(java.lang.String cfName)

submitFlush

public static void submitFlush(Memtable memtable,
                               CommitLog.CommitLogContext cLogCtx)

isSuper

public boolean isSuper()

flushMemtableOnRecovery

public void flushMemtableOnRecovery()
                             throws java.io.IOException
Throws:
java.io.IOException

getMemtableColumnsCount

public int getMemtableColumnsCount()
Description copied from interface: ColumnFamilyStoreMBean
Returns the total number of columns present in the memtable.

Specified by:
getMemtableColumnsCount in interface ColumnFamilyStoreMBean
Returns:
The number of columns.

getMemtableDataSize

public int getMemtableDataSize()
Description copied from interface: ColumnFamilyStoreMBean
Returns the total amount of data stored in the memtable, including column related overhead.

Specified by:
getMemtableDataSize in interface ColumnFamilyStoreMBean
Returns:
The size in bytes.

getMemtableSwitchCount

public int getMemtableSwitchCount()
Description copied from interface: ColumnFamilyStoreMBean
Returns the number of times that a flush has resulted in the memtable being switched out.

Specified by:
getMemtableSwitchCount in interface ColumnFamilyStoreMBean
Returns:
the number of memtable switches

memtableKeyIterator

public java.util.Iterator<java.lang.String> memtableKeyIterator()
                                                         throws java.util.concurrent.ExecutionException,
                                                                java.lang.InterruptedException
Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException

getSSTableFilenames

public java.util.SortedSet<java.lang.String> getSSTableFilenames()
not threadsafe. caller must have lock_ acquired.


getReadLock

public java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock getReadLock()

getReadCount

public int getReadCount()
Specified by:
getReadCount in interface ColumnFamilyStoreMBean
Returns:
the number of read operations on this column family in the last minute

getReadDiskHits

public int getReadDiskHits()
Specified by:
getReadDiskHits in interface ColumnFamilyStoreMBean
Returns:
the number of read operations on this column family that hit the disk in the last minute

getReadLatency

public double getReadLatency()
Specified by:
getReadLatency in interface ColumnFamilyStoreMBean
Returns:
average latency per read operation in the last minute


Copyright © 2009 The Apache Software Foundation