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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.engine.table.impl.locations.TableLocation
TableLocation.Listener
-
Field Summary
Fields inherited from class io.deephaven.engine.table.impl.locations.impl.SubscriptionAggregator
subscriptions
Fields inherited from interface io.deephaven.engine.table.impl.locations.TableLocationState
NULL_SIZE, NULL_TIME
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractTableLocation
(@NotNull TableKey tableKey, @NotNull TableLocationKey tableLocationKey, boolean supportsSubscriptions) -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
Clear all column locations (usually because a truncated location was observed).protected final void
deliverInitialSnapshot
(@NotNull TableLocation.Listener listener) Prompt listeners to record current state, under the subscriptions lock.final @NotNull ColumnLocation
getColumnLocation
(@NotNull CharSequence name) final @Nullable BasicDataIndex
getDataIndex
(@NotNull String... columns) Get the data index table for the specified set of columns.final @NotNull ImmutableTableLocationKey
getKey()
final long
final RowSet
final long
getSize()
final @NotNull Object
final @NotNull ImmutableTableKey
void
handleUpdate
(@NotNull TableLocationState source) Update all state fields from source's values, as inhandleUpdate(RowSet, long)
.final void
handleUpdate
(RowSet rowSet, long lastModifiedTimeMillis) See TableLocationState for documentation of values.abstract @Nullable BasicDataIndex
loadDataIndex
(@NotNull String... columns) Load the data index from the location implementation.protected abstract @NotNull ColumnLocation
makeColumnLocation
(@NotNull String name) final String
toString()
Methods inherited from class io.deephaven.engine.table.impl.locations.impl.SubscriptionAggregator
activateUnderlyingDataSource, activationFailed, activationSuccessful, checkHasSubscribers, deactivateUnderlyingDataSource, matchSubscriptionToken, postActivationHook, subscribe, supportsSubscriptions, unsubscribe
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.deephaven.util.type.NamedImplementation
getImplementationName
Methods inherited from interface io.deephaven.engine.table.impl.locations.TableLocation
append, getDataIndexColumns, getSortedColumns, hasDataIndex, refresh, subscribe, supportsSubscriptions, toGenericString, toStringDetailed, toStringHelper, unsubscribe
Methods inherited from interface io.deephaven.engine.table.impl.locations.TableLocationState
copyStateValuesTo
-
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 totableLocationKey
- Table location key that identifies this locationsupportsSubscriptions
- Whether subscriptions are to be supported
-
-
Method Details
-
toString
-
getStateLock
- Specified by:
getStateLock
in interfaceTableLocationState
- Returns:
- The Object that accessors should synchronize on if they want to invoke multiple getters with consistent results.
-
getRowSet
- Specified by:
getRowSet
in interfaceTableLocationState
- Returns:
- The (possibly-empty)
RowSet
of a table location, ornull
if RowSet information is unknown or does not exist for this table location.
-
getSize
public final long getSize()- Specified by:
getSize
in interfaceTableLocationState
- 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 interfaceTableLocationState
- 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
- Specified by:
getTableKey
in interfaceTableLocation
- Returns:
- An
ImmutableTableKey
instance for the enclosing table
-
getKey
- Specified by:
getKey
in interfaceTableLocation
- Returns:
- An
ImmutableTableLocationKey
instance for this location
-
deliverInitialSnapshot
Description copied from class:SubscriptionAggregator
Prompt listeners to record current state, under the subscriptions lock.- Specified by:
deliverInitialSnapshot
in classSubscriptionAggregator<TableLocation.Listener>
- Parameters:
listener
- The listener to notify
-
handleUpdate
See TableLocationState for documentation of values.- Parameters:
rowSet
- The new RowSet. Ownership passes to this location; callers shouldcopy
it if necessary.lastModifiedTimeMillis
- The new lastModificationTimeMillis
-
handleUpdate
Update all state fields from source's values, as inhandleUpdate(RowSet, long)
. SeeTableLocationState
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 interfaceTableLocation
- 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
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 interfaceTableLocation
- 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.
-