Class AbstractDatabase
java.lang.Object
com.illumon.iris.db.tables.databases.BaseDatabase
com.illumon.iris.db.tables.databases.AbstractDatabase
- All Implemented Interfaces:
Database
- Direct Known Subclasses:
OnDiskDatabase
public abstract class AbstractDatabase extends BaseDatabase
-
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 AbstractDatabase()
-
Method Summary
Modifier and Type Method Description <T> T
executeQuery(RemoteQuery<T> remoteQuery, Class<?>... additionalClasses)
Executes a DB query.void
gc()
Invoke the garbage collector for this database.String
getClientHost()
Gets a client hostname.Table
getErrorLog()
Get an error log for the DB.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.String
getServerHost()
Gets the server hostname.String
getWorkerName()
Gets the worker name.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
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
shutdown()
Shuts this database down.void
startup()
Starts this database up.Methods inherited from class com.illumon.iris.db.tables.databases.BaseDatabase
addPartitionedTableDefinition, addPartitionedTableDefinition, addPartitionedTableDefinitionIfAbsent, addPartitionedTableDefinitionIfAbsent, addTablePartition, addTablePartitionAndDefinition, addTablePartitionAndDefinition, appendCentral, 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, addTable, addTableDefinition, addTablePartition, addTablePartition, addTablePartition, appendCentral, appendTable, appendTablePartition, closeAndDeleteCentral, closeAndDeleteCentral, deleteMatchingTables, deleteNamespace, deleteTables, getCatalog, getColumnPartitionTableWriter, getIntradayPartitions, getIntradayPartitionsAsTable, getIntradayTable, getIntradayTable, getIntradayTable, getIntradayTable, getIntradayTable, getIntradayTable, getIntradayTableV2, getIntradayTableV2, getIntradayTableV2, getIntradayTableV2, getIntradayTableV2, getIntradayTableV2, getLastByTable, getNamespaces, getReplayer, getReplayer, getReplayer, getSchemaService, getSystemNamespaces, getTable, getTableDefinition, getTableNames, getTableV2, getTableWriter, getUserContext, getUserNamespaces, hasImportedData, hasIntradayData, hasIntradayTable, hasNamespace, hasTable, i, i, i, i, i, i, i2, i2, i2, i2, i2, i2, logPartitionTableIncremental, logPartitionTableIncremental, logPartitionTableSnapshot, logPartitionTableSnapshot, reloadData, removeTable, removeTableDefinition, removeTablePartition, replaceTable, replaceTable, replaceTableDefinition, replaceTablePartition, replaceTablePartition, replaceTablePartition, rm, setWatchdogMillis, setWatchdogTimeoutProcedure, t, t2, timeTable, timeTable, timeTable, timeTable, timeTable, timeTable, timeTable, timeTable, timeTable, timeTable, timeTable, timeTable
-
Constructor Details
-
AbstractDatabase
public AbstractDatabase()
-
-
Method Details
-
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
-
getClientHost
Description copied from interface:Database
Gets a client hostname.- Returns:
- client hostname
-
getServerHost
Description copied from interface:Database
Gets the server hostname.- Returns:
- server hostname.
-
startup
public void startup()Description copied from interface:Database
Starts this database up. -
shutdown
public void shutdown()Description copied from interface:Database
Shuts this database down. -
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, 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
-
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
-
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
-
executeQuery
Description 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)
-
getErrorLog
Description copied from interface:Database
Get an error log for the DB. This is a real-time table.- Returns:
- error log
-
getReplayer
Description copied from interface:Database
Creates a data replayer.- Parameters:
timeStart
- replay start timetimeEnd
- replay end time- Returns:
- replayer
-
getReplayer
Description copied from interface:Database
Creates a data replayer.- Parameters:
time
- replay start timeendTime
- replay end timeinterval
- replay step size- Returns:
- replayer
-
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.
-
makeRemote
Description copied from interface:Database
Make a copy of a local table on a remote server.- Parameters:
value
- local table- Returns:
- remote table.
-
gc
public void gc()Description copied from interface:Database
Invoke the garbage collector for this database.
-