Class AbstractTableLocation

java.lang.Object
io.deephaven.engine.table.impl.locations.impl.SubscriptionAggregator<TableLocation.Listener>
io.deephaven.engine.table.impl.locations.impl.AbstractTableLocation
All Implemented Interfaces:
LogOutputAppendable, TableLocation, TableLocationState, NamedImplementation
Direct Known Subclasses:
NonexistentTableLocation, ParquetTableLocation

public abstract class AbstractTableLocation extends SubscriptionAggregator<TableLocation.Listener> implements TableLocation
Partial TableLocation implementation for use by TableDataService implementations.
  • Constructor Details

    • AbstractTableLocation

      protected AbstractTableLocation(@NotNull @NotNull TableKey tableKey, @NotNull @NotNull TableLocationKey tableLocationKey, boolean supportsSubscriptions)
      Parameters:
      tableKey - Table key for the table this location belongs to
      tableLocationKey - Table location key that identifies this location
      supportsSubscriptions - Whether subscriptions are to be supported
  • Method Details

    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • getStateLock

      @NotNull public final @NotNull Object getStateLock()
      Specified by:
      getStateLock in interface TableLocationState
      Returns:
      The Object that accessors should synchronize on if they want to invoke multiple getters with consistent results.
    • getRowSet

      public final RowSet getRowSet()
      Specified by:
      getRowSet in interface TableLocationState
      Returns:
      The (possibly-empty) RowSet of a table location, or null if RowSet information is unknown or does not exist for this table location.
    • getSize

      public final long getSize()
      Specified by:
      getSize in interface TableLocationState
      Returns:
      The size of a table location:
      NULL_SIZE: Size information is unknown or does not exist for this location
      >= 0: The table location exists and has (possibly empty) data
    • getLastModifiedTimeMillis

      public final long getLastModifiedTimeMillis()
      Specified by:
      getLastModifiedTimeMillis in interface TableLocationState
      Returns:
      The last modified time for a table location, in milliseconds from the epoch:
      NULL_TIME: Modification time information is unknown or does not exist for this location
      >= 0: The time this table was last modified, in milliseconds from the UTC epoch
    • getTableKey

      @NotNull public final @NotNull ImmutableTableKey getTableKey()
      Specified by:
      getTableKey in interface TableLocation
      Returns:
      An ImmutableTableKey instance for the enclosing table
    • getKey

      @NotNull public final @NotNull ImmutableTableLocationKey getKey()
      Specified by:
      getKey in interface TableLocation
      Returns:
      An ImmutableTableLocationKey instance for this location
    • deliverInitialSnapshot

      protected final void deliverInitialSnapshot(@NotNull @NotNull TableLocation.Listener listener)
      Description copied from class: SubscriptionAggregator
      Prompt listeners to record current state, under the subscriptions lock.
      Specified by:
      deliverInitialSnapshot in class SubscriptionAggregator<TableLocation.Listener>
      Parameters:
      listener - The listener to notify
    • handleUpdate

      public final void handleUpdate(RowSet rowSet, long lastModifiedTimeMillis)
      See TableLocationState for documentation of values.
      Parameters:
      rowSet - The new RowSet. Ownership passes to this location; callers should copy it if necessary.
      lastModifiedTimeMillis - The new lastModificationTimeMillis
    • handleUpdate

      public void handleUpdate(@NotNull @NotNull TableLocationState source)
      Update all state fields from source's values, as in handleUpdate(RowSet, long). See TableLocationState for documentation of values.
      Parameters:
      source - The source to copy state values from
    • getColumnLocation

      @NotNull public final @NotNull ColumnLocation getColumnLocation(@NotNull @NotNull CharSequence name)
      Specified by:
      getColumnLocation in interface TableLocation
      Parameters:
      name - The column name
      Returns:
      The ColumnLocation for the defined column under this table location
    • makeColumnLocation

      @NotNull protected abstract @NotNull ColumnLocation makeColumnLocation(@NotNull @NotNull String name)
    • clearColumnLocations

      protected final void clearColumnLocations()
      Clear all column locations (usually because a truncated location was observed).
    • getDataIndex

      @Nullable public final @Nullable BasicDataIndex getDataIndex(@NotNull @NotNull String... columns)
      Description copied from interface: TableLocation
      Get the data index table for the specified set of columns. Note that the order of columns does not matter here.
      Specified by:
      getDataIndex in interface TableLocation
      Parameters:
      columns - The key columns for the index
      Returns:
      The index table or null if one does not exist
    • loadDataIndex

      @InternalUseOnly @Nullable public abstract @Nullable BasicDataIndex loadDataIndex(@NotNull @NotNull String... columns)
      Load the data index from the location implementation. Implementations of this method should not perform any result caching.
      Parameters:
      columns - The columns to load an index for
      Returns:
      The data index, or null if none exists
      ApiNote:
      This method is public for use in delegating implementations, and should not be called directly otherwise.