Class TOCComponent
java.lang.Object
org.apache.cassandra.io.sstable.format.TOCComponent
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionloadOrCreate(Descriptor descriptor) Loads existing TOC file or creates a new one.loadTOC(Descriptor descriptor) Reads the list of components from the TOC component.loadTOC(Descriptor descriptor, boolean skipMissing) Reads the list of components from the TOC component.static voidrewriteTOC(Descriptor descriptor, Collection<Component> components) Rewrites the TOC component by deleting and recreating it only with provided component names.static voidupdateTOC(Descriptor descriptor, Collection<Component> components) Updates the TOC file by reading existing component entries, merging them with the given components, sorting the combined list in lexicographic order for deterministic output.
-
Constructor Details
-
TOCComponent
public TOCComponent()
-
-
Method Details
-
loadTOC
Reads the list of components from the TOC component.- Returns:
- set of components found in the TOC
- Throws:
IOException
-
loadTOC
Reads the list of components from the TOC component.- Parameters:
skipMissing- skip adding the component to the returned set if the corresponding file is missing.- Returns:
- set of components found in the TOC
- Throws:
IOException
-
updateTOC
Updates the TOC file by reading existing component entries, merging them with the given components, sorting the combined list in lexicographic order for deterministic output.- Parameters:
descriptor- the SSTable descriptor for which to update the TOCcomponents- new components to merge into the TOC (existing TOC entries are preserved)- Throws:
FSWriteError- if an I/O error occurs when creating or overwriting the TOC file
-
loadOrCreate
Loads existing TOC file or creates a new one.- Parameters:
descriptor- descriptor to load TOC for- Returns:
- set of loaded or discovered components
- Throws:
IOError- when loading of a component is erroneousFSWriteError- when creating of a new TOC file is erroneous
-
rewriteTOC
Rewrites the TOC component by deleting and recreating it only with provided component names.
-