Class ReplayDatabase
- All Implemented Interfaces:
Database
- Direct Known Subclasses:
WritableReplayDatabase
ClockFilters 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 TypeMethodDescriptionvoidClear the location cache for all tables.voidclearLocationCache(@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 aTableDefinitionfrom 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 aPartitionedTablefrom the Database.historicalTable(@NotNull String namespace, @NotNull String tableName, @NotNull TableOptions options) Fetch a static historicalTablefrom the database.livePartitionedTable(@NotNull String namespace, @NotNull String tableName, @NotNull TableOptions options) Retrieve the specified live table as aPartitionedTablefrom the Database.liveTable(@NotNull String namespace, @NotNull String tableName, @NotNull TableOptions options) Fetch a liveTablefor the specified namespace and table name.voiduseLocationCaches(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, waitMethods 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
InstantorZonedDateTimeto use as a timestamp source. If a table has multiple timestamps, then theReplayConfigurationImplmust define the name of the Timestamp column for that table. When launched from a Persistent Query, theReplayConfigurationImplTimestamp 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, theReplayConfigurationImplvalues 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:DatabaseFetch a liveTablefor the specified namespace and table name.- Specified by:
liveTablein interfaceDatabase- Parameters:
namespace- the Namespace in which the table existstableName- the name of the table in the Namespace.options- aTableOptionsto set table options.- Returns:
- a new live
Tablefor the specified parameters.
-
livePartitionedTable
public PartitionedTable livePartitionedTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName, @NotNull @NotNull TableOptions options) Description copied from interface:DatabaseRetrieve the specified live table as aPartitionedTablefrom the Database. The partitioned table's key columns will be its column and internal partitions.- Specified by:
livePartitionedTablein interfaceDatabase- Parameters:
namespace- the Namespace in which the table existstableName- the name of the table in the Namespace.options- aTableOptionsto set table options.- Returns:
- a new
PartitionedTablefor the specified table
-
historicalTable
public Table historicalTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName, @NotNull @NotNull TableOptions options) Description copied from interface:DatabaseFetch a static historicalTablefrom the database.- Specified by:
historicalTablein interfaceDatabase- Parameters:
namespace- the Namespace in which the table existstableName- the name of the table in the Namespace.options- aTableOptionsto set table options.- Returns:
- a new static
Tablefor the specified parameters.
-
historicalPartitionedTable
public PartitionedTable historicalPartitionedTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName, @NotNull @NotNull TableOptions options) Description copied from interface:DatabaseRetrieve the specified historical table as aPartitionedTablefrom the Database. The result'skey columnswill be derived from the table's partitioning columns as well as any internal partitions.- Specified by:
historicalPartitionedTablein interfaceDatabase- Parameters:
namespace- the Namespace in which the table existstableName- the name of the table in the Namespace.options- aTableOptionsto set table options.- Returns:
- a new
PartitionedTablefor the specified table
-
getTableDefinition
public TableDefinition getTableDefinition(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) Description copied from interface:DatabaseFetch aTableDefinitionfrom the database.- Specified by:
getTableDefinitionin interfaceDatabase- Parameters:
namespace- the Namespace in which the table existstableName- the name of the table in the Namespace.- Returns:
- the
TableDefinitionfor the specified parameters.
-
getTableDefinitionTable
public Table getTableDefinitionTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) Description copied from interface:DatabaseFetch a table's definition table from the database.- Specified by:
getTableDefinitionTablein interfaceDatabase- Parameters:
namespace- the Namespace in which the table existstableName- the name of the table in the Namespace.- Returns:
- a
Tableof the column definitions for the specified parameters.
-
getNamespaces
Description copied from interface:DatabaseGet the available namespaces.- Specified by:
getNamespacesin interfaceDatabase- Returns:
- the list of namespaces
-
getTableNames
Description copied from interface:DatabaseGet the tables within a namespace- Specified by:
getTableNamesin interfaceDatabase- Parameters:
namespace- the namespace to interrogate- Returns:
- the list of tables within namespace
-
getCatalogTable
Description copied from interface:DatabaseRetrieve a table containing the tables that exist in this database.The returned table has a column for "Namespace", "Tablename" and "NamespaceSet".
- Specified by:
getCatalogTablein interfaceDatabase- Returns:
- a table containing the tables that exist in this database.
-
clearLocationCache
public void clearLocationCache()Description copied from interface:DatabaseClear 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:
clearLocationCachein interfaceDatabase
-
clearLocationCache
public void clearLocationCache(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) Description copied from interface:DatabaseClear 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:
clearLocationCachein 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:DatabaseSet whether the database should cache the result of table location discovery and re-use them. This defaults totrue- Specified by:
useLocationCachesin interfaceDatabase- Parameters:
useCaching- if location caches should be used.
-