Class BaseDatabase
- All Implemented Interfaces:
Database
- Direct Known Subclasses:
AbstractDatabase
,DatabaseWrapper
,RemoteDatabase
public abstract class BaseDatabase extends Object implements Database
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.tables.databases.Database
Database.LogHandle, Database.StorageFormat
-
Constructor Summary
Constructors Constructor Description BaseDatabase()
-
Method Summary
Modifier and Type Method Description void
addPartitionedTableDefinition(String namespace, String tableName, TableDefinition tableDefinition)
Adds a table definition for a partitioned table.void
addPartitionedTableDefinition(String namespace, String tableName, String partitioningColumnName, TableDefinition tableDefinition)
Adds a table definition for a partitioned table.void
addPartitionedTableDefinitionIfAbsent(String namespace, String tableName, String partitioningColumnName, TableDefinition prototypeDefinition)
Adds a table definition for a partitioned table, if the table definition is absent.void
addPartitionedTableDefinitionIfAbsent(String namespace, String tableName, String partitioningColumnName, TableDefinition prototypeDefinition, boolean checkPartitioningColumn)
Adds a table definition for a partitioned table, if the table definition is absent.void
addTablePartition(String namespace, String tableName, String columnPartitionValue, Table data, Database.StorageFormat storageFormat)
Adds a single table partition (e.g.void
addTablePartitionAndDefinition(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table data)
Adds a table definition and data for a partitioned user table location.void
addTablePartitionAndDefinition(String namespace, String tableName, String partitioningColumnName, String internalPartitionValue, String columnPartitionValue, Table data)
Adds a table definition and data for a partitioned table.void
appendCentral(String namespace, String tableName, Table table, boolean flush)
Append to a table via a centralized table appender.void
appendTablePartition(String namespace, String tableName, String columnPartitionValue, Table data)
Adds or appends to a single table location (e.g.void
removeTablePartition(String namespace, String tableName, String columnPartitionValue)
Removes a single table location (e.g.void
replaceTablePartition(String namespace, String tableName, String columnPartitionValue, Table data, Database.StorageFormat storageFormat)
Removes and re-adds a single table location (e.g.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, addTable, addTableDefinition, addTablePartition, addTablePartition, addTablePartition, appendCentral, appendTable, appendTablePartition, closeAndDeleteCentral, closeAndDeleteCentral, deleteMatchingTables, deleteNamespace, deleteTables, executeQuery, gc, getCatalog, getClientHost, getColumnPartitionTableWriter, getErrorLog, getIntradayPartitions, getIntradayPartitionsAsTable, getIntradayTable, getIntradayTable, getIntradayTable, getIntradayTable, getIntradayTable, getIntradayTable, getIntradayTableV2, getIntradayTableV2, getIntradayTableV2, getIntradayTableV2, getIntradayTableV2, getIntradayTableV2, getLastByTable, getNamespaces, getProcessInfoId, getReplayer, getReplayer, getReplayer, getReplayer, getReplayer, getSchemaService, getServerHost, getSystemNamespaces, getTable, getTableDefinition, getTableNames, getTableV2, getTableWriter, getUserContext, getUserNamespaces, getWorkerName, hasImportedData, hasIntradayData, hasIntradayTable, hasNamespace, hasTable, i, i, i, i, i, i, i2, i2, i2, i2, i2, i2, importClass, importStatic, logPartitionTableIncremental, logPartitionTableIncremental, logPartitionTableSnapshot, logPartitionTableSnapshot, logPartitionTableSnapshot, logPartitionTableSnapshot, makeRemote, mr, reloadData, removeTable, removeTableDefinition, removeTablePartition, replaceTable, replaceTable, replaceTableDefinition, replaceTablePartition, replaceTablePartition, replaceTablePartition, rm, setWatchdogMillis, setWatchdogTimeoutProcedure, shutdown, startup, t, t2, timeTable, timeTable, timeTable, timeTable, timeTable, timeTable, timeTable, timeTable, timeTable, timeTable, timeTable, timeTable
-
Constructor Details
-
BaseDatabase
public BaseDatabase()
-
-
Method Details
-
addTablePartition
public final void addTablePartition(String namespace, String tableName, 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.
This variant implicitly uses internalPartitionValue set by the
iris.defaultInternalPartitionNamingFunction
property.Throws an exception if the partition already exists.
- Specified by:
addTablePartition
in interfaceDatabase
- Parameters:
namespace
- table namespacetableName
- table namecolumnPartitionValue
- 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
-
appendTablePartition
public final void appendTablePartition(String namespace, String tableName, String columnPartitionValue, Table data)Description copied from interface:Database
Adds or appends to a single table location (e.g. one date) to a partitioned user table.Requires that a suitable TableDefinition has already been added.
This variant implicitly uses internalPartitionName set by the
iris.defaultInternalPartitionNamingFunction
property.- Specified by:
appendTablePartition
in interfaceDatabase
- Parameters:
namespace
- table namespacetableName
- table namecolumnPartitionValue
- 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.
-
removeTablePartition
public final void removeTablePartition(String namespace, String tableName, String columnPartitionValue)Description copied from interface:Database
Removes a single table location (e.g. one date) from a partitioned user table.Requires that a suitable TableDefinition still exists.
This variant implicitly uses internalPartitionValue set by the
iris.defaultInternalPartitionNamingFunction
property.- Specified by:
removeTablePartition
in interfaceDatabase
- Parameters:
namespace
- table namespacetableName
- table namecolumnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).
-
replaceTablePartition
public final void replaceTablePartition(String namespace, String tableName, String columnPartitionValue, Table data, Database.StorageFormat storageFormat)Description copied from interface:Database
Removes and re-adds a single table location (e.g. one date) from/to a partitioned table.Requires that a suitable TableDefinition has already been added.
This variant implicitly uses internalPartitionName set by the
iris.defaultInternalPartitionNamingFunction
property.Not guaranteed to be atomic in the case of failures.
- Specified by:
replaceTablePartition
in interfaceDatabase
- Parameters:
namespace
- table namespacetableName
- table namecolumnPartitionValue
- 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 storage format to use (ex DeephavenV1 or Parquet)
-
addPartitionedTableDefinitionIfAbsent
public final void addPartitionedTableDefinitionIfAbsent(@NotNull String namespace, @NotNull String tableName, @NotNull String partitioningColumnName, @NotNull TableDefinition prototypeDefinition)Description copied from interface:Database
Adds a table definition for a partitioned table, if the table definition is absent.- Specified by:
addPartitionedTableDefinitionIfAbsent
in interfaceDatabase
- Parameters:
namespace
- table namespacetableName
- table namepartitioningColumnName
- name of the partitioning columnprototypeDefinition
- prototype table definition used to generate the table definition
-
addPartitionedTableDefinitionIfAbsent
public final void addPartitionedTableDefinitionIfAbsent(@NotNull String namespace, @NotNull String tableName, @NotNull String partitioningColumnName, @NotNull TableDefinition prototypeDefinition, boolean checkPartitioningColumn)Description copied from interface:Database
Adds a table definition for a partitioned table, if the table definition is absent.- Specified by:
addPartitionedTableDefinitionIfAbsent
in interfaceDatabase
- Parameters:
namespace
- table namespacetableName
- table namepartitioningColumnName
- name of the partitioning columnprototypeDefinition
- prototype table definition used to generate the table definitioncheckPartitioningColumn
- true to make sure the partitioning columns are the same
-
addPartitionedTableDefinition
public final void addPartitionedTableDefinition(@NotNull String namespace, @NotNull String tableName, @NotNull String partitioningColumnName, @NotNull TableDefinition tableDefinition)Description copied from interface:Database
Adds a table definition for a partitioned table.- Specified by:
addPartitionedTableDefinition
in interfaceDatabase
- Parameters:
namespace
- table namespacetableName
- table namepartitioningColumnName
- name of the partitioning columntableDefinition
- prototype table definition used to generate the table definition
-
addPartitionedTableDefinition
public final void addPartitionedTableDefinition(@NotNull String namespace, @NotNull String tableName, @NotNull TableDefinition tableDefinition)Description copied from interface:Database
Adds a table definition for a partitioned table. The partitioning column depends on theiris.defaultColumnPartitionColumnName
property.- Specified by:
addPartitionedTableDefinition
in interfaceDatabase
- Parameters:
namespace
- table namespacetableName
- table nametableDefinition
- prototype table definition used to generate the table definition
-
addTablePartitionAndDefinition
public final void addTablePartitionAndDefinition(@NotNull String namespace, @NotNull String tableName, @NotNull String partitioningColumnName, @NotNull String internalPartitionValue, @NotNull String columnPartitionValue, @NotNull Table data)Description copied from interface:Database
Adds a table definition and data for a partitioned table.This operation is not atomic.
- Specified by:
addTablePartitionAndDefinition
in interfaceDatabase
- Parameters:
namespace
- table namespacetableName
- table namepartitioningColumnName
- name of the partitioning columninternalPartitionValue
- internal (not user-visible) partition value.columnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).data
- table containing the data and table definition to write out
-
addTablePartitionAndDefinition
public final void addTablePartitionAndDefinition(@NotNull String namespace, @NotNull String tableName, @NotNull String partitioningColumnName, @NotNull String columnPartitionValue, @NotNull Table data)Description copied from interface:Database
Adds a table definition and data for a partitioned user table location.This operation is not atomic.
This variant implicitly uses internalPartitionName set by the
iris.defaultInternalPartitionNamingFunction
property.- Specified by:
addTablePartitionAndDefinition
in interfaceDatabase
- Parameters:
namespace
- table namespacetableName
- table namepartitioningColumnName
- name of the partitioning columncolumnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).data
- table containing the data and table definition to write out
-
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
- 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
-