Class ColumnCompletionMarkerUtil

java.lang.Object
org.apache.cassandra.index.sai.disk.v1.ColumnCompletionMarkerUtil

public class ColumnCompletionMarkerUtil extends Object
Utility class for creating and reading the column completion marker, IndexComponent.COLUMN_COMPLETION_MARKER.

The file has a header and a footer, as written by SAICodecUtils.writeHeader(IndexOutput) and SAICodecUtils.writeFooter(IndexOutput). The only content of the file is a single byte indicating whether the column index is empty or not. If the index is empty the completion marker will be the only per-index component.
  • Constructor Details

    • ColumnCompletionMarkerUtil

      public ColumnCompletionMarkerUtil()
  • Method Details

    • create

      public static void create(IndexDescriptor descriptor, IndexIdentifier indexIdentifier, boolean isEmpty) throws IOException
      Creates a column index completion marker for the specified column index, storing in it whether the index is empty.
      Parameters:
      descriptor - the index descriptor
      indexIdentifier - the column index identifier
      isEmpty - whether the index is empty
      Throws:
      IOException
    • isEmptyIndex

      public static boolean isEmptyIndex(IndexDescriptor descriptor, IndexIdentifier indexIdentifier) throws IOException
      Reads the column index completion marker and returns whether if the index is empty.
      Parameters:
      descriptor - the index descriptor
      indexIdentifier - the column index identifier
      Returns:
      true if the index is empty, false otherwise.
      Throws:
      IOException