Interface OnDiskFormat
- All Known Implementing Classes:
V1OnDiskFormat
public interface OnDiskFormat
An interface to the on-disk format of an index. This provides format agnostic methods
to read and write an on-disk format.
The methods on this interface can be logically mapped into the following groups based on their method parameters:
- Methods taking no parameters. These methods return static information about the format. This can include static information about the per-sstable components
- Methods taking an
IndexDescriptor. These methods interact with the on-disk components, or return objects that will interact with the on-disk components, or return information about the on-disk components. If they take anIndexTermTypeand/or aIndexIdentifieras well they will be interacting with per-column index files; otherwise they will be interacting with per-sstable index files - Methods taking an
IndexComponent. These methods only interact with a single index component or set of index components
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisPerColumnIndexBuildComplete(IndexDescriptor indexDescriptor, IndexIdentifier indexIdentifier) Returns true if the per-column index components have been built and are valid.booleanisPerSSTableIndexBuildComplete(IndexDescriptor indexDescriptor) Returns true if the per-sstable index components have been built and are valid.newPerColumnIndexWriter(StorageAttachedIndex index, IndexDescriptor indexDescriptor, LifecycleNewTracker tracker, RowMapping rowMapping) Create a newPerColumnIndexWriterto write the per-column on-disk components of an index.newPerSSTableIndexWriter(IndexDescriptor indexDescriptor) Create a newPerSSTableIndexWriterto write the per-SSTable on-disk components of an index.newPrimaryKeyMapFactory(IndexDescriptor indexDescriptor, SSTableReader sstable) Returns aPrimaryKeyMap.Factoryfor the SSTablenewSSTableIndex(SSTableContext sstableContext, StorageAttachedIndex index) Create a newSSTableIndexfor an on-disk index.intReturn the number of open per-column index files that can be open during a query.intopenFilesPerSSTableIndex(boolean hasClustering) Return the number of open per-SSTable files that can be open during a query.perColumnIndexComponents(IndexTermType indexTermType) Returns the set ofIndexComponentfor the per-column part of an index.perSSTableIndexComponents(boolean hasClustering) Returns the set ofIndexComponentfor the per-SSTable part of an index.voidvalidatePerColumnIndexComponents(IndexDescriptor indexDescriptor, IndexTermType indexTermType, IndexIdentifier indexIdentifier, boolean checksum) Validate all the per-column on-disk components and throw if a component is not validvoidvalidatePerSSTableIndexComponents(IndexDescriptor indexDescriptor, boolean checksum) Validate all the per-SSTable on-disk components and throw if a component is not valid
-
Method Details
-
newPrimaryKeyMapFactory
PrimaryKeyMap.Factory newPrimaryKeyMapFactory(IndexDescriptor indexDescriptor, SSTableReader sstable) Returns aPrimaryKeyMap.Factoryfor the SSTable- Parameters:
indexDescriptor- TheIndexDescriptorfor the SSTablesstable- TheSSTableReaderassociated with theIndexDescriptor
-
newSSTableIndex
Create a newSSTableIndexfor an on-disk index.- Parameters:
sstableContext- TheSSTableContextholding the per-SSTable information for the indexindex- TheStorageAttachedIndex- Returns:
- the new
SSTableIndexfor the on-disk index
-
newPerSSTableIndexWriter
Create a newPerSSTableIndexWriterto write the per-SSTable on-disk components of an index.- Parameters:
indexDescriptor- TheIndexDescriptorfor the SSTable- Throws:
IOException- if the writer couldn't be created
-
newPerColumnIndexWriter
PerColumnIndexWriter newPerColumnIndexWriter(StorageAttachedIndex index, IndexDescriptor indexDescriptor, LifecycleNewTracker tracker, RowMapping rowMapping) Create a newPerColumnIndexWriterto write the per-column on-disk components of an index. TheLifecycleNewTrackeris used to determine the type of index write about to happen this will either be anOperationType.FLUSHindicating that we are about to flush aMemtableIndexor one of the other operation types indicating that we will be writing from an existing SSTable- Parameters:
index- TheStorageAttachedIndexholding the current index build statusindexDescriptor- TheIndexDescriptorfor the SSTabletracker- TheLifecycleNewTrackerfor index build operation.rowMapping- TheRowMappingthat is used to map rowID toPrimaryKeyduring the write operation
-
isPerSSTableIndexBuildComplete
Returns true if the per-sstable index components have been built and are valid.- Parameters:
indexDescriptor- TheIndexDescriptorfor the SSTable SAI index
-
isPerColumnIndexBuildComplete
boolean isPerColumnIndexBuildComplete(IndexDescriptor indexDescriptor, IndexIdentifier indexIdentifier) Returns true if the per-column index components have been built and are valid.- Parameters:
indexDescriptor- TheIndexDescriptorfor the SSTable SAI indexindexIdentifier- TheIndexIdentifierfor the index
-
validatePerSSTableIndexComponents
Validate all the per-SSTable on-disk components and throw if a component is not valid- Parameters:
indexDescriptor- TheIndexDescriptorfor the SSTable SAI indexchecksum-trueif the checksum should be tested as part of the validation- Throws:
UncheckedIOException- if there is a problem validating any on-disk component
-
validatePerColumnIndexComponents
void validatePerColumnIndexComponents(IndexDescriptor indexDescriptor, IndexTermType indexTermType, IndexIdentifier indexIdentifier, boolean checksum) Validate all the per-column on-disk components and throw if a component is not valid- Parameters:
indexDescriptor- TheIndexDescriptorfor the SSTable SAI indexindexTermType- TheIndexTermTypeof the indexindexIdentifier- TheIndexIdentifierfor the indexchecksum-trueif the checksum should be tested as part of the validation- Throws:
UncheckedIOException- if there is a problem validating any on-disk component
-
perSSTableIndexComponents
Returns the set ofIndexComponentfor the per-SSTable part of an index. This is a complete set of components that could exist on-disk. It does not imply that the components currently exist on-disk.- Parameters:
hasClustering- true if the SSTable forms part of a table using clustering columns
-
perColumnIndexComponents
Returns the set ofIndexComponentfor the per-column part of an index. This is a complete set of components that could exist on-disk. It does not imply that the components currently exist on-disk.- Parameters:
indexTermType- theIndexTermTypeof the index
-
openFilesPerSSTableIndex
int openFilesPerSSTableIndex(boolean hasClustering) Return the number of open per-SSTable files that can be open during a query. This is a static indication of the files that can be held open by an index for queries. It is not a dynamic calculation.- Parameters:
hasClustering- true if the SSTable forms part of a table using clustering columns
-
openFilesPerColumnIndex
int openFilesPerColumnIndex()Return the number of open per-column index files that can be open during a query. This is a static indication of the files that can be help open by an index for queries. It is not a dynamic calculation.
-