|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cassandra.db.ColumnFamilyStore
public class ColumnFamilyStore
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 |
---|
public static final java.util.concurrent.ExecutorService postFlushExecutor
public final Table table
public final java.lang.String columnFamily
public final CFMetaData metadata
public final IPartitioner partitioner
public final java.util.concurrent.ConcurrentMap<java.nio.ByteBuffer,java.nio.ByteBuffer> internedNames
public final java.util.concurrent.locks.Lock flushLock
public final AutoSavingCache<Pair<Descriptor,DecoratedKey>,java.lang.Long> keyCache
public final AutoSavingCache<DecoratedKey,ColumnFamily> rowCache
Method Detail |
---|
public void reload()
public java.util.concurrent.Future<?> addIndex(ColumnDefinition info)
public void buildSecondaryIndexes(java.util.Collection<SSTableReader> sstables, java.util.SortedSet<java.nio.ByteBuffer> columns)
public long getMinRowSize()
ColumnFamilyStoreMBean
getMinRowSize
in interface ColumnFamilyStoreMBean
public long getMaxRowSize()
ColumnFamilyStoreMBean
getMaxRowSize
in interface ColumnFamilyStoreMBean
public long getMeanRowSize()
ColumnFamilyStoreMBean
getMeanRowSize
in interface ColumnFamilyStoreMBean
public int getMeanColumns()
public static ColumnFamilyStore createColumnFamilyStore(Table table, java.lang.String columnFamily)
public static ColumnFamilyStore createColumnFamilyStore(Table table, java.lang.String columnFamily, IPartitioner partitioner, CFMetaData metadata)
public static void scrubDataDirectories(java.lang.String table, java.lang.String columnFamily)
public void initCaches()
public void scheduleCacheSaving(int rowCacheSavePeriodInSeconds, int keyCacheSavePeriodInSeconds)
public AutoSavingCache<Pair<Descriptor,DecoratedKey>,java.lang.Long> getKeyCache()
public java.lang.String getColumnFamilyName()
getColumnFamilyName
in interface ColumnFamilyStoreMBean
public java.lang.String getFlushPath(long estimatedSize, java.lang.String version)
public java.lang.String getTempSSTablePath(java.lang.String directory, java.lang.String version)
public java.lang.String getTempSSTablePath(java.lang.String directory)
public boolean isDropped()
public void forceFlushIfExpired()
public java.util.concurrent.Future<?> forceFlush()
ColumnFamilyStoreMBean
forceFlush
in interface ColumnFamilyStoreMBean
public void forceBlockingFlush() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public void forceFlushBinary()
public void updateRowCache(DecoratedKey key, ColumnFamily columnFamily)
public static ColumnFamily removeDeletedCF(ColumnFamily cf, int gcBefore)
public static ColumnFamily removeDeleted(ColumnFamily cf, int gcBefore)
public boolean isKeyInRemainingSSTables(DecoratedKey key, java.util.Set<? extends SSTable> sstablesToIgnore)
public void addSSTable(SSTableReader sstable)
public long getExpectedCompactedFileSize(java.lang.Iterable<SSTableReader> sstables)
public SSTableReader getMaxSizeFile(java.lang.Iterable<SSTableReader> sstables)
public void forceCleanup(NodeId.OneShotRenewer renewer) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public void scrub() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public void markCompacted(java.util.Collection<SSTableReader> sstables)
public boolean isCompleteSSTables(java.util.Set<SSTableReader> sstables)
public void replaceCompactedSSTables(java.util.Collection<SSTableReader> sstables, java.lang.Iterable<SSTableReader> replacements)
public boolean isInvalid()
public void removeAllSSTables()
public long getMemtableColumnsCount()
ColumnFamilyStoreMBean
getMemtableColumnsCount
in interface ColumnFamilyStoreMBean
public long getMemtableDataSize()
ColumnFamilyStoreMBean
getMemtableDataSize
in interface ColumnFamilyStoreMBean
public long getTotalMemtableLiveSize()
public int getMemtableSwitchCount()
ColumnFamilyStoreMBean
getMemtableSwitchCount
in interface ColumnFamilyStoreMBean
public DataTracker getDataTracker()
public java.util.Collection<SSTableReader> getSSTables()
public long[] getRecentSSTablesPerReadHistogram()
getRecentSSTablesPerReadHistogram
in interface ColumnFamilyStoreMBean
public long[] getSSTablesPerReadHistogram()
getSSTablesPerReadHistogram
in interface ColumnFamilyStoreMBean
public long getReadCount()
getReadCount
in interface ColumnFamilyStoreMBean
public double getRecentReadLatencyMicros()
getRecentReadLatencyMicros
in interface ColumnFamilyStoreMBean
public long[] getLifetimeReadLatencyHistogramMicros()
getLifetimeReadLatencyHistogramMicros
in interface ColumnFamilyStoreMBean
public long[] getRecentReadLatencyHistogramMicros()
getRecentReadLatencyHistogramMicros
in interface ColumnFamilyStoreMBean
public long getTotalReadLatencyMicros()
getTotalReadLatencyMicros
in interface ColumnFamilyStoreMBean
public int getPendingTasks()
getPendingTasks
in interface ColumnFamilyStoreMBean
public long getWriteCount()
getWriteCount
in interface ColumnFamilyStoreMBean
public long getTotalWriteLatencyMicros()
getTotalWriteLatencyMicros
in interface ColumnFamilyStoreMBean
public double getRecentWriteLatencyMicros()
getRecentWriteLatencyMicros
in interface ColumnFamilyStoreMBean
public long[] getLifetimeWriteLatencyHistogramMicros()
getLifetimeWriteLatencyHistogramMicros
in interface ColumnFamilyStoreMBean
public long[] getRecentWriteLatencyHistogramMicros()
getRecentWriteLatencyHistogramMicros
in interface ColumnFamilyStoreMBean
public ColumnFamily getColumnFamily(DecoratedKey key, QueryPath path, java.nio.ByteBuffer start, java.nio.ByteBuffer finish, boolean reversed, int limit)
public ColumnFamily getColumnFamily(QueryFilter filter)
public int gcBefore()
public java.util.List<Row> getRangeSlice(java.nio.ByteBuffer superColumn, AbstractBounds range, int maxResults, IFilter columnFilter) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
superColumn
- optional SuperColumn to slice subcolumns of; null to slice top-level columnsrange
- Either a Bounds, which includes start key, or a Range, which does not.maxResults
- Maximum rows to returncolumnFilter
- description of the columns we're interested in for each row
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public java.util.List<Row> scan(org.apache.cassandra.thrift.IndexClause clause, AbstractBounds range, IFilter dataFilter)
public AbstractType getComparator()
public void snapshot(java.lang.String snapshotName)
snapshotName
- the name of the associated with the snapshotpublic boolean hasUnreclaimedSpace()
public long getTotalDiskSpaceUsed()
getTotalDiskSpaceUsed
in interface ColumnFamilyStoreMBean
public long getLiveDiskSpaceUsed()
getLiveDiskSpaceUsed
in interface ColumnFamilyStoreMBean
public int getLiveSSTableCount()
getLiveSSTableCount
in interface ColumnFamilyStoreMBean
public ColumnFamily getRawCachedRow(DecoratedKey key)
public void invalidateCachedRow(DecoratedKey key)
public void forceMajorCompaction() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
ColumnFamilyStoreMBean
forceMajorCompaction
in interface ColumnFamilyStoreMBean
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public void invalidateRowCache()
ColumnFamilyStoreMBean
invalidateRowCache
in interface ColumnFamilyStoreMBean
public void invalidateKeyCache()
ColumnFamilyStoreMBean
invalidateKeyCache
in interface ColumnFamilyStoreMBean
public int getRowCacheCapacity()
public int getKeyCacheCapacity()
public int getRowCacheSize()
public int getKeyCacheSize()
public static java.lang.Iterable<ColumnFamilyStore> all()
public java.lang.Iterable<DecoratedKey> allKeySamples()
public java.lang.Iterable<DecoratedKey> keySamples(Range range)
public java.util.concurrent.Future<?> truncate() throws java.io.IOException
java.io.IOException
public void renameSSTables(java.lang.String newCfName) throws java.io.IOException
java.io.IOException
public long getBloomFilterFalsePositives()
getBloomFilterFalsePositives
in interface ColumnFamilyStoreMBean
public long getRecentBloomFilterFalsePositives()
getRecentBloomFilterFalsePositives
in interface ColumnFamilyStoreMBean
public double getBloomFilterFalseRatio()
getBloomFilterFalseRatio
in interface ColumnFamilyStoreMBean
public double getRecentBloomFilterFalseRatio()
getRecentBloomFilterFalseRatio
in interface ColumnFamilyStoreMBean
public java.util.SortedSet<java.nio.ByteBuffer> getIndexedColumns()
public ColumnFamilyStore getIndexedColumnFamilyStore(java.nio.ByteBuffer column)
public ColumnFamily newIndexedColumnFamily(java.nio.ByteBuffer column)
public DecoratedKey<LocalToken> getIndexKeyFor(java.nio.ByteBuffer name, java.nio.ByteBuffer value)
public java.lang.String toString()
toString
in class java.lang.Object
public void disableAutoCompaction()
ColumnFamilyStoreMBean
disableAutoCompaction
in interface ColumnFamilyStoreMBean
public int getMinimumCompactionThreshold()
ColumnFamilyStoreMBean
getMinimumCompactionThreshold
in interface ColumnFamilyStoreMBean
public void setMinimumCompactionThreshold(int minCompactionThreshold)
ColumnFamilyStoreMBean
setMinimumCompactionThreshold
in interface ColumnFamilyStoreMBean
public int getMaximumCompactionThreshold()
ColumnFamilyStoreMBean
getMaximumCompactionThreshold
in interface ColumnFamilyStoreMBean
public void setMaximumCompactionThreshold(int maxCompactionThreshold)
ColumnFamilyStoreMBean
setMaximumCompactionThreshold
in interface ColumnFamilyStoreMBean
public int getMemtableFlushAfterMins()
getMemtableFlushAfterMins
in interface ColumnFamilyStoreMBean
public void setMemtableFlushAfterMins(int time)
setMemtableFlushAfterMins
in interface ColumnFamilyStoreMBean
public int getMemtableThroughputInMB()
getMemtableThroughputInMB
in interface ColumnFamilyStoreMBean
public void setMemtableThroughputInMB(int size) throws ConfigurationException
setMemtableThroughputInMB
in interface ColumnFamilyStoreMBean
ConfigurationException
public double getMemtableOperationsInMillions()
getMemtableOperationsInMillions
in interface ColumnFamilyStoreMBean
public void setMemtableOperationsInMillions(double ops) throws ConfigurationException
setMemtableOperationsInMillions
in interface ColumnFamilyStoreMBean
ConfigurationException
public int getRowCacheSavePeriodInSeconds()
getRowCacheSavePeriodInSeconds
in interface ColumnFamilyStoreMBean
public void setRowCacheSavePeriodInSeconds(int rcspis)
setRowCacheSavePeriodInSeconds
in interface ColumnFamilyStoreMBean
public int getKeyCacheSavePeriodInSeconds()
getKeyCacheSavePeriodInSeconds
in interface ColumnFamilyStoreMBean
public void setKeyCacheSavePeriodInSeconds(int kcspis)
setKeyCacheSavePeriodInSeconds
in interface ColumnFamilyStoreMBean
public long estimateKeys()
estimateKeys
in interface ColumnFamilyStoreMBean
public void updateCacheSizes()
public long[] getEstimatedRowSizeHistogram()
getEstimatedRowSizeHistogram
in interface ColumnFamilyStoreMBean
public long[] getEstimatedColumnCountHistogram()
getEstimatedColumnCountHistogram
in interface ColumnFamilyStoreMBean
public boolean isIndexBuilt()
public java.util.List<java.lang.String> getBuiltIndexes()
getBuiltIndexes
in interface ColumnFamilyStoreMBean
public boolean isIndex()
public void reduceCacheSizes()
public java.nio.ByteBuffer internOrCopy(java.nio.ByteBuffer name)
public java.nio.ByteBuffer maybeIntern(java.nio.ByteBuffer name)
public SSTableWriter createFlushWriter(long estimatedRows, long estimatedSize, ReplayPosition context) throws java.io.IOException
java.io.IOException
public SSTableWriter createCompactionWriter(long estimatedRows, java.lang.String location, java.util.Collection<SSTableReader> sstables) throws java.io.IOException
java.io.IOException
public java.lang.Iterable<ColumnFamilyStore> concatWithIndexes()
public java.util.Set<Memtable> getMemtablesPendingFlush()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |