Class V1OnDiskFormat
java.lang.Object
org.apache.cassandra.index.sai.disk.v1.V1OnDiskFormat
- All Implemented Interfaces:
OnDiskFormat
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final V1OnDiskFormatstatic final Set<IndexComponent>static final Set<IndexComponent>static final longGlobal limit on heap consumed by all index segment building that occurs outside the context of Memtable flush.static final NamedMemoryLimiterstatic final Set<IndexComponent>static final Set<IndexComponent>static final Set<IndexComponent> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanisNotBuildCompletionMarker(IndexComponent indexComponent) booleanisPerColumnIndexBuildComplete(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
-
Field Details
-
SKINNY_PER_SSTABLE_COMPONENTS
-
WIDE_PER_SSTABLE_COMPONENTS
-
LITERAL_COMPONENTS
-
NUMERIC_COMPONENTS
-
VECTOR_COMPONENTS
-
SEGMENT_BUILD_MEMORY_LIMIT
public static final long SEGMENT_BUILD_MEMORY_LIMITGlobal limit on heap consumed by all index segment building that occurs outside the context of Memtable flush.Note that to avoid flushing small index segments, a segment is only flushed when both the global size of all building segments has breached the limit and the size of the segment in question reaches (segment_write_buffer_space_mb / # currently building column indexes).
ex. If there is only one column index building, it can buffer up to segment_write_buffer_space_mb.
ex. If there is one column index building per table across 8 compactors, each index will be eligible to flush once it reaches (segment_write_buffer_space_mb / 8) MBs.
-
SEGMENT_BUILD_MEMORY_LIMITER
-
instance
-
-
Constructor Details
-
V1OnDiskFormat
protected V1OnDiskFormat()
-
-
Method Details
-
newPrimaryKeyMapFactory
public PrimaryKeyMap.Factory newPrimaryKeyMapFactory(IndexDescriptor indexDescriptor, SSTableReader sstable) Description copied from interface:OnDiskFormatReturns aPrimaryKeyMap.Factoryfor the SSTable- Specified by:
newPrimaryKeyMapFactoryin interfaceOnDiskFormat- Parameters:
indexDescriptor- TheIndexDescriptorfor the SSTablesstable- TheSSTableReaderassociated with theIndexDescriptor
-
newSSTableIndex
Description copied from interface:OnDiskFormatCreate a newSSTableIndexfor an on-disk index.- Specified by:
newSSTableIndexin interfaceOnDiskFormat- Parameters:
sstableContext- TheSSTableContextholding the per-SSTable information for the indexindex- TheStorageAttachedIndex- Returns:
- the new
SSTableIndexfor the on-disk index
-
newPerSSTableIndexWriter
public PerSSTableIndexWriter newPerSSTableIndexWriter(IndexDescriptor indexDescriptor) throws IOException Description copied from interface:OnDiskFormatCreate a newPerSSTableIndexWriterto write the per-SSTable on-disk components of an index.- Specified by:
newPerSSTableIndexWriterin interfaceOnDiskFormat- Parameters:
indexDescriptor- TheIndexDescriptorfor the SSTable- Throws:
IOException- if the writer couldn't be created
-
newPerColumnIndexWriter
public PerColumnIndexWriter newPerColumnIndexWriter(StorageAttachedIndex index, IndexDescriptor indexDescriptor, LifecycleNewTracker tracker, RowMapping rowMapping) Description copied from interface:OnDiskFormatCreate 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- Specified by:
newPerColumnIndexWriterin interfaceOnDiskFormat- 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
Description copied from interface:OnDiskFormatReturns true if the per-sstable index components have been built and are valid.- Specified by:
isPerSSTableIndexBuildCompletein interfaceOnDiskFormat- Parameters:
indexDescriptor- TheIndexDescriptorfor the SSTable SAI index
-
isPerColumnIndexBuildComplete
public boolean isPerColumnIndexBuildComplete(IndexDescriptor indexDescriptor, IndexIdentifier indexIdentifier) Description copied from interface:OnDiskFormatReturns true if the per-column index components have been built and are valid.- Specified by:
isPerColumnIndexBuildCompletein interfaceOnDiskFormat- Parameters:
indexDescriptor- TheIndexDescriptorfor the SSTable SAI indexindexIdentifier- TheIndexIdentifierfor the index
-
validatePerSSTableIndexComponents
Description copied from interface:OnDiskFormatValidate all the per-SSTable on-disk components and throw if a component is not valid- Specified by:
validatePerSSTableIndexComponentsin interfaceOnDiskFormat- Parameters:
indexDescriptor- TheIndexDescriptorfor the SSTable SAI indexchecksum-trueif the checksum should be tested as part of the validation
-
validatePerColumnIndexComponents
public void validatePerColumnIndexComponents(IndexDescriptor indexDescriptor, IndexTermType indexTermType, IndexIdentifier indexIdentifier, boolean checksum) Description copied from interface:OnDiskFormatValidate all the per-column on-disk components and throw if a component is not valid- Specified by:
validatePerColumnIndexComponentsin interfaceOnDiskFormat- Parameters:
indexDescriptor- TheIndexDescriptorfor the SSTable SAI indexindexTermType- TheIndexTermTypeof the indexindexIdentifier- TheIndexIdentifierfor the indexchecksum-trueif the checksum should be tested as part of the validation
-
perSSTableIndexComponents
Description copied from interface:OnDiskFormatReturns 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.- Specified by:
perSSTableIndexComponentsin interfaceOnDiskFormat- Parameters:
hasClustering- true if the SSTable forms part of a table using clustering columns
-
perColumnIndexComponents
Description copied from interface:OnDiskFormatReturns 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.- Specified by:
perColumnIndexComponentsin interfaceOnDiskFormat- Parameters:
indexTermType- theIndexTermTypeof the index
-
openFilesPerSSTableIndex
public int openFilesPerSSTableIndex(boolean hasClustering) Description copied from interface:OnDiskFormatReturn 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.- Specified by:
openFilesPerSSTableIndexin interfaceOnDiskFormat- Parameters:
hasClustering- true if the SSTable forms part of a table using clustering columns
-
openFilesPerColumnIndex
public int openFilesPerColumnIndex()Description copied from interface:OnDiskFormatReturn 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.- Specified by:
openFilesPerColumnIndexin interfaceOnDiskFormat
-
isNotBuildCompletionMarker
-