Interface TableLocationState

All Known Subinterfaces:
DeephavenFormatTableLocation, IWritableLocalTableLocation, ParquetFormatTableLocation, TableLocation
All Known Implementing Classes:
AbstractTableLocation, CheckpointRecord, DeferredTableLocation, DeferredTableLocation.DataDriven, DeferredTableLocation.SnapshotDriven, LocalTableLocation, ReadOnlyLocalTableLocation, ReadOnlyParquetTableLocation, RemoteTableLocationImpl, TableLocationStateHolder, WritableLocalTableLocation

public interface TableLocationState
Interface for the mutable fields of a table location. Supports multi-value copy methods, so that applications needing a consistent view of all fields can work with a local copy while only locking this object for a short while.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
     
    static final long
     
    static final long
    Another magic value, like NULL_SIZE, but indicating that the location is gone and providers should forget about it.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Copy all state values from this to the supplied holder.
    long
     
    long
     
    default String
    Convert the magic values to readable strings, for logging.
     
    static boolean
    isNonEmptySize(long size)
    Convenience method to check that a size is both non-zero and not a sentinel value.
    static boolean
    isNullSize(long size)
    Convenience method to check a size against all special values representing sentinel values.
    default void
    Write all state values from this to the supplied output.
  • Field Details

    • NULL_SIZE

      static final long NULL_SIZE
      See Also:
    • REMOVE_SIZE

      static final long REMOVE_SIZE
      Another magic value, like NULL_SIZE, but indicating that the location is gone and providers should forget about it. This should never be persisted.
      See Also:
    • NULL_TIME

      static final long NULL_TIME
      See Also:
  • Method Details

    • isNullSize

      static boolean isNullSize(long size)
      Convenience method to check a size against all special values representing sentinel values.
      Parameters:
      size - the size to check
      Returns:
      true if the size is a special value (currently NULL_SIZE and REMOVE_SIZE)
    • isNonEmptySize

      static boolean isNonEmptySize(long size)
      Convenience method to check that a size is both non-zero and not a sentinel value.
      Parameters:
      size - the size to check
      Returns:
      true if the size is positive and not a special value (currently NULL_SIZE and REMOVE_SIZE)
    • getStateLock

      @NotNull Object getStateLock()
      Returns:
      The Object that accessors should synchronize on if they want to invoke multiple getters with consistent results.
    • getSize

      long getSize()
      Returns:
      The size of a table location:
      NULL_SIZE : Size information is unknown or does not exist for this table location
      >= 0 : The table location exists and has (possibly empty) data
    • getSizeStr

      default String getSizeStr()
      Convert the magic values to readable strings, for logging.
      Returns:
      the size as a string, or NULL_SIZE or REMOVE_SIZE if appropriate
    • getLastModifiedTimeMillis

      long getLastModifiedTimeMillis()
      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 table location
      >= 0L : The time this table was last modified, in milliseconds from the UTC epoch
    • copyStateValuesTo

      @FinalDefault default boolean copyStateValuesTo(@NotNull TableLocationStateHolder destinationHolder)
      Copy all state values from this to the supplied holder.
      Parameters:
      destinationHolder - The destination for output
      Returns:
      Whether any of destinationHolder's values changed
    • writeStateValuesTo

      @FinalDefault default void writeStateValuesTo(@NotNull DataOutput output) throws IOException
      Write all state values from this to the supplied output.
      Parameters:
      output - The output for output
      Throws:
      IOException