Interface TableLocation
- All Superinterfaces:
LivenessReferent
,LogOutputAppendable
,NamedImplementation
,TableLocationState
- All Known Implementing Classes:
AbstractTableLocation
,NonexistentTableLocation
,ParquetTableLocation
,PythonTableDataService.TableLocationImpl
public interface TableLocation
extends NamedImplementation, LogOutputAppendable, TableLocationState, LivenessReferent
Building block for Deephaven "source" tables, with helper methods for discovering locations and their sizes. A
location allows access to columns, size, and possibly other metadata for a single partition that may be included in a
source table.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Listener interface for anything that wants to know about changes to a location. -
Field Summary
Fields inherited from interface io.deephaven.engine.table.impl.locations.TableLocationState
NULL_SIZE, NULL_TIME
-
Method Summary
Modifier and TypeMethodDescriptiondefault LogOutput
@NotNull ColumnLocation
getColumnLocation
(@NotNull CharSequence name) @Nullable BasicDataIndex
getDataIndex
(@NotNull String... columns) Get the data index table for the specified set of columns.Get a list of the columns by which this location is indexed@NotNull ImmutableTableLocationKey
getKey()
@NotNull List<SortColumn>
Get an ordered list of columns this location is sorted by.@NotNull ImmutableTableKey
boolean
hasDataIndex
(@NotNull String... columns) Check if this TableLocation has a data index for the specified columns.void
refresh()
Initialize or run state information.void
subscribe
(@NotNull TableLocation.Listener listener) Subscribe to pushed location updates.boolean
Does this location support subscriptions? That is, can this location ever have ticking data?default String
Format the table key without implementation specific bits.default String
Optional toString path with more implementation detail.default String
void
unsubscribe
(@NotNull TableLocation.Listener listener) Unsubscribe from pushed location updates.Methods inherited from interface io.deephaven.engine.liveness.LivenessReferent
dropReference, getReferentDescription, getWeakReference, retainReference, tryRetainReference
Methods inherited from interface io.deephaven.util.type.NamedImplementation
getImplementationName
Methods inherited from interface io.deephaven.engine.table.impl.locations.TableLocationState
copyStateValuesTo, getLastModifiedTimeMillis, getRowSet, getSize, getStateLock
-
Method Details
-
getTableKey
- Returns:
- An
ImmutableTableKey
instance for the enclosing table
-
getKey
- Returns:
- An
ImmutableTableLocationKey
instance for this location
-
supportsSubscriptions
boolean supportsSubscriptions()Does this location support subscriptions? That is, can this location ever have ticking data?- Returns:
- True if this location supports subscriptions
-
subscribe
Subscribe to pushed location updates. Subscribing more than once with the same listener without an intervening unsubscribe is an error, and may result in undefined behavior.
This is a possibly asynchronous operation - listener will receive 1 or more handleUpdate callbacks, followed by 0 or 1 handleException callbacks during invocation and continuing after completion, on a thread determined by the implementation. Don't hold a lock that prevents notification delivery while subscribing!
This method only guarantees eventually consistent state. To force a state update, use refresh() after subscription completes.
- Parameters:
listener
- A listener
-
unsubscribe
Unsubscribe from pushed location updates.- Parameters:
listener
- The listener to forget about
-
refresh
void refresh()Initialize or run state information. -
getSortedColumns
Get an ordered list of columns this location is sorted by.- Returns:
- A non-null ordered list of
SortColumns
-
getDataIndexColumns
Get a list of the columns by which this location is indexed- Returns:
- A non-null list of
String[]
arrays containing the key column names for each existing index
-
hasDataIndex
Check if this TableLocation has a data index for the specified columns.- Parameters:
columns
- The set of columns to check for- Returns:
- Whether the TableLocation has an index for the specified columns
- ApiNote:
- Implementations must guarantee that the result of this method remains constant over the life of an
instance, and is consistent with the result of
getDataIndex(String...)
.
-
getDataIndex
Get the data index table for the specified set of columns. Note that the order of columns does not matter here.- Parameters:
columns
- The key columns for the index- Returns:
- The index table or null if one does not exist
- ApiNote:
- If this TableLocation is not static, the returned table must be
refreshing
, and should be updated to reflect changes in a manner that is consistent with the results provided to a subscriber. - ImplNote:
- Implementations should attempt to provide a lazily-coalesced result wherever possible, allowing work to be deferred or parallelized.
-
getColumnLocation
- Parameters:
name
- The column name- Returns:
- The ColumnLocation for the defined column under this table location
-
append
- Specified by:
append
in interfaceLogOutputAppendable
-
toStringHelper
-
toGenericString
Format the table key without implementation specific bits.- Returns:
- a formatted string
-
toStringDetailed
Optional toString path with more implementation detail.- Returns:
- detailed conversion to string
-