Package org.apache.cassandra.index.sai
Class SSTableContext
- java.lang.Object
-
- org.apache.cassandra.utils.concurrent.SharedCloseableImpl
-
- org.apache.cassandra.index.sai.SSTableContext
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,SharedCloseable
public class SSTableContext extends SharedCloseableImpl
AnSSTableContext
is created for an individual sstable and is shared across column indexes to track per-sstable index files.The
SSTableContext
will be released when receiving a sstable removed notification, but its shared copies in individualSSTableIndex
es will be released when in-flight read requests complete.
-
-
Field Summary
Fields Modifier and Type Field Description IndexDescriptor
indexDescriptor
PrimaryKeyMap.Factory
primaryKeyMapFactory
SSTableReader
sstable
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SSTableContext
create(SSTableReader sstable)
Descriptor
descriptor()
long
diskUsage()
boolean
equals(java.lang.Object o)
int
hashCode()
SSTableIndex
newSSTableIndex(StorageAttachedIndex index)
Returns a newSSTableIndex
for a per-column indexint
openFilesPerSSTable()
SSTableContext
sharedCopy()
java.lang.String
toString()
-
Methods inherited from class org.apache.cassandra.utils.concurrent.SharedCloseableImpl
addTo, close, close, isCleanedUp
-
-
-
-
Field Detail
-
sstable
public final SSTableReader sstable
-
indexDescriptor
public final IndexDescriptor indexDescriptor
-
primaryKeyMapFactory
public final PrimaryKeyMap.Factory primaryKeyMapFactory
-
-
Method Detail
-
create
public static SSTableContext create(SSTableReader sstable)
-
sharedCopy
public SSTableContext sharedCopy()
- Returns:
- a new instance of the object representing the same state and backed by the same underlying resources. Coordinates with the original (and other instances) when the underlying resource should be closed. Throws an exception if the shared resource has already been closed.
-
newSSTableIndex
public SSTableIndex newSSTableIndex(StorageAttachedIndex index)
Returns a newSSTableIndex
for a per-column index
-
descriptor
public Descriptor descriptor()
- Returns:
- descriptor of attached sstable
-
diskUsage
public long diskUsage()
- Returns:
- disk usage (in bytes) of per-sstable index files
-
openFilesPerSSTable
public int openFilesPerSSTable()
- Returns:
- number of open files per
SSTableContext
instance
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-