Package io.deephaven.enterprise.database
Interface Database
- All Known Subinterfaces:
- DatabaseInternal
- All Known Implementing Classes:
- DatabaseImpl,- ReplayDatabase,- WritableReplayDatabase
This interface presents a view of the data store for the system in both Live, and Historical versions.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringThe name of the internal partition (if applicable) forlivePartitionedTable(java.lang.String, java.lang.String)andhistoricalPartitionedTable(java.lang.String, java.lang.String).
- 
Method SummaryModifier 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 namespacedefault PartitionedTablehistoricalPartitionedTable(@NotNull String namespace, @NotNull String tableName) Retrieve the specified historical table as aPartitionedTablefrom the Database.historicalPartitionedTable(@NotNull String namespace, @NotNull String tableName, @NotNull TableOptions options) Retrieve the specified historical table as aPartitionedTablefrom the Database.default TablehistoricalTable(@NotNull String namespace, @NotNull String tableName) Fetch a static historicalTablefrom the database.historicalTable(@NotNull String namespace, @NotNull String tableName, @NotNull TableOptions options) Fetch a static historicalTablefrom the database.default PartitionedTablelivePartitionedTable(@NotNull String namespace, @NotNull String tableName) Retrieve the specified live table as aPartitionedTablefrom the Database.livePartitionedTable(@NotNull String namespace, @NotNull String tableName, @NotNull TableOptions options) Retrieve the specified live table as aPartitionedTablefrom the Database.default TableFetch a liveTablefor the specified namespace and table name.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.
- 
Field Details- 
PARTITIONED_TABLE_INTERNAL_PARTITION_COLUMNThe name of the internal partition (if applicable) forlivePartitionedTable(java.lang.String, java.lang.String)andhistoricalPartitionedTable(java.lang.String, java.lang.String).- See Also:
 
 
- 
- 
Method Details- 
liveTable@ScriptApi @FinalDefault default Table liveTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) Fetch a liveTablefor the specified namespace and table name.- Parameters:
- namespace- the Namespace in which the table exists
- tableName- the name of the table in the Namespace.
- Returns:
- a new live Tablefor the specified parameters.
 
- 
liveTable@ScriptApi Table liveTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName, @NotNull @NotNull TableOptions options) Fetch a liveTablefor the specified namespace and table name.- Parameters:
- namespace- the Namespace in which the table exists
- tableName- the name of the table in the Namespace.
- options- a- TableOptionsto set table options.
- Returns:
- a new live Tablefor the specified parameters.
 
- 
livePartitionedTable@ScriptApi @FinalDefault default PartitionedTable livePartitionedTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) Retrieve the specified live table as aPartitionedTablefrom the Database. The partitioned table's key columns will be its column and internal partitions.- Parameters:
- namespace- the Namespace in which the table exists
- tableName- the name of the table in the Namespace.
- Returns:
- a new PartitionedTablefor the specified table
 
- 
livePartitionedTable@ScriptApi PartitionedTable livePartitionedTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName, @NotNull @NotNull TableOptions options) Retrieve the specified live table as aPartitionedTablefrom the Database. The partitioned table's key columns will be its column and internal partitions.- Parameters:
- namespace- the Namespace in which the table exists
- tableName- the name of the table in the Namespace.
- options- a- TableOptionsto set table options.
- Returns:
- a new PartitionedTablefor the specified table
 
- 
historicalTable@ScriptApi @FinalDefault default Table historicalTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) Fetch a static historicalTablefrom the database.- Parameters:
- namespace- the Namespace in which the table exists
- tableName- the name of the table in the Namespace.
- Returns:
- a new static Tablefor the specified parameters.
 
- 
historicalTable@ScriptApi Table historicalTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName, @NotNull @NotNull TableOptions options) Fetch a static historicalTablefrom the database.- Parameters:
- namespace- the Namespace in which the table exists
- tableName- the name of the table in the Namespace.
- options- a- TableOptionsto set table options.
- Returns:
- a new static Tablefor the specified parameters.
 
- 
historicalPartitionedTable@ScriptApi @FinalDefault default PartitionedTable historicalPartitionedTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) Retrieve 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.- Parameters:
- namespace- the Namespace in which the table exists
- tableName- the name of the table in the Namespace.
- Returns:
- a new PartitionedTablefor the specified table
 
- 
historicalPartitionedTable@ScriptApi PartitionedTable historicalPartitionedTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName, @NotNull @NotNull TableOptions options) Retrieve 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.- Parameters:
- namespace- the Namespace in which the table exists
- tableName- the name of the table in the Namespace.
- options- a- TableOptionsto set table options.
- Returns:
- a new PartitionedTablefor the specified table
 
- 
getTableDefinition@ScriptApi TableDefinition getTableDefinition(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) Fetch aTableDefinitionfrom the database.- Parameters:
- namespace- the Namespace in which the table exists
- tableName- the name of the table in the Namespace.
- Returns:
- the TableDefinitionfor the specified parameters.
 
- 
getTableDefinitionTable@ScriptApi Table getTableDefinitionTable(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) Fetch a table's definition table from the database.- Parameters:
- namespace- the Namespace in which the table exists
- tableName- the name of the table in the Namespace.
- Returns:
- a Tableof the column definitions for the specified parameters.
 
- 
getNamespacesGet the available namespaces.- Returns:
- the list of namespaces
 
- 
getTableNamesGet the tables within a namespace- Parameters:
- namespace- the namespace to interrogate
- Returns:
- the list of tables within namespace
 
- 
getCatalogTableRetrieve a table containing the tables that exist in this database.The returned table has a column for "Namespace", "Tablename" and "NamespaceSet". - Returns:
- a table containing the tables that exist in this database.
 
- 
clearLocationCacheClear 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 historicalTable(String, String),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 useLocationCaches(boolean)
- 
clearLocationCache@ScriptApi void clearLocationCache(@NotNull @NotNull String namespace, @NotNull @NotNull String tableName) 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 historicalTable(String, String),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 useLocationCaches(boolean)- Parameters:
- namespace- namespace of table to clear cache
- tableName- table name of table to clear cache
 
- 
useLocationCachesSet whether the database should cache the result of table location discovery and re-use them. This defaults totrue- Parameters:
- useCaching- if location caches should be used.
 
 
-