|
||||||||||
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
|
static class |
ColumnFamilyStore.ViewFragment
|
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 |
SecondaryIndexManager |
indexManager
|
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 | |
---|---|
void |
addSSTable(SSTableReader sstable)
|
static java.lang.Iterable<ColumnFamilyStore> |
all()
|
java.lang.Iterable<DecoratedKey> |
allKeySamples()
|
void |
apply(DecoratedKey key,
ColumnFamily columnFamily)
Insert/Update the column family for this key. |
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 |
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. |
ColumnFamily |
getColumnFamily(QueryFilter filter,
ISortedColumns.Factory factory)
|
java.lang.String |
getColumnFamilyName()
|
AbstractCompactionStrategy |
getCompactionStrategy()
|
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)
|
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. |
java.util.Set<Memtable> |
getMemtablesPendingFlush()
|
int |
getMemtableSwitchCount()
Returns the number of times that a flush has resulted in the memtable being switched out. |
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 |
getRowCacheKeysToSave()
|
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()
|
int |
getUnleveledSSTables()
|
long |
getWriteCount()
|
boolean |
hasUnreclaimedSpace()
|
void |
initCaches()
|
java.nio.ByteBuffer |
internOrCopy(java.nio.ByteBuffer name,
Allocator allocator)
|
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 |
isCompactionDisabled()
|
boolean |
isDropped()
|
boolean |
isIndex()
true if this CFS contains secondary index data |
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 |
loadNewSSTables()
#Scan through Keyspace/ColumnFamily's data directory determine which SSTables should be loaded and load them |
static void |
loadNewSSTables(java.lang.String ksName,
java.lang.String cfName)
See # StorageService.loadNewSSTables(String, String) for more info |
void |
markCompacted(java.util.Collection<SSTableReader> sstables)
|
java.util.Collection<SSTableReader> |
markCurrentSSTablesReferenced()
Get the current sstables, acquiring references on all of them. |
ColumnFamilyStore.ViewFragment |
markReferenced(DecoratedKey key)
|
ColumnFamilyStore.ViewFragment |
markReferenced(DecoratedKey startWith,
DecoratedKey stopAt)
|
java.nio.ByteBuffer |
maybeIntern(java.nio.ByteBuffer name)
|
java.util.concurrent.Future<?> |
maybeSwitchMemtable(Memtable oldMemtable,
boolean writeCommitLog)
flush the given memtable and swap in a new one for its CFS, if it hasn't been frozen already. |
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)
|
static void |
removeDeletedColumnsOnly(ColumnFamily cf,
int gcBefore)
|
void |
renameSSTables(java.lang.String newCfName)
|
void |
replaceCompactedSSTables(java.util.Collection<SSTableReader> sstables,
java.lang.Iterable<SSTableReader> replacements)
|
void |
scheduleCacheSaving(int rowCacheSavePeriodInSeconds,
int keyCacheSavePeriodInSeconds,
int rowCacheKeysToSave)
|
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. |
java.util.List<Row> |
search(org.apache.cassandra.thrift.IndexClause clause,
AbstractBounds range,
IFilter dataFilter)
|
void |
setKeyCacheSavePeriodInSeconds(int kcspis)
|
void |
setMaximumCompactionThreshold(int maxCompactionThreshold)
Sets the maximum number of sstables in queue before compaction kicks off |
void |
setMinimumCompactionThreshold(int minCompactionThreshold)
Sets the minimum number of sstables in queue before compaction kicks off |
void |
setRowCacheKeysToSave(int keysToSave)
|
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 |
unregisterMBean()
|
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 SecondaryIndexManager indexManager
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() throws java.io.IOException
java.io.IOException
public void unregisterMBean()
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, int rowCacheKeysToSave)
public AutoSavingCache<Pair<Descriptor,DecoratedKey>,java.lang.Long> getKeyCache()
public static void loadNewSSTables(java.lang.String ksName, java.lang.String cfName)
StorageService.loadNewSSTables(String, String)
for more info
ksName
- The keyspace namecfName
- The columnFamily namepublic void loadNewSSTables()
loadNewSSTables
in interface ColumnFamilyStoreMBean
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 java.util.concurrent.Future<?> maybeSwitchMemtable(Memtable oldMemtable, boolean writeCommitLog)
public boolean isDropped()
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 updateRowCache(DecoratedKey key, ColumnFamily columnFamily)
public void apply(DecoratedKey key, ColumnFamily columnFamily)
public static ColumnFamily removeDeletedCF(ColumnFamily cf, int gcBefore)
public static ColumnFamily removeDeleted(ColumnFamily cf, int gcBefore)
public static void removeDeletedColumnsOnly(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 void replaceCompactedSSTables(java.util.Collection<SSTableReader> sstables, java.lang.Iterable<SSTableReader> replacements)
public boolean isInvalid()
public void removeAllSSTables() throws java.io.IOException
java.io.IOException
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 ColumnFamily getColumnFamily(QueryFilter filter, ISortedColumns.Factory factory)
public int gcBefore()
public java.util.Collection<SSTableReader> markCurrentSSTablesReferenced()
public ColumnFamilyStore.ViewFragment markReferenced(DecoratedKey key)
public ColumnFamilyStore.ViewFragment markReferenced(DecoratedKey startWith, DecoratedKey stopAt)
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> search(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.lang.String toString()
toString
in class java.lang.Object
public void disableAutoCompaction()
ColumnFamilyStoreMBean
disableAutoCompaction
in interface ColumnFamilyStoreMBean
public AbstractCompactionStrategy getCompactionStrategy()
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 boolean isCompactionDisabled()
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 int getRowCacheKeysToSave()
getRowCacheKeysToSave
in interface ColumnFamilyStoreMBean
public void setRowCacheKeysToSave(int keysToSave)
setRowCacheKeysToSave
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 isIndex()
public void reduceCacheSizes()
public java.nio.ByteBuffer internOrCopy(java.nio.ByteBuffer name, Allocator allocator)
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()
public java.util.List<java.lang.String> getBuiltIndexes()
ColumnFamilyStoreMBean
getBuiltIndexes
in interface ColumnFamilyStoreMBean
public int getUnleveledSSTables()
getUnleveledSSTables
in interface ColumnFamilyStoreMBean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |