Class ReplayDatabase
- All Implemented Interfaces:
Database
- Direct Known Subclasses:
WritableReplayDatabase
ClockFilter
s to liveTables before
returning them to the user. This can be used to operate a persistent query as if it were running from a prior day's
data for debugging, performance testing, or demos.-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface io.deephaven.enterprise.database.Database
PARTITIONED_TABLE_INTERNAL_PARTITION_COLUMN
-
Constructor Summary
ConstructorsConstructorDescriptionReplayDatabase
(@NotNull Clock replayClock, @NotNull Database wrapped, io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.databases.ReplaySettings replaySettings, @NotNull ReplayConfiguration replayConfiguration) Create a new ReplayDatabase that wraps an underlying database. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear the location cache for all tables.void
clearLocationCache
(@NotNull String namespace, @NotNull String tableName) Clear the location cache for the specified table.Retrieve a table containing the tables that exist in this database.Get the available namespaces.getTableDefinition
(@NotNull String namespace, @NotNull String tableName) Fetch aTableDefinition
from the database.getTableDefinitionTable
(@NotNull String namespace, @NotNull String tableName) Fetch a table's definition table from the database.getTableNames
(String namespace) Get the tables within a namespacehistoricalPartitionedTable
(@NotNull String namespace, @NotNull String tableName, @NotNull TableOptions options) Retrieve the specified historical table as aPartitionedTable
from the Database.historicalTable
(@NotNull String namespace, @NotNull String tableName, @NotNull TableOptions options) Fetch a static historicalTable
from the database.livePartitionedTable
(@NotNull String namespace, @NotNull String tableName, @NotNull TableOptions options) Retrieve the specified live table as aPartitionedTable
from the Database.liveTable
(@NotNull String namespace, @NotNull String tableName, @NotNull TableOptions options) Fetch a liveTable
for the specified namespace and table name.void
useLocationCaches
(boolean useCaching) Set whether the database should cache the result of table location discovery and re-use them.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.deephaven.enterprise.database.Database
historicalPartitionedTable, historicalTable, livePartitionedTable, liveTable
-
Constructor Details
-
ReplayDatabase
public ReplayDatabase(@NotNull @NotNull Clock replayClock, @NotNull @NotNull Database wrapped, @NotNull io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.databases.ReplaySettings replaySettings, @NotNull @NotNull ReplayConfiguration replayConfiguration) Create a new ReplayDatabase that wraps an underlying database.The
Database.liveTable(String, String, TableOptions)
andDatabase.livePartitionedTable(String, String, TableOptions)
are wrapped to present existing data as ticking data. TheDatabase.historicalTable(String, String)
family of methods are not changed.Tables must have a column of type
Instant
orZonedDateTime
to use as a timestamp source. If a table has multiple timestamps, then theReplayConfigurationImpl
must define the name of the Timestamp column for that table. When launched from a Persistent Query, theReplayConfigurationImpl
Timestamp columns are derived from properties of the form (in descending priority):- ReplayDatabase.TimestampColumn.Namespace.TableName
- ReplayDatabase.TimestampColumn.Namespace
- ReplayDatabase.TimestampColumn
All historical tables are read from the historical store, for a live table the default is to read the historical store and replay the historical table. Alternatively, live tables can read from live tables on the replay date based on the
ReplayConfigurationImpl
. When launched from a Persistent Query, theReplayConfigurationImpl
values are derived from properties of the form (in descending priority):- ReplayDatabase.UseIntraday.Namespace.TableName
- ReplayDatabase.UseIntraday.Namespace
- ReplayDatabase.UseIntraday
- Parameters:
replayClock
- the clock for replaying datawrapped
- the Database to wrapreplaySettings
- the replay settings from the persistent queryreplayConfiguration
- the per-table replay configuration
-
-
Method Details
-
liveTable
public Table liveTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName, @NotNull @NotNull TableOptions options) Description copied from interface:Database
Fetch a liveTable
for the specified namespace and table name.- Specified by:
liveTable
in interfaceDatabase
- Parameters:
namespace
- the Namespace in which the table existstableName
- the name of the table in the Namespace.options
- aTableOptions
to set table options.- Returns:
- a new live
Table
for the specified parameters.
-
livePartitionedTable
public PartitionedTable livePartitionedTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName, @NotNull @NotNull TableOptions options) Description copied from interface:Database
Retrieve the specified live table as aPartitionedTable
from the Database. The partitioned table's key columns will be its column and internal partitions.- Specified by:
livePartitionedTable
in interfaceDatabase
- Parameters:
namespace
- the Namespace in which the table existstableName
- the name of the table in the Namespace.options
- aTableOptions
to set table options.- Returns:
- a new
PartitionedTable
for the specified table
-
historicalTable
public Table historicalTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName, @NotNull @NotNull TableOptions options) Description copied from interface:Database
Fetch a static historicalTable
from the database.- Specified by:
historicalTable
in interfaceDatabase
- Parameters:
namespace
- the Namespace in which the table existstableName
- the name of the table in the Namespace.options
- aTableOptions
to set table options.- Returns:
- a new static
Table
for the specified parameters.
-
historicalPartitionedTable
public PartitionedTable historicalPartitionedTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName, @NotNull @NotNull TableOptions options) Description copied from interface:Database
Retrieve the specified historical table as aPartitionedTable
from the Database. The partitioned table's key columns will be its column and internal partitions.- Specified by:
historicalPartitionedTable
in interfaceDatabase
- Parameters:
namespace
- the Namespace in which the table existstableName
- the name of the table in the Namespace.options
- aTableOptions
to set table options.- Returns:
- a new
PartitionedTable
for the specified table
-
getTableDefinition
public TableDefinition getTableDefinition(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) Description copied from interface:Database
Fetch aTableDefinition
from the database.- Specified by:
getTableDefinition
in interfaceDatabase
- Parameters:
namespace
- the Namespace in which the table existstableName
- the name of the table in the Namespace.- Returns:
- the
TableDefinition
for the specified parameters.
-
getTableDefinitionTable
public Table getTableDefinitionTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) Description copied from interface:Database
Fetch a table's definition table from the database.- Specified by:
getTableDefinitionTable
in interfaceDatabase
- Parameters:
namespace
- the Namespace in which the table existstableName
- the name of the table in the Namespace.- Returns:
- a
Table
of the column definitions for the specified parameters.
-
getNamespaces
Description copied from interface:Database
Get the available namespaces.- Specified by:
getNamespaces
in interfaceDatabase
- Returns:
- the list of namespaces
-
getTableNames
Description copied from interface:Database
Get the tables within a namespace- Specified by:
getTableNames
in interfaceDatabase
- Parameters:
namespace
- the namespace to interrogate- Returns:
- the list of tables within namespace
-
getCatalogTable
Description copied from interface:Database
Retrieve a table containing the tables that exist in this database.The returned table has a column for "Namespace", "Tablename" and "NamespaceSet".
- Specified by:
getCatalogTable
in interfaceDatabase
- Returns:
- a table containing the tables that exist in this database.
-
clearLocationCache
public void clearLocationCache()Description copied from interface:Database
Clear the location cache for all tables. Use this method when some data has been replaced for a table to refresh the location cache and read the replaced data.Subsequent calls to
Database.historicalTable(String, String)
,Database.liveTable(String, String)
and their variants for all tables will repeat location discovery, which can have significant negative performance consequences.Note that you may also disable caching entirely using
Database.useLocationCaches(boolean)
- Specified by:
clearLocationCache
in interfaceDatabase
-
clearLocationCache
public void clearLocationCache(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) Description copied from interface:Database
Clear the location cache for the specified table. Use this method when some data has been replaced for a table to refresh the location cache and read the replaced data.Subsequent calls to
Database.historicalTable(String, String)
,Database.liveTable(String, String)
and their variants for this table will repeat location discovery, which can have significant negative performance consequencesNote that you may also disable caching entirely using
Database.useLocationCaches(boolean)
- Specified by:
clearLocationCache
in interfaceDatabase
- Parameters:
namespace
- namespace of table to clear cachetableName
- table name of table to clear cache
-
useLocationCaches
public void useLocationCaches(boolean useCaching) Description copied from interface:Database
Set whether the database should cache the result of table location discovery and re-use them. This defaults totrue
- Specified by:
useLocationCaches
in interfaceDatabase
- Parameters:
useCaching
- if location caches should be used.
-