Class TOCComponent

java.lang.Object
org.apache.cassandra.io.sstable.format.TOCComponent

public class TOCComponent extends Object
  • Constructor Details

    • TOCComponent

      public TOCComponent()
  • Method Details

    • loadTOC

      public static Set<Component> loadTOC(Descriptor descriptor) throws IOException
      Reads the list of components from the TOC component.
      Returns:
      set of components found in the TOC
      Throws:
      IOException
    • loadTOC

      public static Set<Component> loadTOC(Descriptor descriptor, boolean skipMissing) throws IOException
      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

      public static void updateTOC(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.
      Parameters:
      descriptor - the SSTable descriptor for which to update the TOC
      components - 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

      public static Set<Component> loadOrCreate(Descriptor descriptor)
      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 erroneous
      FSWriteError - when creating of a new TOC file is erroneous
    • rewriteTOC

      public static void rewriteTOC(Descriptor descriptor, Collection<Component> components)
      Rewrites the TOC component by deleting and recreating it only with provided component names.