Class AbstractDataIndex

All Implemented Interfaces:
LogOutputAppendable, LivenessManager, LivenessNode, LivenessReferent, BasicDataIndex, DataIndex, Serializable
Direct Known Subclasses:
RemappedDataIndex, TableBackedDataIndex

public abstract class AbstractDataIndex extends LivenessArtifact implements DataIndex
Abstract base implementation of DataIndex that provides common functionality.
See Also:
  • Field Details

  • Constructor Details

    • AbstractDataIndex

      public AbstractDataIndex()
  • Method Details

    • rowSetColumnName

      @NotNull public final @NotNull String rowSetColumnName()
      Description copied from interface: BasicDataIndex
      Get the RowSet column name for the index table.
      Specified by:
      rowSetColumnName in interface BasicDataIndex
      Returns:
      The RowSet column name
    • transform

      @NotNull public final @NotNull BasicDataIndex transform(@NotNull @NotNull DataIndexTransformer transformer)
      Description copied from interface: DataIndex
      Transform and return a new BasicDataIndex with the provided transform operations applied. Some transformations will force the result to be a static snapshot even when this DataIndex is refreshing.
      Specified by:
      transform in interface DataIndex
      Parameters:
      transformer - The DataIndexTransformer specifying the desired transformations
      Returns:
      The transformed BasicDataIndex
    • remapKeyColumns

      @NotNull public final @NotNull DataIndex remapKeyColumns(@NotNull @NotNull Map<ColumnSource<?>,ColumnSource<?>> oldToNewColumnMap)
      Description copied from interface: DataIndex
      Create a new DataIndex using the same index BasicDataIndex.table(), with the indexed columns in BasicDataIndex.keyColumnNamesByIndexedColumn() remapped according to oldToNewColumnMap. This is used when it is known that an operation has produced new columns that are equivalent to the old indexed columns. The result index may keep this index reachable and live for its own lifetime, if necessary.
      Specified by:
      remapKeyColumns in interface DataIndex
      Parameters:
      oldToNewColumnMap - Map from the old indexed ColumnSources to the new indexed ColumnSources
      Returns:
      The remapped DataIndex
    • isValid

      public abstract boolean isValid()
      Whether this AbstractDataIndex is potentially usable. This will return true when there are no known issues for this data index. This performs fast checks, such as verifying all locations have index table files, but does not fully guarantee that the index is complete and loadable.
      Returns:
      true If the AbstractDataIndex is potentially usable, false otherwise
    • indexTableWrapper

      protected static QueryTable indexTableWrapper(@NotNull @NotNull QueryTable parent, @NotNull @NotNull String rowSetColumn)
      Return a copy of parent with the RowSet column replaced with a wrapper column that adds prev calls on access to previous values.
      Parameters:
      parent - The Table to copy
      rowSetColumn - The name of the RowSet column to wrap
      Returns:
      The copied Table
    • indexTableWrapper

      protected static QueryTable indexTableWrapper(@NotNull @NotNull QueryTable parent, @NotNull @NotNull String rowSetColumn, @NotNull @NotNull String renamedRowSetColumn)
      Return a copy of parent with the RowSet column replaced with a wrapper column that adds prev calls on access to previous values.
      Parameters:
      parent - The Table to copy
      rowSetColumn - The name of the RowSet column to wrap
      renamedRowSetColumn - The name of the RowSet column in the output Table
      Returns:
      The copied Table