org.apache.cassandra.db
Class ColumnFamilyStore

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

public class ColumnFamilyStore
extends java.lang.Object
implements ColumnFamilyStoreMBean


Nested Class Summary
static class ColumnFamilyStore.CacheType
           
 
Field Summary
 java.lang.String columnFamily
           
 java.util.concurrent.locks.Lock flushLock
          Lock to allow migrations to block all flushing, so we can be sure not to write orphaned data files
 java.util.concurrent.ConcurrentMap<java.nio.ByteBuffer,java.nio.ByteBuffer> internedNames
           
 AutoSavingCache<Pair<Descriptor,DecoratedKey>,java.lang.Long> keyCache
           
 CFMetaData metadata
           
 IPartitioner partitioner
           
static java.util.concurrent.ExecutorService postFlushExecutor
           
 AutoSavingCache<DecoratedKey,ColumnFamily> rowCache
           
 Table table
           
 
Method Summary
 java.util.concurrent.Future<?> addIndex(ColumnDefinition info)
           
 void addSSTable(SSTableReader sstable)
           
static java.lang.Iterable<ColumnFamilyStore> all()
           
 java.lang.Iterable<DecoratedKey> allKeySamples()
           
 void buildSecondaryIndexes(java.util.Collection<SSTableReader> sstables, java.util.SortedSet<java.nio.ByteBuffer> columns)
           
 java.lang.Iterable<ColumnFamilyStore> concatWithIndexes()
           
static ColumnFamilyStore createColumnFamilyStore(Table table, java.lang.String columnFamily)
           
static ColumnFamilyStore createColumnFamilyStore(Table table, java.lang.String columnFamily, IPartitioner partitioner, CFMetaData metadata)
           
 SSTableWriter createCompactionWriter(long estimatedRows, java.lang.String location, java.util.Collection<SSTableReader> sstables)
           
 SSTableWriter createFlushWriter(long estimatedRows, long estimatedSize, ReplayPosition context)
           
 void disableAutoCompaction()
          Disable automatic compaction.
 long estimateKeys()
           
 void forceBlockingFlush()
           
 void forceCleanup(NodeId.OneShotRenewer renewer)
           
 java.util.concurrent.Future<?> forceFlush()
          Triggers an immediate memtable flush.
 void forceFlushBinary()
           
 void forceFlushIfExpired()
           
 void forceMajorCompaction()
          force a major compaction of this column family
 int gcBefore()
           
 long getBloomFilterFalsePositives()
           
 double getBloomFilterFalseRatio()
           
 java.util.List<java.lang.String> getBuiltIndexes()
          Returns a list of the names of the built column indexes for current store
 ColumnFamily getColumnFamily(DecoratedKey key, QueryPath path, java.nio.ByteBuffer start, java.nio.ByteBuffer finish, boolean reversed, int limit)
           
 ColumnFamily getColumnFamily(QueryFilter filter)
          get a list of columns starting from a given column, in a specified order.
 java.lang.String getColumnFamilyName()
           
 AbstractType getComparator()
           
 DataTracker getDataTracker()
          Package protected for access from the CompactionManager.
 long[] getEstimatedColumnCountHistogram()
           
 long[] getEstimatedRowSizeHistogram()
           
 long getExpectedCompactedFileSize(java.lang.Iterable<SSTableReader> sstables)
           
 java.lang.String getFlushPath(long estimatedSize, java.lang.String version)
           
 ColumnFamilyStore getIndexedColumnFamilyStore(java.nio.ByteBuffer column)
           
 java.util.SortedSet<java.nio.ByteBuffer> getIndexedColumns()
           
 DecoratedKey<LocalToken> getIndexKeyFor(java.nio.ByteBuffer name, java.nio.ByteBuffer value)
           
 AutoSavingCache<Pair<Descriptor,DecoratedKey>,java.lang.Long> getKeyCache()
           
 int getKeyCacheCapacity()
           
 int getKeyCacheSavePeriodInSeconds()
           
 int getKeyCacheSize()
           
 long[] getLifetimeReadLatencyHistogramMicros()
           
 long[] getLifetimeWriteLatencyHistogramMicros()
           
 long getLiveDiskSpaceUsed()
           
 int getLiveSSTableCount()
           
 int getMaximumCompactionThreshold()
          Gets the maximum number of sstables in queue before compaction kicks off
 long getMaxRowSize()
          return the size of the largest compacted row
 SSTableReader getMaxSizeFile(java.lang.Iterable<SSTableReader> sstables)
           
 int getMeanColumns()
           
 long getMeanRowSize()
          return the mean size of the rows compacted
 long getMemtableColumnsCount()
          Returns the total number of columns present in the memtable.
 long getMemtableDataSize()
          Returns the total amount of data stored in the memtable, including column related overhead.
 int getMemtableFlushAfterMins()
           
 double getMemtableOperationsInMillions()
           
 java.util.Set<Memtable> getMemtablesPendingFlush()
           
 int getMemtableSwitchCount()
          Returns the number of times that a flush has resulted in the memtable being switched out.
 int getMemtableThroughputInMB()
           
 int getMinimumCompactionThreshold()
          Gets the minimum number of sstables in queue before compaction kicks off
 long getMinRowSize()
          return the size of the smallest compacted row
 int getPendingTasks()
           
 java.util.List<Row> getRangeSlice(java.nio.ByteBuffer superColumn, AbstractBounds range, int maxResults, IFilter columnFilter)
          Fetch a range of rows and columns from memtables/sstables.
 ColumnFamily getRawCachedRow(DecoratedKey key)
          raw cached row -- does not fetch the row if it is not present.
 long getReadCount()
           
 long getRecentBloomFilterFalsePositives()
           
 double getRecentBloomFilterFalseRatio()
           
 long[] getRecentReadLatencyHistogramMicros()
           
 double getRecentReadLatencyMicros()
           
 long[] getRecentSSTablesPerReadHistogram()
           
 long[] getRecentWriteLatencyHistogramMicros()
           
 double getRecentWriteLatencyMicros()
           
 int getRowCacheCapacity()
           
 int getRowCacheSavePeriodInSeconds()
           
 int getRowCacheSize()
           
 java.util.Collection<SSTableReader> getSSTables()
           
 long[] getSSTablesPerReadHistogram()
           
 java.lang.String getTempSSTablePath(java.lang.String directory)
           
 java.lang.String getTempSSTablePath(java.lang.String directory, java.lang.String version)
           
 long getTotalDiskSpaceUsed()
           
 long getTotalMemtableLiveSize()
           
 long getTotalReadLatencyMicros()
           
 long getTotalWriteLatencyMicros()
           
 long getWriteCount()
           
 boolean hasUnreclaimedSpace()
           
 void initCaches()
           
 java.nio.ByteBuffer internOrCopy(java.nio.ByteBuffer name)
           
 void invalidateCachedRow(DecoratedKey key)
           
 void invalidateKeyCache()
          invalidate the key cache; for use after invalidating row cache
 void invalidateRowCache()
          invalidate the row cache; for use after bulk loading via BinaryMemtable
 boolean isCompleteSSTables(java.util.Set<SSTableReader> sstables)
           
 boolean isDropped()
           
 boolean isIndex()
          true if this CFS contains secondary index data
 boolean isIndexBuilt()
          Check if index is already built for current store
 boolean isInvalid()
           
 boolean isKeyInRemainingSSTables(DecoratedKey key, java.util.Set<? extends SSTable> sstablesToIgnore)
          Uses bloom filters to check if key may be present in any sstable in this ColumnFamilyStore, minus a set of provided ones.
 java.lang.Iterable<DecoratedKey> keySamples(Range range)
           
 void markCompacted(java.util.Collection<SSTableReader> sstables)
           
 java.nio.ByteBuffer maybeIntern(java.nio.ByteBuffer name)
           
 ColumnFamily newIndexedColumnFamily(java.nio.ByteBuffer column)
           
 void reduceCacheSizes()
          sets each cache's maximum capacity to 75% of its current size
 void reload()
           
 void removeAllSSTables()
           
static ColumnFamily removeDeleted(ColumnFamily cf, int gcBefore)
           
static ColumnFamily removeDeletedCF(ColumnFamily cf, int gcBefore)
           
 void renameSSTables(java.lang.String newCfName)
           
 void replaceCompactedSSTables(java.util.Collection<SSTableReader> sstables, java.lang.Iterable<SSTableReader> replacements)
           
 java.util.List<Row> scan(org.apache.cassandra.thrift.IndexClause clause, AbstractBounds range, IFilter dataFilter)
           
 void scheduleCacheSaving(int rowCacheSavePeriodInSeconds, int keyCacheSavePeriodInSeconds)
           
 void scrub()
           
static void scrubDataDirectories(java.lang.String table, java.lang.String columnFamily)
          Removes unnecessary files from the cf directory at startup: these include temp files, orphans, zero-length files and compacted sstables.
 void setKeyCacheSavePeriodInSeconds(int kcspis)
           
 void setMaximumCompactionThreshold(int maxCompactionThreshold)
          Sets the maximum number of sstables in queue before compaction kicks off
 void setMemtableFlushAfterMins(int time)
           
 void setMemtableOperationsInMillions(double ops)
           
 void setMemtableThroughputInMB(int size)
           
 void setMinimumCompactionThreshold(int minCompactionThreshold)
          Sets the minimum number of sstables in queue before compaction kicks off
 void setRowCacheSavePeriodInSeconds(int rcspis)
           
 void snapshot(java.lang.String snapshotName)
          Take a snap shot of this columnfamily store.
 java.lang.String toString()
           
 java.util.concurrent.Future<?> truncate()
          Truncate practically deletes the entire column family's data
 void updateCacheSizes()
          Resizes the key and row caches based on the current key estimate.
 void updateRowCache(DecoratedKey key, ColumnFamily columnFamily)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

postFlushExecutor

public static final java.util.concurrent.ExecutorService postFlushExecutor

table

public final Table table

columnFamily

public final java.lang.String columnFamily

metadata

public final CFMetaData metadata

partitioner

public final IPartitioner partitioner

internedNames

public final java.util.concurrent.ConcurrentMap<java.nio.ByteBuffer,java.nio.ByteBuffer> internedNames

flushLock

public final java.util.concurrent.locks.Lock flushLock
Lock to allow migrations to block all flushing, so we can be sure not to write orphaned data files


keyCache

public final AutoSavingCache<Pair<Descriptor,DecoratedKey>,java.lang.Long> keyCache

rowCache

public final AutoSavingCache<DecoratedKey,ColumnFamily> rowCache
Method Detail

reload

public void reload()

addIndex

public java.util.concurrent.Future<?> addIndex(ColumnDefinition info)

buildSecondaryIndexes

public void buildSecondaryIndexes(java.util.Collection<SSTableReader> sstables,
                                  java.util.SortedSet<java.nio.ByteBuffer> columns)

getMinRowSize

public long getMinRowSize()
Description copied from interface: ColumnFamilyStoreMBean
return the size of the smallest compacted row

Specified by:
getMinRowSize in interface ColumnFamilyStoreMBean
Returns:

getMaxRowSize

public long getMaxRowSize()
Description copied from interface: ColumnFamilyStoreMBean
return the size of the largest compacted row

Specified by:
getMaxRowSize in interface ColumnFamilyStoreMBean
Returns:

getMeanRowSize

public long getMeanRowSize()
Description copied from interface: ColumnFamilyStoreMBean
return the mean size of the rows compacted

Specified by:
getMeanRowSize in interface ColumnFamilyStoreMBean
Returns:

getMeanColumns

public int getMeanColumns()

createColumnFamilyStore

public static ColumnFamilyStore createColumnFamilyStore(Table table,
                                                        java.lang.String columnFamily)

createColumnFamilyStore

public static ColumnFamilyStore createColumnFamilyStore(Table table,
                                                        java.lang.String columnFamily,
                                                        IPartitioner partitioner,
                                                        CFMetaData metadata)

scrubDataDirectories

public static void scrubDataDirectories(java.lang.String table,
                                        java.lang.String columnFamily)
Removes unnecessary files from the cf directory at startup: these include temp files, orphans, zero-length files and compacted sstables. Files that cannot be recognized will be ignored.


initCaches

public void initCaches()

scheduleCacheSaving

public void scheduleCacheSaving(int rowCacheSavePeriodInSeconds,
                                int keyCacheSavePeriodInSeconds)

getKeyCache

public AutoSavingCache<Pair<Descriptor,DecoratedKey>,java.lang.Long> getKeyCache()

getColumnFamilyName

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

getFlushPath

public java.lang.String getFlushPath(long estimatedSize,
                                     java.lang.String version)

getTempSSTablePath

public java.lang.String getTempSSTablePath(java.lang.String directory,
                                           java.lang.String version)

getTempSSTablePath

public java.lang.String getTempSSTablePath(java.lang.String directory)

isDropped

public boolean isDropped()

forceFlushIfExpired

public void forceFlushIfExpired()

forceFlush

public java.util.concurrent.Future<?> forceFlush()
Description copied from interface: ColumnFamilyStoreMBean
Triggers an immediate memtable flush.

Specified by:
forceFlush in interface ColumnFamilyStoreMBean

forceBlockingFlush

public void forceBlockingFlush()
                        throws java.util.concurrent.ExecutionException,
                               java.lang.InterruptedException
Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException

forceFlushBinary

public void forceFlushBinary()

updateRowCache

public void updateRowCache(DecoratedKey key,
                           ColumnFamily columnFamily)

removeDeletedCF

public static ColumnFamily removeDeletedCF(ColumnFamily cf,
                                           int gcBefore)

removeDeleted

public static ColumnFamily removeDeleted(ColumnFamily cf,
                                         int gcBefore)

isKeyInRemainingSSTables

public boolean isKeyInRemainingSSTables(DecoratedKey key,
                                        java.util.Set<? extends SSTable> sstablesToIgnore)
Uses bloom filters to check if key may be present in any sstable in this ColumnFamilyStore, minus a set of provided ones. Because BFs are checked, negative returns ensure that the key is not present in the checked SSTables, but positive ones doesn't ensure key presence.


addSSTable

public void addSSTable(SSTableReader sstable)

getExpectedCompactedFileSize

public long getExpectedCompactedFileSize(java.lang.Iterable<SSTableReader> sstables)

getMaxSizeFile

public SSTableReader getMaxSizeFile(java.lang.Iterable<SSTableReader> sstables)

forceCleanup

public void forceCleanup(NodeId.OneShotRenewer renewer)
                  throws java.util.concurrent.ExecutionException,
                         java.lang.InterruptedException
Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException

scrub

public void scrub()
           throws java.util.concurrent.ExecutionException,
                  java.lang.InterruptedException
Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException

markCompacted

public void markCompacted(java.util.Collection<SSTableReader> sstables)

isCompleteSSTables

public boolean isCompleteSSTables(java.util.Set<SSTableReader> sstables)

replaceCompactedSSTables

public void replaceCompactedSSTables(java.util.Collection<SSTableReader> sstables,
                                     java.lang.Iterable<SSTableReader> replacements)

isInvalid

public boolean isInvalid()

removeAllSSTables

public void removeAllSSTables()

getMemtableColumnsCount

public long 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 long 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.

getTotalMemtableLiveSize

public long getTotalMemtableLiveSize()

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

getDataTracker

public DataTracker getDataTracker()
Package protected for access from the CompactionManager.


getSSTables

public java.util.Collection<SSTableReader> getSSTables()

getRecentSSTablesPerReadHistogram

public long[] getRecentSSTablesPerReadHistogram()
Specified by:
getRecentSSTablesPerReadHistogram in interface ColumnFamilyStoreMBean
Returns:
a histogram of the number of sstable data files accessed per read: reading this property resets it

getSSTablesPerReadHistogram

public long[] getSSTablesPerReadHistogram()
Specified by:
getSSTablesPerReadHistogram in interface ColumnFamilyStoreMBean
Returns:
a histogram of the number of sstable data files accessed per read

getReadCount

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

getRecentReadLatencyMicros

public double getRecentReadLatencyMicros()
Specified by:
getRecentReadLatencyMicros in interface ColumnFamilyStoreMBean
Returns:
average latency per read operation since the last call

getLifetimeReadLatencyHistogramMicros

public long[] getLifetimeReadLatencyHistogramMicros()
Specified by:
getLifetimeReadLatencyHistogramMicros in interface ColumnFamilyStoreMBean
Returns:
an array representing the latency histogram

getRecentReadLatencyHistogramMicros

public long[] getRecentReadLatencyHistogramMicros()
Specified by:
getRecentReadLatencyHistogramMicros in interface ColumnFamilyStoreMBean
Returns:
an array representing the latency histogram

getTotalReadLatencyMicros

public long getTotalReadLatencyMicros()
Specified by:
getTotalReadLatencyMicros in interface ColumnFamilyStoreMBean
Returns:
total read latency (divide by getReadCount() for average)

getPendingTasks

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

getWriteCount

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

getTotalWriteLatencyMicros

public long getTotalWriteLatencyMicros()
Specified by:
getTotalWriteLatencyMicros in interface ColumnFamilyStoreMBean
Returns:
total write latency (divide by getReadCount() for average)

getRecentWriteLatencyMicros

public double getRecentWriteLatencyMicros()
Specified by:
getRecentWriteLatencyMicros in interface ColumnFamilyStoreMBean
Returns:
average latency per write operation since the last call

getLifetimeWriteLatencyHistogramMicros

public long[] getLifetimeWriteLatencyHistogramMicros()
Specified by:
getLifetimeWriteLatencyHistogramMicros in interface ColumnFamilyStoreMBean
Returns:
an array representing the latency histogram

getRecentWriteLatencyHistogramMicros

public long[] getRecentWriteLatencyHistogramMicros()
Specified by:
getRecentWriteLatencyHistogramMicros in interface ColumnFamilyStoreMBean
Returns:
an array representing the latency histogram

getColumnFamily

public ColumnFamily getColumnFamily(DecoratedKey key,
                                    QueryPath path,
                                    java.nio.ByteBuffer start,
                                    java.nio.ByteBuffer finish,
                                    boolean reversed,
                                    int limit)

getColumnFamily

public ColumnFamily getColumnFamily(QueryFilter filter)
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

gcBefore

public int gcBefore()

getRangeSlice

public java.util.List<Row> getRangeSlice(java.nio.ByteBuffer superColumn,
                                         AbstractBounds range,
                                         int maxResults,
                                         IFilter columnFilter)
                                  throws java.util.concurrent.ExecutionException,
                                         java.lang.InterruptedException
Fetch a range of rows and columns from memtables/sstables.

Parameters:
superColumn - optional SuperColumn to slice subcolumns of; null to slice top-level columns
range - Either a Bounds, which includes start key, or a Range, which does not.
maxResults - Maximum rows to return
columnFilter - description of the columns we're interested in for each row
Returns:
true if we found all keys we were looking for, otherwise false
Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException

scan

public java.util.List<Row> scan(org.apache.cassandra.thrift.IndexClause clause,
                                AbstractBounds range,
                                IFilter dataFilter)

getComparator

public AbstractType getComparator()

snapshot

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

Parameters:
snapshotName - the name of the associated with the snapshot

hasUnreclaimedSpace

public boolean hasUnreclaimedSpace()

getTotalDiskSpaceUsed

public long getTotalDiskSpaceUsed()
Specified by:
getTotalDiskSpaceUsed in interface ColumnFamilyStoreMBean
Returns:
total disk space used by SSTables belonging to this CF, including obsolete ones waiting to be GC'd

getLiveDiskSpaceUsed

public long getLiveDiskSpaceUsed()
Specified by:
getLiveDiskSpaceUsed in interface ColumnFamilyStoreMBean
Returns:
disk space used by SSTables belonging to this CF

getLiveSSTableCount

public int getLiveSSTableCount()
Specified by:
getLiveSSTableCount in interface ColumnFamilyStoreMBean
Returns:
the number of SSTables on disk for this CF

getRawCachedRow

public ColumnFamily getRawCachedRow(DecoratedKey key)
raw cached row -- does not fetch the row if it is not present. not counted in cache statistics.


invalidateCachedRow

public void invalidateCachedRow(DecoratedKey key)

forceMajorCompaction

public void forceMajorCompaction()
                          throws java.lang.InterruptedException,
                                 java.util.concurrent.ExecutionException
Description copied from interface: ColumnFamilyStoreMBean
force a major compaction of this column family

Specified by:
forceMajorCompaction in interface ColumnFamilyStoreMBean
Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException

invalidateRowCache

public void invalidateRowCache()
Description copied from interface: ColumnFamilyStoreMBean
invalidate the row cache; for use after bulk loading via BinaryMemtable

Specified by:
invalidateRowCache in interface ColumnFamilyStoreMBean

invalidateKeyCache

public void invalidateKeyCache()
Description copied from interface: ColumnFamilyStoreMBean
invalidate the key cache; for use after invalidating row cache

Specified by:
invalidateKeyCache in interface ColumnFamilyStoreMBean

getRowCacheCapacity

public int getRowCacheCapacity()

getKeyCacheCapacity

public int getKeyCacheCapacity()

getRowCacheSize

public int getRowCacheSize()

getKeyCacheSize

public int getKeyCacheSize()

all

public static java.lang.Iterable<ColumnFamilyStore> all()

allKeySamples

public java.lang.Iterable<DecoratedKey> allKeySamples()

keySamples

public java.lang.Iterable<DecoratedKey> keySamples(Range range)

truncate

public java.util.concurrent.Future<?> truncate()
                                        throws java.io.IOException
Truncate practically deletes the entire column family's data

Returns:
a Future to the delete operation. Call the future's get() to make sure the column family has been deleted
Throws:
java.io.IOException

renameSSTables

public void renameSSTables(java.lang.String newCfName)
                    throws java.io.IOException
Throws:
java.io.IOException

getBloomFilterFalsePositives

public long getBloomFilterFalsePositives()
Specified by:
getBloomFilterFalsePositives in interface ColumnFamilyStoreMBean

getRecentBloomFilterFalsePositives

public long getRecentBloomFilterFalsePositives()
Specified by:
getRecentBloomFilterFalsePositives in interface ColumnFamilyStoreMBean

getBloomFilterFalseRatio

public double getBloomFilterFalseRatio()
Specified by:
getBloomFilterFalseRatio in interface ColumnFamilyStoreMBean

getRecentBloomFilterFalseRatio

public double getRecentBloomFilterFalseRatio()
Specified by:
getRecentBloomFilterFalseRatio in interface ColumnFamilyStoreMBean

getIndexedColumns

public java.util.SortedSet<java.nio.ByteBuffer> getIndexedColumns()

getIndexedColumnFamilyStore

public ColumnFamilyStore getIndexedColumnFamilyStore(java.nio.ByteBuffer column)

newIndexedColumnFamily

public ColumnFamily newIndexedColumnFamily(java.nio.ByteBuffer column)

getIndexKeyFor

public DecoratedKey<LocalToken> getIndexKeyFor(java.nio.ByteBuffer name,
                                               java.nio.ByteBuffer value)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

disableAutoCompaction

public void disableAutoCompaction()
Description copied from interface: ColumnFamilyStoreMBean
Disable automatic compaction.

Specified by:
disableAutoCompaction in interface ColumnFamilyStoreMBean

getMinimumCompactionThreshold

public int getMinimumCompactionThreshold()
Description copied from interface: ColumnFamilyStoreMBean
Gets the minimum number of sstables in queue before compaction kicks off

Specified by:
getMinimumCompactionThreshold in interface ColumnFamilyStoreMBean

setMinimumCompactionThreshold

public void setMinimumCompactionThreshold(int minCompactionThreshold)
Description copied from interface: ColumnFamilyStoreMBean
Sets the minimum number of sstables in queue before compaction kicks off

Specified by:
setMinimumCompactionThreshold in interface ColumnFamilyStoreMBean

getMaximumCompactionThreshold

public int getMaximumCompactionThreshold()
Description copied from interface: ColumnFamilyStoreMBean
Gets the maximum number of sstables in queue before compaction kicks off

Specified by:
getMaximumCompactionThreshold in interface ColumnFamilyStoreMBean

setMaximumCompactionThreshold

public void setMaximumCompactionThreshold(int maxCompactionThreshold)
Description copied from interface: ColumnFamilyStoreMBean
Sets the maximum number of sstables in queue before compaction kicks off

Specified by:
setMaximumCompactionThreshold in interface ColumnFamilyStoreMBean

getMemtableFlushAfterMins

public int getMemtableFlushAfterMins()
Specified by:
getMemtableFlushAfterMins in interface ColumnFamilyStoreMBean

setMemtableFlushAfterMins

public void setMemtableFlushAfterMins(int time)
Specified by:
setMemtableFlushAfterMins in interface ColumnFamilyStoreMBean

getMemtableThroughputInMB

public int getMemtableThroughputInMB()
Specified by:
getMemtableThroughputInMB in interface ColumnFamilyStoreMBean

setMemtableThroughputInMB

public void setMemtableThroughputInMB(int size)
                               throws ConfigurationException
Specified by:
setMemtableThroughputInMB in interface ColumnFamilyStoreMBean
Throws:
ConfigurationException

getMemtableOperationsInMillions

public double getMemtableOperationsInMillions()
Specified by:
getMemtableOperationsInMillions in interface ColumnFamilyStoreMBean

setMemtableOperationsInMillions

public void setMemtableOperationsInMillions(double ops)
                                     throws ConfigurationException
Specified by:
setMemtableOperationsInMillions in interface ColumnFamilyStoreMBean
Throws:
ConfigurationException

getRowCacheSavePeriodInSeconds

public int getRowCacheSavePeriodInSeconds()
Specified by:
getRowCacheSavePeriodInSeconds in interface ColumnFamilyStoreMBean

setRowCacheSavePeriodInSeconds

public void setRowCacheSavePeriodInSeconds(int rcspis)
Specified by:
setRowCacheSavePeriodInSeconds in interface ColumnFamilyStoreMBean

getKeyCacheSavePeriodInSeconds

public int getKeyCacheSavePeriodInSeconds()
Specified by:
getKeyCacheSavePeriodInSeconds in interface ColumnFamilyStoreMBean

setKeyCacheSavePeriodInSeconds

public void setKeyCacheSavePeriodInSeconds(int kcspis)
Specified by:
setKeyCacheSavePeriodInSeconds in interface ColumnFamilyStoreMBean

estimateKeys

public long estimateKeys()
Specified by:
estimateKeys in interface ColumnFamilyStoreMBean

updateCacheSizes

public void updateCacheSizes()
Resizes the key and row caches based on the current key estimate.


getEstimatedRowSizeHistogram

public long[] getEstimatedRowSizeHistogram()
Specified by:
getEstimatedRowSizeHistogram in interface ColumnFamilyStoreMBean

getEstimatedColumnCountHistogram

public long[] getEstimatedColumnCountHistogram()
Specified by:
getEstimatedColumnCountHistogram in interface ColumnFamilyStoreMBean

isIndexBuilt

public boolean isIndexBuilt()
Check if index is already built for current store

Returns:
true if built, false otherwise

getBuiltIndexes

public java.util.List<java.lang.String> getBuiltIndexes()
Returns a list of the names of the built column indexes for current store

Specified by:
getBuiltIndexes in interface ColumnFamilyStoreMBean
Returns:
list of the index names

isIndex

public boolean isIndex()
true if this CFS contains secondary index data


reduceCacheSizes

public void reduceCacheSizes()
sets each cache's maximum capacity to 75% of its current size


internOrCopy

public java.nio.ByteBuffer internOrCopy(java.nio.ByteBuffer name)

maybeIntern

public java.nio.ByteBuffer maybeIntern(java.nio.ByteBuffer name)

createFlushWriter

public SSTableWriter createFlushWriter(long estimatedRows,
                                       long estimatedSize,
                                       ReplayPosition context)
                                throws java.io.IOException
Throws:
java.io.IOException

createCompactionWriter

public SSTableWriter createCompactionWriter(long estimatedRows,
                                            java.lang.String location,
                                            java.util.Collection<SSTableReader> sstables)
                                     throws java.io.IOException
Throws:
java.io.IOException

concatWithIndexes

public java.lang.Iterable<ColumnFamilyStore> concatWithIndexes()

getMemtablesPendingFlush

public java.util.Set<Memtable> getMemtablesPendingFlush()


Copyright © 2011 The Apache Software Foundation