Class DatabaseWrapper
- All Implemented Interfaces:
Database
- Direct Known Subclasses:
ReplayDatabase
public class DatabaseWrapper extends BaseDatabase
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.tables.databases.Database
Database.LogHandle, Database.StorageFormat
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DatabaseWrapper(Database database)
-
Method Summary
Modifier and Type Method Description void
addTable(String namespace, String tableName, Table table, Database.StorageFormat storageFormat)
Adds a non-partitioned table by name to the specified namespace.void
addTableDefinition(String namespace, String tableName, TableDefinition tableDefinition)
Adds a table definition to the specified namespace.void
addTablePartition(String namespace, String tableName, String internalPartitionValue, String columnPartitionValue, Table data, Database.StorageFormat storageFormat)
Adds a single table partition (e.g.void
appendCentral(String namespace, String tableName, Table table, boolean flush)
Append to a table via a centralized table appender.void
appendCentral(String namespace, String tableName, String columnPartitionValue, Table table, boolean flush)
Append to a table via a centralized table appender.void
appendTable(String namespace, String tableName, Table table)
Appends to a non-partitioned table, or adds the table if it is not present.void
appendTablePartition(String namespace, String tableName, String internalPartitionValue, String columnPartitionValue, Table data)
Adds or appends to a single table location (e.g.void
closeAndDeleteCentral(String namespace, String tableName)
Close all logger connections to the centralized logging for the specified table, and then atomically delete all centrally logged table data for this namespace and table name.void
closeAndDeleteCentral(String namespace, String tableName, String columnPartitionValue)
Close all logger connections to the centralized logging for the specified table, and then atomically delete all centrally logged table data for this namespace and table name, restricted to the column partition value if provided.void
deleteMatchingTables(String namespace, String tableNameRegex)
Delete all files related to the set of tables whose names match the supplied regular expression.void
deleteNamespace(String namespace)
Delete all files related to the specified namespace.void
deleteTables(String namespace, String... tableNames)
Delete all files related to a set of tables.<T> T
executeQuery(RemoteQuery<T> remoteQuery, Class<?>... additionalClasses)
Executes a DB query.void
gc()
Invoke the garbage collector for this database.Table
getCatalog()
Gets a table containing information on all tables in the DB.String
getClientHost()
Gets a client hostname.TableWriter
getColumnPartitionTableWriter(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, TableDefinition tableDefinition, boolean append)
Gets a table writer for a partitioned table.Table
getErrorLog()
Get an error log for the DB.List<String>
getIntradayPartitions(String namespace, String tableName)
Get a list of all internal partition values available for the specified intraday table.Table
getIntradayPartitionsAsTable(String namespace, String tableName)
Get all internal partition values available for the specified intraday table, returned as table.Table
getIntradayTableV2(String namespace, String tableName, boolean live)
Retrieves an intraday table by namespace and name.Table
getIntradayTableV2(String namespace, String tableName, Set<String> internalPartitionValues, boolean live)
Retrieves the specified internal partitions of the specified intraday table.Table
getLastByTable(String namespace, String tableName)
Retrieves an intraday last-by table by namespace and name.List<String>
getNamespaces()
Retrieves all namespace names from the database.String
getProcessInfoId()
Gets the unique processInfoId of the worker.ReplayerInterface
getReplayer(DBDateTime timeStart, DBDateTime timeEnd)
Creates a data replayer.ReplayerInterface
getReplayer(DBDateTime time, DBDateTime endTime, long interval)
Creates a data replayer.ReplayerInterface
getReplayer(DBDateTime timeStart, DBDateTime timeEnd, String interval)
Creates a data replayer.ReplayerInterface
getReplayer(String timeStart, String timeEnd)
Creates a data replayer.ReplayerInterface
getReplayer(String timeStart, String timeEnd, String interval)
Creates a data replayer.SchemaService
getSchemaService()
String
getServerHost()
Gets the server hostname.List<String>
getSystemNamespaces()
Retrieves system namespace names from the database.TableDefinition
getTableDefinition(String namespace, String tableName)
Retrieves a table definition by namespace and name, generally from the schema service.List<String>
getTableNames(String namespace)
Gets all table names from the specified namespace.Table
getTableV2(String namespace, String tableName)
Retrieves a table by namespace and name.TableWriter
getTableWriter(String namespace, String tableName, TableDefinition tableDefinition, boolean append)
Gets a table writer for an unpartitioned table.com.fishlib.auth.UserContext
getUserContext()
Gets the user authentication context.List<String>
getUserNamespaces()
Retrieves user namespace names from the database.String
getWorkerName()
Gets the worker name.boolean
hasImportedData(String namespace, String tableName, String columnPartitionValue)
Determines if the historical table's column partition is present in the DB.boolean
hasIntradayData(String namespace, String tableName, String columnPartitionValue)
Determines if the intraday table's column partition is present in the DB.boolean
hasIntradayTable(String namespace, String tableName)
Determines if the table is present in the DB and currently has intraday data.boolean
hasNamespace(String namespace)
Determines if the namespace is present in the DB.boolean
hasTable(String namespace, String tableName)
Determines if the table is defined in the DB.void
importClass(Class classToImport)
Imports a class for use in a query.void
importStatic(Class classToImport)
Imports the static methods from a class for use in a query.Database.LogHandle
logPartitionTableIncremental(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, boolean append)
Writes all changes in a table to a centrally managed table.Database.LogHandle
logPartitionTableIncremental(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, ReplayerInterface replayer, boolean append)
Writes all changes in a table to a centrally managed table.Database.LogHandle
logPartitionTableSnapshot(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, long logIntervalMillis, boolean append)
Snapshots a table at a regular interval and writes the snapshot to a centrally managed table.Database.LogHandle
logPartitionTableSnapshot(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, long logIntervalMillis, ReplayerInterface replayer, boolean append)
Snapshots a table at a regular interval and writes the snapshot to a centrally managed table.Database.LogHandle
logPartitionTableSnapshot(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, String logInterval, boolean append)
Snapshots a table at a regular interval and writes the snapshot to a centrally managed table.Database.LogHandle
logPartitionTableSnapshot(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, String logInterval, ReplayerInterface replayer, boolean append)
Snapshots a table at a regular interval and writes the snapshot to a centrally managed table.Table
makeRemote(Table value)
Make a copy of a local table on a remote server.Table
mr(Table value)
Convenience method forDatabase.makeRemote(Table)
.
Make a copy of a local table on a remote server.void
reloadData()
Reload any internally-cached data.void
removeTable(String namespace, String tableName)
Removes a table.void
removeTableDefinition(String namespace, String tableName)
Deprecated.void
removeTablePartition(String namespace, String tableName, String internalPartitionValue, String columnPartitionValue)
Removes a single table location (e.g.void
replaceTable(String namespace, String tableName, Table table, Database.StorageFormat storageFormat)
Replaces a non-partitioned table with a new table, or adds the table, if it is not already present.void
replaceTableDefinition(String namespace, String tableName, TableDefinition tableDefinition)
Replaces a user table definition.void
replaceTablePartition(String namespace, String tableName, String internalPartitionValue, String columnPartitionValue, Table data, Database.StorageFormat storageFormat)
Replaces a single table location (e.g.int
setWatchdogMillis(int millis)
Sets monitoring of delays in the LiveTableMonitor refresh loop.void
setWatchdogTimeoutProcedure(LongConsumer watchdogTimeoutProcedure)
Set the watchdog timeout procedure.void
shutdown()
Shuts this database down.void
startup()
Starts this database up.Table
timeTable(long periodValue)
Creates a table that adds a new row on a regular interval.Table
timeTable(long periodValue, ReplayerInterface replayer)
Creates a table that adds a new row on a regular interval.Table
timeTable(DBDateTime startTime, long periodValue)
Creates a table that adds a new row on a regular interval, starting from a specified time.Table
timeTable(DBDateTime startTime, long periodValue, ReplayerInterface replayer)
Creates a table that adds a new row on a regular interval, starting from a specified time.Table
timeTable(DBDateTime startTime, String period)
Creates a table that adds a new row on a regular interval, starting from a specified time.Table
timeTable(DBDateTime startTime, String period, ReplayerInterface replayer)
Creates a table that adds a new row on a regular interval, starting from a specified time.Table
timeTable(String period)
Creates a table that adds a new row on a regular interval.Table
timeTable(String startTime, long periodValue)
Creates a table that adds a new row on a regular interval, starting from a specified time.Table
timeTable(String startTime, long periodValue, ReplayerInterface replayer)
Creates a table that adds a new row on a regular interval, starting from a specified time.Table
timeTable(String period, ReplayerInterface replayer)
Creates a table that adds a new row on a regular interval.Table
timeTable(String startTime, String period)
Creates a table that adds a new row on a regular interval, starting from a specified time.Table
timeTable(String startTime, String period, ReplayerInterface replayer)
Creates a table that adds a new row on a regular interval, starting from a specified time.Methods inherited from class com.illumon.iris.db.tables.databases.BaseDatabase
addPartitionedTableDefinition, addPartitionedTableDefinition, addPartitionedTableDefinitionIfAbsent, addPartitionedTableDefinitionIfAbsent, addTablePartition, addTablePartitionAndDefinition, addTablePartitionAndDefinition, appendTablePartition, removeTablePartition, replaceTablePartition
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.illumon.iris.db.tables.databases.Database
addColumnPartitionAndDefinition, addColumnPartitionAndDefinition, addTable, addTablePartition, addTablePartition, getIntradayTable, getIntradayTable, getIntradayTable, getIntradayTable, getIntradayTable, getIntradayTable, getIntradayTableV2, getIntradayTableV2, getIntradayTableV2, getIntradayTableV2, getTable, i, i, i, i, i, i, i2, i2, i2, i2, i2, i2, replaceTable, replaceTablePartition, replaceTablePartition, rm, t, t2
-
Field Details
-
Constructor Details
-
Method Details
-
getSchemaService
Description copied from interface:Database
- Returns:
- The
SchemaService
that thisDatabase
was created with.
-
addTablePartition
public void addTablePartition(String namespace, String tableName, String internalPartitionValue, String columnPartitionValue, Table data, Database.StorageFormat storageFormat)Description copied from interface:Database
Adds a single table partition (e.g. one date) to a partitioned table.Requires that a suitable TableDefinition has already been added.
Throws an exception if the partition already exists.
- Parameters:
namespace
- table namespacetableName
- table nameinternalPartitionValue
- internal (not user-visible) partition value.columnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).data
- data for this partition. Must *not* contain the partitioning column.storageFormat
- the format used for storage
-
addTable
public void addTable(String namespace, String tableName, Table table, Database.StorageFormat storageFormat)Description copied from interface:Database
Adds a non-partitioned table by name to the specified namespace.- Parameters:
namespace
- table namespacetableName
- table nametable
- table to addstorageFormat
- the storage format to use (ex DeephavenV1 or Parquet)
-
addTableDefinition
public void addTableDefinition(String namespace, String tableName, TableDefinition tableDefinition)Description copied from interface:Database
Adds a table definition to the specified namespace. Throws an exception if the table definition already exists.- Parameters:
namespace
- table namespacetableName
- table nametableDefinition
- table definition to add
-
appendCentral
public void appendCentral(String namespace, String tableName, String columnPartitionValue, Table table, boolean flush) throws IOExceptionDescription copied from interface:Database
Append to a table via a centralized table appender.Note: The table data is appended to a system-defined internal partition, and the specified column partition value.
- Parameters:
namespace
- table namespacetableName
- table namecolumnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).table
- new dataflush
- true to flush the table to disk; false to wait for flushing (if the implementation supports waiting)- Throws:
IOException
- problem appending
-
appendCentral
public void appendCentral(String namespace, String tableName, Table table, boolean flush) throws IOExceptionDescription copied from interface:Database
Append to a table via a centralized table appender.This variant implicitly uses a default partitioning column value set by the
iris.defaultColumnPartitionNamingFunction
function.- Specified by:
appendCentral
in interfaceDatabase
- Overrides:
appendCentral
in classBaseDatabase
- Parameters:
namespace
- table namespacetableName
- table nametable
- new dataflush
- true to flush the table to disk; false to wait for flushing (if the implementation supports waiting)- Throws:
IOException
- problem appending
-
appendTablePartition
public void appendTablePartition(String namespace, String tableName, String internalPartitionValue, String columnPartitionValue, Table data)Description copied from interface:Database
Adds or appends to a single table location (e.g. one date) to a partitioned table.Requires that a suitable TableDefinition has already been added.
- Parameters:
namespace
- table namespacetableName
- table nameinternalPartitionValue
- internal (not user-visible) partition value.columnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).data
- data to append to this partition. Must *not* contain the partitioning column.
-
appendTable
Description copied from interface:Database
Appends to a non-partitioned table, or adds the table if it is not present. Adds a TableDefinition if necessary.- Parameters:
namespace
- table namespacetableName
- table nametable
- data to add or append
-
deleteMatchingTables
Description copied from interface:Database
Delete all files related to the set of tables whose names match the supplied regular expression.Note: This only works for tables that still have a definition file, although it need not be readable.
Note: This is a dangerous API - don't use it if you don't fully understand the implications.
- Parameters:
namespace
- table namespacetableNameRegex
- table names in the given namespace that match this regular expression will be cleaned up.
-
deleteNamespace
Description copied from interface:Database
Delete all files related to the specified namespace.Note: This is a dangerous API - don't use it if you don't fully understand the implications.
- Parameters:
namespace
- namespace to be deleted.
-
deleteTables
Description copied from interface:Database
Delete all files related to a set of tables.Database.removeTable(String, String)
is a better option, unless the underlying table is damaged.- Parameters:
namespace
- table namespacetableNames
- table names to delete
-
closeAndDeleteCentral
public void closeAndDeleteCentral(@NotNull String namespace, @NotNull String tableName) throws IOExceptionDescription copied from interface:Database
Close all logger connections to the centralized logging for the specified table, and then atomically delete all centrally logged table data for this namespace and table name. Remove all local table data also, as withDatabase.removeTable(String, String)
.USE WITH EXTREME CAUTION!!!
- Parameters:
namespace
- table namespacetableName
- table name- Throws:
IOException
- problems encountered
-
closeAndDeleteCentral
public void closeAndDeleteCentral(@NotNull String namespace, @NotNull String tableName, @Nullable String columnPartitionValue) throws IOExceptionDescription copied from interface:Database
Close all logger connections to the centralized logging for the specified table, and then atomically delete all centrally logged table data for this namespace and table name, restricted to the column partition value if provided.USE WITH EXTREME CAUTION!!!
- Parameters:
namespace
- table namespacetableName
- table namecolumnPartitionValue
- optional column partition value- Throws:
IOException
- problems encountered
-
executeQuery
public <T> T executeQuery(RemoteQuery<T> remoteQuery, Class<?>... additionalClasses) throws IOExceptionDescription copied from interface:Database
Executes a DB query.- Type Parameters:
T
- return type- Parameters:
remoteQuery
- query to executeadditionalClasses
- additional classes to use during the query- Returns:
- result of the query (must be serializable)
- Throws:
IOException
- problems executing the query or transmitting results
-
gc
public void gc()Description copied from interface:Database
Invoke the garbage collector for this database. -
getClientHost
Description copied from interface:Database
Gets a client hostname.- Returns:
- client hostname
-
getColumnPartitionTableWriter
public TableWriter getColumnPartitionTableWriter(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, TableDefinition tableDefinition, boolean append)Description copied from interface:Database
Gets a table writer for a partitioned table.- Parameters:
namespace
- table namespacetableName
- table namepartitioningColumnName
- name of the partitioning columncolumnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).tableDefinition
- table definitionappend
- true to append to an existing partition; false to overwrite an existing partition.- Returns:
- table writer
-
getErrorLog
Description copied from interface:Database
Get an error log for the DB. This is a real-time table.- Returns:
- error log
- Throws:
Exception
- problems retrieving the error log.
-
getIntradayPartitions
Description copied from interface:Database
Get a list of all internal partition values available for the specified intraday table.- Parameters:
namespace
- The namespace of the tabletableName
- The table name to examine in the intraday data space- Returns:
- A list of internal partition values for top-level partitioning of the intraday table. Typically represents one partition per source.
-
getIntradayPartitionsAsTable
Description copied from interface:Database
Get all internal partition values available for the specified intraday table, returned as table.- Parameters:
namespace
- The namespace of the tabletableName
- The table name to examine in the intraday data space- Returns:
- A table containing the internal partition values for top-level partitioning of the intraday table. Typically represents one partition per source.
-
getIntradayTableV2
Description copied from interface:Database
Retrieves an intraday table by namespace and name. Throws exceptions for unknown tables.- Parameters:
namespace
- namespace of the tabletableName
- name of the tablelive
- true if the table should be live/updating; false otherwise- Returns:
- intraday table
-
getIntradayTableV2
public Table getIntradayTableV2(String namespace, String tableName, Set<String> internalPartitionValues, boolean live)Description copied from interface:Database
Retrieves the specified internal partitions of the specified intraday table. The result may contain locations for multiple column partition values, and so a subsequent filter (e.g. on "Date") will often be desired.Throws exceptions for unknown tables.
- Parameters:
namespace
- namespace of the tabletableName
- name of the tableinternalPartitionValues
- locations will be restricted to these internal partition valueslive
- true if the table should be live/updating; false otherwise- Returns:
- single partition intraday table
-
getLastByTable
Description copied from interface:Database
Retrieves an intraday last-by table by namespace and name.Throws exceptions for unknown tables.
Always provides a live result.
This may not be configured on your system.
- Parameters:
namespace
- namespace of the tabletableName
- name of the table- Returns:
- live intraday last-by table
-
getNamespaces
Description copied from interface:Database
Retrieves all namespace names from the database.- Returns:
- The list of namespace names
-
getReplayer
public ReplayerInterface getReplayer(DBDateTime time, DBDateTime endTime, long interval) throws ExceptionDescription copied from interface:Database
Creates a data replayer.- Parameters:
time
- replay start timeendTime
- replay end timeinterval
- replay step size- Returns:
- replayer
- Throws:
IOException
- problems creating the replayerException
-
getReplayer
public ReplayerInterface getReplayer(String timeStart, String timeEnd, String interval) throws ExceptionDescription copied from interface:Database
Creates a data replayer.- Parameters:
timeStart
- replay start timetimeEnd
- replay end timeinterval
- replay step size- Returns:
- replayer
- Throws:
IOException
- problems creating the replayerException
-
getReplayer
public ReplayerInterface getReplayer(DBDateTime timeStart, DBDateTime timeEnd, String interval) throws ExceptionDescription copied from interface:Database
Creates a data replayer.- Parameters:
timeStart
- replay start timetimeEnd
- replay end timeinterval
- replay step size- Returns:
- replayer
- Throws:
IOException
- problems creating the replayerException
-
getReplayer
Description copied from interface:Database
Creates a data replayer.- Parameters:
timeStart
- replay start timetimeEnd
- replay end time- Returns:
- replayer
- Throws:
IOException
- problems creating the replayer
-
getReplayer
Description copied from interface:Database
Creates a data replayer.- Parameters:
timeStart
- replay start timetimeEnd
- replay end time- Returns:
- replayer
- Throws:
IOException
- problems creating the replayer
-
getServerHost
Description copied from interface:Database
Gets the server hostname.- Returns:
- server hostname.
-
getSystemNamespaces
Description copied from interface:Database
Retrieves system namespace names from the database.- Returns:
- The list of namespace names
-
getTableNames
Description copied from interface:Database
Gets all table names from the specified namespace.- Parameters:
namespace
- The namespace to list the contents of- Returns:
- The list of table names
-
getTableV2
Description copied from interface:Database
Retrieves a table by namespace and name. Throws exceptions for unknown tables.- Parameters:
namespace
- namespace of the tabletableName
- name of the table- Returns:
- table in "v2" format
-
getTableWriter
public TableWriter getTableWriter(String namespace, String tableName, TableDefinition tableDefinition, boolean append) throws IOExceptionDescription copied from interface:Database
Gets a table writer for an unpartitioned table.- Parameters:
namespace
- table namespacetableName
- table nametableDefinition
- table definitionappend
- true to append to an existing partition; false to overwrite an existing partition.- Returns:
- table writer
- Throws:
IOException
-
getUserContext
Description copied from interface:Database
Gets the user authentication context.- Returns:
- user authentication context
- Throws:
IOException
- problem retrieving the context
-
getUserNamespaces
Description copied from interface:Database
Retrieves user namespace names from the database.- Returns:
- The list of namespace names
-
getWorkerName
Description copied from interface:Database
Gets the worker name.- Returns:
- worker name
-
getProcessInfoId
Description copied from interface:Database
Gets the unique processInfoId of the worker.- Returns:
- process info id
-
hasImportedData
Description copied from interface:Database
Determines if the historical table's column partition is present in the DB.- Parameters:
namespace
- namespacetableName
- table namecolumnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).- Returns:
- true if the table's column partition exists; false otherwise.
-
hasIntradayData
Description copied from interface:Database
Determines if the intraday table's column partition is present in the DB.- Parameters:
namespace
- namespacetableName
- table namecolumnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).- Returns:
- true if the intraday table's column partition exists; false otherwise.
-
hasIntradayTable
Description copied from interface:Database
Determines if the table is present in the DB and currently has intraday data.- Parameters:
namespace
- namespacetableName
- table name- Returns:
- true if the table exists and has intraday data; false otherwise.
-
hasNamespace
Description copied from interface:Database
Determines if the namespace is present in the DB.- Parameters:
namespace
- namespace- Returns:
- true if the namespace exists; false otherwise.
-
getCatalog
Description copied from interface:Database
Gets a table containing information on all tables in the DB.- Returns:
- table containing information on all tables in the DB
-
hasTable
Description copied from interface:Database
Determines if the table is defined in the DB.- Parameters:
namespace
- namespacetableName
- table name- Returns:
- true if the table definition exists; false otherwise.
-
importClass
Description copied from interface:Database
Imports a class for use in a query. For example:db.importClass(X.class) t=db.t(namespace,tablename).where("X.func(A)")
- Parameters:
classToImport
- the class
-
importStatic
Description copied from interface:Database
Imports the static methods from a class for use in a query. For example:db.importStaticClass(X.class) t=db.t(namespace,tablename).where("staticFunc(A)")
where
staticFunc
is a static function ofX
.- Parameters:
classToImport
- The class
-
logPartitionTableIncremental
public Database.LogHandle logPartitionTableIncremental(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, boolean append) throws IOExceptionDescription copied from interface:Database
Writes all changes in a table to a centrally managed table.- Parameters:
namespace
- table namespacetableName
- table namepartitioningColumnName
- name of the partitioning columncolumnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).table
- table to log (does not contain the partition column)append
- true to append to an existing partition; false to replace the existing partition.- Returns:
- log handle
- Throws:
IOException
- problems
-
logPartitionTableIncremental
public Database.LogHandle logPartitionTableIncremental(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, ReplayerInterface replayer, boolean append) throws IOExceptionDescription copied from interface:Database
Writes all changes in a table to a centrally managed table.- Parameters:
namespace
- table namespacetableName
- table namepartitioningColumnName
- name of the partitioning columncolumnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).table
- table to log (does not contain the partition column)replayer
- data replayerappend
- true to append to an existing partition; false to replace the existing partition.- Returns:
- log handle
- Throws:
IOException
- problems
-
logPartitionTableSnapshot
public Database.LogHandle logPartitionTableSnapshot(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, String logInterval, boolean append) throws ExceptionDescription copied from interface:Database
Snapshots a table at a regular interval and writes the snapshot to a centrally managed table.- Parameters:
namespace
- table namespacetableName
- table namepartitioningColumnName
- name of the partitioning columncolumnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).table
- table to snapshot and log (does not contain the partition column)logInterval
- interval to log snapshots atappend
- true to append to an existing partition; false to replace the existing partition.- Returns:
- log handle
- Throws:
Exception
- problems
-
logPartitionTableSnapshot
public Database.LogHandle logPartitionTableSnapshot(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, String logInterval, ReplayerInterface replayer, boolean append) throws ExceptionDescription copied from interface:Database
Snapshots a table at a regular interval and writes the snapshot to a centrally managed table.- Parameters:
namespace
- table namespacetableName
- table namepartitioningColumnName
- name of the partitioning columncolumnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).table
- table to snapshot and log (does not contain the partition column)logInterval
- interval to log snapshots atreplayer
- data replayerappend
- true to append to an existing partition; false to replace the existing partition.- Returns:
- log handle
- Throws:
Exception
- problems
-
logPartitionTableSnapshot
public Database.LogHandle logPartitionTableSnapshot(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, long logIntervalMillis, boolean append) throws IOExceptionDescription copied from interface:Database
Snapshots a table at a regular interval and writes the snapshot to a centrally managed table.- Parameters:
namespace
- table namespacetableName
- table namepartitioningColumnName
- name of the partitioning columncolumnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).table
- table to snapshot and log (does not contain the partition column)logIntervalMillis
- interval in milliseconds to log snapshots atappend
- true to append to an existing partition; false to replace the existing partition.- Returns:
- log handle
- Throws:
IOException
- problems
-
logPartitionTableSnapshot
public Database.LogHandle logPartitionTableSnapshot(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, long logIntervalMillis, ReplayerInterface replayer, boolean append) throws IOExceptionDescription copied from interface:Database
Snapshots a table at a regular interval and writes the snapshot to a centrally managed table.- Parameters:
namespace
- table namespacetableName
- table namepartitioningColumnName
- name of the partitioning columncolumnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).table
- table to snapshot and log (does not contain the partition column)logIntervalMillis
- interval in milliseconds to log snapshots atreplayer
- data replayerappend
- true to append to an existing partition; false to replace the existing partition.- Returns:
- log handle
- Throws:
IOException
- problems
-
makeRemote
Description copied from interface:Database
Make a copy of a local table on a remote server.- Parameters:
value
- local table- Returns:
- remote table.
-
mr
Description copied from interface:Database
Convenience method forDatabase.makeRemote(Table)
.
Make a copy of a local table on a remote server.- Parameters:
value
- local table- Returns:
- remote table.
-
reloadData
public void reloadData()Description copied from interface:Database
Reload any internally-cached data. -
removeTablePartition
public void removeTablePartition(String namespace, String tableName, String internalPartitionValue, String columnPartitionValue)Description copied from interface:Database
Removes a single table location (e.g. one date) from a partitioned table. Requires that a suitable TableDefinition still exists.- Parameters:
namespace
- table namespacetableName
- table nameinternalPartitionValue
- internal (not user-visible) partition value.columnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).
-
removeTable
Description copied from interface:Database
Removes a table. This method is a better choice thanDatabase.deleteTables(String, String...)
, unless the underlying table no longer has consistent metadata. Throws an exception for tables that don't exist.- Parameters:
namespace
- table namespacetableName
- table name
-
removeTableDefinition
Deprecated.Description copied from interface:Database
Removes a table definition.- Parameters:
namespace
- table namespacetableName
- table name
-
replaceTablePartition
public void replaceTablePartition(String namespace, String tableName, String internalPartitionValue, String columnPartitionValue, Table data, Database.StorageFormat storageFormat)Description copied from interface:Database
Replaces a single table location (e.g. one date) from/to a partitioned table.Requires that a suitable TableDefinition has already been added.
Not guaranteed to be atomic in the case of failures.
- Parameters:
namespace
- table namespacetableName
- table nameinternalPartitionValue
- internal (not user-visible) partition value.columnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).data
- data to replace this partition. Must *not* contain the partitioning column.storageFormat
- the storage format to use (ex DeephavenV1 or Parquet)
-
replaceTable
public void replaceTable(String namespace, String tableName, Table table, Database.StorageFormat storageFormat)Description copied from interface:Database
Replaces a non-partitioned table with a new table, or adds the table, if it is not already present. Not guaranteed to be atomic in the case of failures.- Parameters:
namespace
- table namespacetableName
- table nametable
- data for the replacement tablestorageFormat
- the storage format to use (ex DeephavenV1 or Parquet)
-
replaceTableDefinition
public void replaceTableDefinition(String namespace, String tableName, TableDefinition tableDefinition)Description copied from interface:Database
Replaces a user table definition.Not guaranteed to be atomic in the case of failures.
Does not throw an exception for tables that don't exist.
- Parameters:
namespace
- table namespacetableName
- table nametableDefinition
- table definition for the replacement
-
setWatchdogMillis
Description copied from interface:Database
Sets monitoring of delays in the LiveTableMonitor refresh loop. If the LiveTableMonitor refresh loop takes longer than the specified amount of time, the watchdog timeout procedure is executed. The watchdog timeout procedure is specified by callingDatabase.setWatchdogTimeoutProcedure(LongConsumer)
.- Parameters:
millis
- if LiveTableMonitor refresh loop takes longer than this amount of time, the watchdog timeout procedure will be called.- Returns:
- the new value of the watchdog timer, in ms
- Throws:
IOException
- problems setting the monitor interval
-
setWatchdogTimeoutProcedure
Description copied from interface:Database
Set the watchdog timeout procedure. If LiveTableMonitor refresh loop takes longer than the amount of time specified viaDatabase.setWatchdogMillis(int)
, the timeout procedure is called.- Parameters:
watchdogTimeoutProcedure
- the procedure called when the LiveTableMonitor refresh loop takes longer than watchdogMillis.- Throws:
IOException
-
shutdown
public void shutdown()Description copied from interface:Database
Shuts this database down. -
startup
public void startup()Description copied from interface:Database
Starts this database up. -
timeTable
Description copied from interface:Database
Creates a table that adds a new row on a regular interval.- Parameters:
period
- time interval between new row additions.- Returns:
- time table
- Throws:
Exception
- problem creating the time table
-
timeTable
Description copied from interface:Database
Creates a table that adds a new row on a regular interval. For use with data replay.- Parameters:
period
- time interval between new row additionsreplayer
- data replayer- Returns:
- time table
- Throws:
Exception
- problem creating the time table
-
timeTable
Description copied from interface:Database
Creates a table that adds a new row on a regular interval, starting from a specified time.- Parameters:
startTime
- start time for adding new rowsperiod
- time interval between new row additions- Returns:
- time table
- Throws:
Exception
- problem creating the time table
-
timeTable
public Table timeTable(DBDateTime startTime, String period, ReplayerInterface replayer) throws ExceptionDescription copied from interface:Database
Creates a table that adds a new row on a regular interval, starting from a specified time. For use with data replay.- Parameters:
startTime
- start time for adding new rowsperiod
- time interval between new row additionsreplayer
- data replayer- Returns:
- time table
- Throws:
Exception
- problem creating the time table
-
timeTable
Description copied from interface:Database
Creates a table that adds a new row on a regular interval, starting from a specified time.- Parameters:
startTime
- start time for adding new rowsperiod
- time interval between new row additions- Returns:
- time table
- Throws:
Exception
- problem creating the time table
-
timeTable
public Table timeTable(String startTime, String period, ReplayerInterface replayer) throws ExceptionDescription copied from interface:Database
Creates a table that adds a new row on a regular interval, starting from a specified time. For use with data replay.- Parameters:
startTime
- start time for adding new rowsperiod
- time interval between new row additionsreplayer
- data replayer- Returns:
- time table
- Throws:
Exception
- problem creating the time table
-
timeTable
Description copied from interface:Database
Creates a table that adds a new row on a regular interval.- Parameters:
periodValue
- time interval between new row additions in nanoseconds.- Returns:
- time table
- Throws:
Exception
- problem creating the time table
-
timeTable
Description copied from interface:Database
Creates a table that adds a new row on a regular interval. For use with data replay.- Parameters:
periodValue
- time interval between new row additions in nanoseconds.replayer
- data replayer- Returns:
- time table
- Throws:
Exception
- problem creating the time table
-
timeTable
Description copied from interface:Database
Creates a table that adds a new row on a regular interval, starting from a specified time.- Parameters:
startTime
- start time for adding new rowsperiodValue
- time interval between new row additions in nanoseconds.- Returns:
- time table
- Throws:
Exception
- problem creating the time table
-
timeTable
public Table timeTable(DBDateTime startTime, long periodValue, ReplayerInterface replayer) throws ExceptionDescription copied from interface:Database
Creates a table that adds a new row on a regular interval, starting from a specified time. For use with data replay.- Parameters:
startTime
- start time for adding new rowsperiodValue
- time interval between new row additions in nanoseconds.replayer
- data replayer- Returns:
- time table
- Throws:
Exception
- problem creating the time table
-
timeTable
Description copied from interface:Database
Creates a table that adds a new row on a regular interval, starting from a specified time.- Parameters:
startTime
- start time for adding new rowsperiodValue
- time interval between new row additions in nanoseconds.- Returns:
- time table
- Throws:
Exception
- problem creating the time table
-
timeTable
public Table timeTable(String startTime, long periodValue, ReplayerInterface replayer) throws ExceptionDescription copied from interface:Database
Creates a table that adds a new row on a regular interval, starting from a specified time. For use with data replay.- Parameters:
startTime
- start time for adding new rowsperiodValue
- time interval between new row additions in nanoseconds.replayer
- data replayer- Returns:
- time table
- Throws:
Exception
- problem creating the time table
-
getTableDefinition
Description copied from interface:Database
Retrieves a table definition by namespace and name, generally from the schema service.- Parameters:
namespace
- The namespace of the definition to retrievetableName
- The table name of the definition to retrieve- Returns:
- The table definition retrieved, null if not found
-