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


Field Summary
 java.lang.String columnFamily_
           
 
Method Summary
 java.lang.String cfStats(java.lang.String newLineSeparator)
           
 void flushMemtableOnRecovery()
           
 void forceFlush()
          Triggers an immediate memtable flush.
 void forceFlushBinary()
           
 ColumnFamily getColumnFamily(QueryFilter filter)
           
 ColumnFamily getColumnFamily(QueryFilter filter, int gcBefore)
          get a list of columns starting from a given column, in a specified order.
 ColumnFamily getColumnFamily(java.lang.String key, QueryPath path, byte[] start, byte[] finish, boolean reversed, int limit)
           
 java.lang.String getColumnFamilyName()
           
static ColumnFamilyStore getColumnFamilyStore(java.lang.String table, java.lang.String columnFamily)
           
 AbstractType getComparator()
           
static int getDefaultGCBefore()
           
protected static int getIndexFromFileName(java.lang.String filename)
           
 RangeReply getKeyRange(java.lang.String startWith, java.lang.String stopAt, int maxResults)
           
 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 getPendingTasks()
           
 int getReadCount()
           
 double getReadLatency()
           
 java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock getReadLock()
           
 java.util.Collection<SSTableReader> getSSTables()
          not threadsafe.
static java.util.List<Memtable> getUnflushedMemtables(java.lang.String cfName)
           
 int getWriteCount()
           
 double getWriteLatency()
           
 boolean isSuper()
           
 java.util.Iterator<java.lang.String> memtableKeyIterator()
           
 void snapshot(java.lang.String snapshotName)
          Take a snap shot of this columnfamily store.
 
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)

getColumnFamilyName

public java.lang.String getColumnFamilyName()
Specified by:
getColumnFamilyName in interface ColumnFamilyStoreMBean
Returns:
the name of the column family

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

forceFlushBinary

public void forceFlushBinary()

getDefaultGCBefore

public static int getDefaultGCBefore()

getUnflushedMemtables

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

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

getSSTables

public java.util.Collection<SSTableReader> getSSTables()
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

getReadLatency

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

getPendingTasks

public int getPendingTasks()
Specified by:
getPendingTasks in interface ColumnFamilyStoreMBean
Returns:
the estimated number of tasks pending for this column family

getWriteCount

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

getWriteLatency

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

getColumnFamily

public ColumnFamily getColumnFamily(java.lang.String key,
                                    QueryPath path,
                                    byte[] start,
                                    byte[] finish,
                                    boolean reversed,
                                    int limit)
                             throws java.io.IOException
Throws:
java.io.IOException

getColumnFamily

public ColumnFamily getColumnFamily(QueryFilter filter)
                             throws java.io.IOException
Throws:
java.io.IOException

getColumnFamily

public ColumnFamily getColumnFamily(QueryFilter filter,
                                    int gcBefore)
                             throws java.io.IOException
get a list of columns starting from a given column, in a specified order. only the latest version of a column is returned.

Returns:
null if there is no data and no tombstones; otherwise a ColumnFamily
Throws:
java.io.IOException

getKeyRange

public RangeReply getKeyRange(java.lang.String startWith,
                              java.lang.String stopAt,
                              int maxResults)
                       throws java.io.IOException,
                              java.util.concurrent.ExecutionException,
                              java.lang.InterruptedException
Parameters:
startWith - key to start with, inclusive. empty string = start at beginning.
stopAt - key to stop at, inclusive. empty string = stop only when keys are exhausted.
maxResults -
Returns:
list of keys between startWith and stopAt
Throws:
java.io.IOException
java.util.concurrent.ExecutionException
java.lang.InterruptedException

getComparator

public AbstractType getComparator()

snapshot

public void snapshot(java.lang.String snapshotName)
              throws java.io.IOException
Take a snap shot of this columnfamily store.

Parameters:
snapshotName - the name of the associated with the snapshot
Throws:
java.io.IOException


Copyright © 2009 The Apache Software Foundation