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
  • Constructor Details

  • Method Details

    • getWorkerName

      public String getWorkerName()
      Description copied from interface: Database
      Gets the worker name.
      Returns:
      worker name
    • getProcessInfoId

      public String getProcessInfoId()
      Description copied from interface: Database
      Gets the unique processInfoId of the worker.
      Returns:
      process info id
    • getClientHost

      public String getClientHost()
      Description copied from interface: Database
      Gets a client hostname.
      Returns:
      client hostname
    • getServerHost

      public String 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 Exception
      Description copied from interface: Database
      Snapshots a table at a regular interval and writes the snapshot to a centrally managed table.
      Parameters:
      namespace - table namespace
      tableName - table name
      partitioningColumnName - name of the partitioning column
      columnPartitionValue - 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 at
      replayer - data replayer
      append - 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 Exception
      Description copied from interface: Database
      Snapshots a table at a regular interval and writes the snapshot to a centrally managed table.
      Parameters:
      namespace - table namespace
      tableName - table name
      partitioningColumnName - name of the partitioning column
      columnPartitionValue - 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 at
      append - true to append to an existing partition; false to replace the existing partition.
      Returns:
      log handle
      Throws:
      Exception - problems
    • importStatic

      public void importStatic​(Class classToImport)
      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 of X.

      Parameters:
      classToImport - The class
    • importClass

      public void importClass​(Class classToImport)
      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

      public <T> T executeQuery​(RemoteQuery<T> remoteQuery, Class<?>... additionalClasses)
      Description copied from interface: Database
      Executes a DB query.
      Type Parameters:
      T - return type
      Parameters:
      remoteQuery - query to execute
      additionalClasses - additional classes to use during the query
      Returns:
      result of the query (must be serializable)
    • getErrorLog

      public Table getErrorLog()
      Description copied from interface: Database
      Get an error log for the DB. This is a real-time table.
      Returns:
      error log
    • getReplayer

      public ReplayerInterface getReplayer​(DBDateTime timeStart, DBDateTime timeEnd)
      Description copied from interface: Database
      Creates a data replayer.
      Parameters:
      timeStart - replay start time
      timeEnd - replay end time
      Returns:
      replayer
    • getReplayer

      public ReplayerInterface getReplayer​(DBDateTime time, DBDateTime endTime, long interval)
      Description copied from interface: Database
      Creates a data replayer.
      Parameters:
      time - replay start time
      endTime - replay end time
      interval - replay step size
      Returns:
      replayer
    • mr

      public Table mr​(Table value)
      Description copied from interface: Database
      Convenience method for Database.makeRemote(Table).
      Make a copy of a local table on a remote server.
      Parameters:
      value - local table
      Returns:
      remote table.
    • makeRemote

      public Table makeRemote​(Table value)
      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.