public interface Database extends TableDefinitionProvider
Modifier and Type | Interface and Description |
---|---|
static interface |
Database.LogHandle
Handle for logged tables.
|
TableDefinitionProvider.MissingTableDefinitionException
Modifier and Type | Method and Description |
---|---|
default void |
addColumnPartitionAndDefinition(String namespace,
String tableName,
String partitioningColumnName,
String internalPartitionValue,
String columnPartitionValue,
Table data)
|
default void |
addColumnPartitionAndDefinition(String namespace,
String tableName,
String partitioningColumnName,
String columnPartitionValue,
Table data)
|
void |
addPartitionedTableDefinition(String namespace,
String tableName,
String partitioningColumnName,
TableDefinition prototypeDefinition)
Adds a table definition for a partitioned table.
|
void |
addPartitionedTableDefinition(String namespace,
String tableName,
TableDefinition prototypeDefinition)
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 |
addTable(String namespace,
String tableName,
Table table)
Adds a 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)
Adds a single table partition (e.g.
|
void |
addTablePartition(String namespace,
String tableName,
String columnPartitionValue,
Table data)
Adds a single table partition (e.g.
|
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 |
addTablePartitionAndDefinition(String namespace,
String tableName,
String partitioningColumnName,
String columnPartitionValue,
Table data)
Adds a table definition and data for a partitioned table location.
|
void |
appendCentral(String namespace,
String tableName,
String columnPartitionValue,
Table table,
boolean flush)
Append to a table via a centralized table appender.
|
void |
appendCentral(String namespace,
String tableName,
Table table,
boolean flush)
Append to a table via a centralized table appender.
|
void |
appendTable(String namespace,
String tableName,
Table table)
Appends to a 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 |
appendTablePartition(String namespace,
String tableName,
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 |
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()
Gets 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.
|
default Table |
getIntradayTable(String namespace,
String tableName)
Retrieves an intraday table by namespace and name.
|
default Table |
getIntradayTable(String namespace,
String tableName,
boolean live)
Retrieves an intraday table by namespace and name.
|
default Table |
getIntradayTable(String namespace,
String tableName,
String internalPartitionValue)
Retrieves a single internal partition of the specified intraday table.
|
default Table |
getIntradayTable(String namespace,
String tableName,
String internalPartitionValue,
boolean live)
Retrieves a single internal partition of the specified intraday table.
|
default Table |
getIntradayTableV2(String namespace,
String tableName)
Retrieves an intraday table by namespace and name.
|
Table |
getIntradayTableV2(String namespace,
String tableName,
boolean live)
Retrieves an intraday table by namespace and name.
|
default Table |
getIntradayTableV2(String namespace,
String tableName,
String internalPartitionValue)
Retrieves a single internal partition of the specified intraday table.
|
Table |
getIntradayTableV2(String namespace,
String tableName,
String internalPartitionValue,
boolean live)
Retrieves a single internal partition 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.
|
ReplayerInterface |
getReplayer(DBDateTime timeStart,
DBDateTime timeEnd)
Creates a data replayer.
|
ReplayerInterface |
getReplayer(DBDateTime timeStart,
DBDateTime timeEnd,
long interval)
Creates a data replayer.
|
default ReplayerInterface |
getReplayer(DBDateTime timeStart,
DBDateTime timeEnd,
String interval)
Creates a data replayer.
|
default ReplayerInterface |
getReplayer(String timeStart,
String timeEnd)
Creates a data replayer.
|
default ReplayerInterface |
getReplayer(String timeStart,
String timeEnd,
String interval)
Creates a data replayer.
|
String |
getServerHost()
Gets the server hostname.
|
List<String> |
getSystemNamespaces()
Retrieves system namespace names from the database.
|
default Table |
getTable(String namespace,
String tableName)
Retrieves a table by namespace and name.
|
List<String> |
getTableNames(String namespace)
Gets all table names from the specified namespace,
along with the table definitions table name and the column definitions table name.
|
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 intraday table is present in the DB.
|
boolean |
hasNamespace(String namespace)
Determines if the namespace is present in the DB.
|
boolean |
hasTable(String namespace,
String tableName)
Determines if the table is present in the DB.
|
default Table |
i(String namespace,
String tableName)
Retrieves an intraday table by namespace and name.
|
default Table |
i(String namespace,
String tableName,
boolean live)
Retrieves an intraday table by namespace and name.
|
default Table |
i(String namespace,
String tableName,
String internalPartitionValue)
Retrieves a single internal partition of the specified intraday table.
|
default Table |
i(String namespace,
String tableName,
String internalPartitionValue,
boolean live)
Retrieves a single internal partition of the specified intraday table.
|
default Table |
i2(String namespace,
String tableName)
Convenience method delegates to
Database.getIntradayTableV2(String, String) . |
default Table |
i2(String namespace,
String tableName,
boolean live)
Convenience method delegates to
Database.getIntradayTableV2(String, String, boolean) . |
default Table |
i2(String namespace,
String tableName,
String internalPartitionValue)
Convenience method delegates to
Database.getIntradayTableV2(String, String, String) . |
default Table |
i2(String namespace,
String tableName,
String internalPartitionValue,
boolean live)
Convenience method delegates to
Database.getIntradayTableV2(String, String, String, boolean) |
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 partitioned 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 partitioned 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 partitioned 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 partitioned 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 partitioned 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 partitioned table.
|
Table |
makeRemote(Table value)
Make a copy of a local table on a remote server.
|
Table |
mr(Table value)
Make a copy of a local table on a remote server.
|
default void |
reload()
Deprecated.
|
void |
reloadData()
Reload any internally-cached data.
|
void |
reloadMetadata()
Reload any internally-cached metadata.
|
void |
removeTable(String namespace,
String tableName)
Removes a table.
|
void |
removeTableDefinition(String namespace,
String tableName)
Removes a table definition.
|
void |
removeTablePartition(String namespace,
String tableName,
String columnPartitionValue)
Removes a single table location (e.g.
|
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)
Replaces a 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 table definition.
|
void |
replaceTablePartition(String namespace,
String tableName,
String internalPartitionValue,
String columnPartitionValue,
Table data)
Replaces a single table location (e.g.
|
void |
replaceTablePartition(String namespace,
String tableName,
String columnPartitionValue,
Table data)
Removes and re-adds a single table location (e.g.
|
default void |
rm(String namespace,
String tableName)
Convenience method for
Database.removeTable(String, String) . |
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.
|
default Table |
t(String namespace,
String tableName)
Retrieves a table by namespace and name.
|
default Table |
t2(String namespace,
String tableName)
Retrieves a table by namespace and name.
|
Table |
timeTable(DBDateTime startTime,
long periodNanos)
Creates a table that adds a new row on a regular interval, starting from a specified time.
|
Table |
timeTable(DBDateTime startTime,
long periodNanos,
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(long periodNanos)
Creates a table that adds a new row on a regular interval.
|
Table |
timeTable(long periodNanos,
ReplayerInterface replayer)
Creates a table that adds a new row on a regular interval.
|
Table |
timeTable(String period)
Creates a table that adds a new row on a regular interval.
|
Table |
timeTable(String startTime,
long periodNanos)
Creates a table that adds a new row on a regular interval, starting from a specified time.
|
Table |
timeTable(String startTime,
long periodNanos,
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.
|
getTableDefinition
String getWorkerName()
com.fishlib.auth.UserContext getUserContext() throws IOException
IOException
- problem retrieving the contextString getClientHost()
String getServerHost()
void startup()
void shutdown()
@Deprecated default void reload()
Database.reloadMetadata()
.void reloadMetadata()
reloadMetadata
in interface TableDefinitionProvider
void reloadData()
void gc()
Table getErrorLog() throws Exception
Exception
- problems retrieving the error log.int setWatchdogMillis(int millis) throws IOException
Database.setWatchdogTimeoutProcedure(LongConsumer)
.millis
- if LiveTableMonitor refresh loop takes longer than this amount of time, the worker will be terminated.IOException
- problems setting the monitor intervalvoid setWatchdogTimeoutProcedure(LongConsumer watchdogTimeoutProcedure) throws IOException
Database.setWatchdogMillis(int)
, the timeout procedure is called.watchdogTimeoutProcedure
- the procedure called when the LiveTableMonitor refresh loop takes longer than watchdogMillis.IOException
<T> T executeQuery(RemoteQuery<T> remoteQuery, Class<?>... additionalClasses) throws IOException
T
- return typeremoteQuery
- query to executeadditionalClasses
- additional classes to use during the queryIOException
- problems executing the query or transmitting resultsvoid importClass(Class classToImport)
db.importClass(X.class) t=db.t(namespace,tablename).where("X.func(A)")
classToImport
- the classvoid importStatic(Class classToImport)
db.importStaticClass(X.class) t=db.t(namespace,tablename).where("staticFunc(A)")where
staticFunc
is a static function of X
.classToImport
- The classTable mr(Table value)
value
- local tableTable makeRemote(Table value)
value
- local tableReplayerInterface getReplayer(DBDateTime timeStart, DBDateTime timeEnd) throws IOException
timeStart
- replay start timetimeEnd
- replay end timeIOException
- problems creating the replayerdefault ReplayerInterface getReplayer(String timeStart, String timeEnd) throws IOException
timeStart
- replay start timetimeEnd
- replay end timeIOException
- problems creating the replayerReplayerInterface getReplayer(DBDateTime timeStart, DBDateTime timeEnd, long interval) throws Exception
timeStart
- replay start timetimeEnd
- replay end timeinterval
- replay step sizeIOException
- problems creating the replayerException
default ReplayerInterface getReplayer(String timeStart, String timeEnd, String interval) throws Exception
timeStart
- replay start timetimeEnd
- replay end timeinterval
- replay step sizeIOException
- problems creating the replayerException
default ReplayerInterface getReplayer(DBDateTime timeStart, DBDateTime timeEnd, String interval) throws Exception
timeStart
- replay start timetimeEnd
- replay end timeinterval
- replay step sizeIOException
- problems creating the replayerException
List<String> getSystemNamespaces()
List<String> getUserNamespaces()
List<String> getNamespaces()
boolean hasNamespace(String namespace)
namespace
- namespaceTable getCatalog()
List<String> getTableNames(String namespace)
namespace
- The namespace to list the contents ofboolean hasTable(String namespace, String tableName)
namespace
- namespacetableName
- table nameboolean hasIntradayTable(String namespace, String tableName)
namespace
- namespacetableName
- table nameList<String> getIntradayPartitions(String namespace, String tableName)
namespace
- The namespace of the tabletableName
- The table name to examine in the intraday data spaceTable getIntradayPartitionsAsTable(String namespace, String tableName)
namespace
- The namespace of the tabletableName
- The table name to examine in the intraday data spaceboolean hasImportedData(String namespace, String tableName, String columnPartitionValue)
namespace
- namespacetableName
- table namecolumnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).boolean hasIntradayData(String namespace, String tableName, String columnPartitionValue)
namespace
- namespacetableName
- table namecolumnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).default Table getTable(String namespace, String tableName)
namespace
- namespace of the tabletableName
- name of the tabledefault Table t(String namespace, String tableName)
namespace
- namespace of the tabletableName
- name of the tableTable getTableV2(String namespace, String tableName)
namespace
- namespace of the tabletableName
- name of the tabledefault Table t2(String namespace, String tableName)
namespace
- namespace of the tabletableName
- name of the tabledefault Table getIntradayTable(String namespace, String tableName)
namespace
- namespace of the tabletableName
- name of the tabledefault Table i(String namespace, String tableName)
namespace
- namespace of the tabletableName
- name of the tabledefault Table getIntradayTableV2(String namespace, String tableName)
namespace
- namespace of the tabletableName
- name of the tabledefault Table i2(String namespace, String tableName)
Database.getIntradayTableV2(String, String)
.default Table getIntradayTable(String namespace, String tableName, boolean live)
namespace
- namespace of the tabletableName
- name of the tablelive
- true if the table should be live/updating; false otherwisedefault Table i(String namespace, String tableName, boolean live)
namespace
- namespace of the tabletableName
- name of the tablelive
- true if the table should be live/updating; false otherwiseTable getIntradayTableV2(String namespace, String tableName, boolean live)
namespace
- namespace of the tabletableName
- name of the tablelive
- true if the table should be live/updating; false otherwisedefault Table i2(String namespace, String tableName, boolean live)
Database.getIntradayTableV2(String, String, boolean)
.default Table getIntradayTable(String namespace, String tableName, String internalPartitionValue)
namespace
- namespace of the tabletableName
- name of the tableinternalPartitionValue
- locations will be restricted to this internal partition valuedefault Table i(String namespace, String tableName, String internalPartitionValue)
namespace
- namespace of the tabletableName
- name of the tableinternalPartitionValue
- locations will be restricted to this internal partition valuedefault Table getIntradayTableV2(String namespace, String tableName, String internalPartitionValue)
namespace
- namespace of the tabletableName
- name of the tableinternalPartitionValue
- locations will be restricted to this internal partition valuedefault Table i2(String namespace, String tableName, String internalPartitionValue)
Database.getIntradayTableV2(String, String, String)
.default Table getIntradayTable(String namespace, String tableName, String internalPartitionValue, boolean live)
namespace
- namespace of the tabletableName
- name of the tableinternalPartitionValue
- locations will be restricted to this internal partition valuelive
- true if the table should be live/updating; false otherwisedefault Table i(String namespace, String tableName, String internalPartitionValue, boolean live)
namespace
- namespace of the tabletableName
- name of the tableinternalPartitionValue
- locations will be restricted to this internal partition valuelive
- true if the table should be live/updating; false otherwiseTable getIntradayTableV2(String namespace, String tableName, String internalPartitionValue, boolean live)
namespace
- namespace of the tabletableName
- name of the tableinternalPartitionValue
- locations will be restricted to this internal partition valuelive
- true if the table should be live/updating; false otherwisedefault Table i2(String namespace, String tableName, String internalPartitionValue, boolean live)
Database.getIntradayTableV2(String, String, String, boolean)
Table getLastByTable(String namespace, String tableName)
namespace
- namespace of the tabletableName
- name of the tableTable timeTable(String period) throws Exception
period
- time interval between new row additions.Exception
- problem creating the time tableTable timeTable(String period, ReplayerInterface replayer) throws Exception
period
- time interval between new row additionsreplayer
- data replayerException
- problem creating the time tableTable timeTable(DBDateTime startTime, String period) throws Exception
startTime
- start time for adding new rowsperiod
- time interval between new row additionsException
- problem creating the time tableTable timeTable(DBDateTime startTime, String period, ReplayerInterface replayer) throws Exception
startTime
- start time for adding new rowsperiod
- time interval between new row additionsreplayer
- data replayerException
- problem creating the time tableTable timeTable(String startTime, String period) throws Exception
startTime
- start time for adding new rowsperiod
- time interval between new row additionsException
- problem creating the time tableTable timeTable(String startTime, String period, ReplayerInterface replayer) throws Exception
startTime
- start time for adding new rowsperiod
- time interval between new row additionsreplayer
- data replayerException
- problem creating the time tableTable timeTable(long periodNanos) throws Exception
periodNanos
- time interval between new row additions in nanoseconds.Exception
- problem creating the time tableTable timeTable(long periodNanos, ReplayerInterface replayer) throws Exception
periodNanos
- time interval between new row additions in nanoseconds.replayer
- data replayerException
- problem creating the time tableTable timeTable(DBDateTime startTime, long periodNanos) throws Exception
startTime
- start time for adding new rowsperiodNanos
- time interval between new row additions in nanoseconds.Exception
- problem creating the time tableTable timeTable(DBDateTime startTime, long periodNanos, ReplayerInterface replayer) throws Exception
startTime
- start time for adding new rowsperiodNanos
- time interval between new row additions in nanoseconds.replayer
- data replayerException
- problem creating the time tableTable timeTable(String startTime, long periodNanos) throws Exception
startTime
- start time for adding new rowsperiodNanos
- time interval between new row additions in nanoseconds.Exception
- problem creating the time tableTable timeTable(String startTime, long periodNanos, ReplayerInterface replayer) throws Exception
startTime
- start time for adding new rowsperiodNanos
- time interval between new row additions in nanoseconds.replayer
- data replayerException
- problem creating the time tablevoid deleteNamespace(String namespace)
Note: This is a dangerous API - don't use it if you don't fully understand the implications.
namespace
- namespace to be deleted.void deleteTables(String namespace, String... tableNames)
Database.removeTable(String, String)
is a better option, unless the underlying table is damaged.namespace
- table namespacetableNames
- table names to deletevoid deleteMatchingTables(String namespace, String tableNameRegex)
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.
namespace
- table namespacetableNameRegex
- table names in the given namespace that match this regular expression will be cleaned up.void addTable(String namespace, String tableName, Table table)
namespace
- table namespacetableName
- table nametable
- table to addRuntimeException
- table already existsvoid appendTable(String namespace, String tableName, Table table)
namespace
- table namespacetableName
- table nametable
- data to add or appenddefault void rm(String namespace, String tableName)
Database.removeTable(String, String)
.void removeTable(String namespace, String tableName)
deleteTables
, unless the underlying table no longer has consistent metadata.
Throws an exception for tables that don't exist.
Does not remove intraday partitions.namespace
- table namespacetableName
- table nameRuntimeException
- table does not existvoid replaceTable(String namespace, String tableName, Table table)
namespace
- table namespacetableName
- table nametable
- data for the replacement tablevoid addTableDefinition(String namespace, String tableName, TableDefinition tableDefinition)
namespace
- table namespacetableName
- table nametableDefinition
- table definition to addRuntimeException
- table definition already existsvoid removeTableDefinition(String namespace, String tableName)
namespace
- table namespacetableName
- table nameRuntimeException
- table definition does not existvoid replaceTableDefinition(String namespace, String tableName, TableDefinition tableDefinition)
namespace
- table namespacetableName
- table nametableDefinition
- table definition for the replacementvoid addTablePartition(String namespace, String tableName, String columnPartitionValue, Table data)
iris.defaultInternalPartitionNamingFunction
server configuration.
Throws an exception if the partition already exists.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.RuntimeException
- if the partition already existsvoid addTablePartition(String namespace, String tableName, String internalPartitionValue, String columnPartitionValue, Table data)
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.RuntimeException
- if the partition already existsvoid appendTablePartition(String namespace, String tableName, String columnPartitionValue, Table data)
iris.defaultInternalPartitionNamingFunction
server configuration.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.void appendTablePartition(String namespace, String tableName, String internalPartitionValue, String columnPartitionValue, Table data)
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.void removeTablePartition(String namespace, String tableName, String columnPartitionValue)
iris.defaultInternalPartitionNamingFunction
server configuration.namespace
- table namespacetableName
- table namecolumnPartitionValue
- column partition value (e.g. "2015-09-25" for a Date partitioning column).void removeTablePartition(String namespace, String tableName, String internalPartitionValue, String columnPartitionValue)
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).void replaceTablePartition(String namespace, String tableName, String columnPartitionValue, Table data)
iris.defaultInternalPartitionNamingFunction
server configuration.
Not guaranteed to be atomic in the case of failures.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.void replaceTablePartition(String namespace, String tableName, String internalPartitionValue, String columnPartitionValue, Table data)
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.void addPartitionedTableDefinitionIfAbsent(@NotNull String namespace, @NotNull String tableName, @NotNull String partitioningColumnName, @NotNull TableDefinition prototypeDefinition)
namespace
- table namespacetableName
- table namepartitioningColumnName
- name of the partitioning columnprototypeDefinition
- prototype table definition used to generate the table definitionvoid addPartitionedTableDefinitionIfAbsent(@NotNull String namespace, @NotNull String tableName, @NotNull String partitioningColumnName, @NotNull TableDefinition prototypeDefinition, boolean checkPartitioningColumn)
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 samevoid addPartitionedTableDefinition(@NotNull String namespace, @NotNull String tableName, @NotNull String partitioningColumnName, @NotNull TableDefinition prototypeDefinition)
namespace
- table namespacetableName
- table namepartitioningColumnName
- name of the partitioning columnprototypeDefinition
- prototype table definition used to generate the table definitionvoid addPartitionedTableDefinition(@NotNull String namespace, @NotNull String tableName, @NotNull TableDefinition prototypeDefinition)
iris.defaultColumnPartitionColumnName
server configuration.namespace
- table namespacetableName
- table nameprototypeDefinition
- prototype table definition used to generate the table definitionvoid addTablePartitionAndDefinition(@NotNull String namespace, @NotNull String tableName, @NotNull String partitioningColumnName, @NotNull String internalPartitionValue, @NotNull String columnPartitionValue, @NotNull Table data)
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@Deprecated default void addColumnPartitionAndDefinition(@NotNull String namespace, @NotNull String tableName, @NotNull String partitioningColumnName, @NotNull String internalPartitionValue, @NotNull String columnPartitionValue, @NotNull Table data)
void addTablePartitionAndDefinition(@NotNull String namespace, @NotNull String tableName, @NotNull String partitioningColumnName, @NotNull String columnPartitionValue, @NotNull Table data)
iris.defaultInternalPartitionNamingFunction
server configuration.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@Deprecated default void addColumnPartitionAndDefinition(@NotNull String namespace, @NotNull String tableName, @NotNull String partitioningColumnName, @NotNull String columnPartitionValue, @NotNull Table data)
void appendCentral(String namespace, String tableName, String columnPartitionValue, Table table, boolean flush) throws IOException
Note: The table data is appended to a host-specific internal partition, and the specified column partition value.
Note: This applies only to partitioned user tables.
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)IOException
- problem appendingvoid appendCentral(String namespace, String tableName, Table table, boolean flush) throws IOException
iris.defaultColumnPartitionNamingFunction
function.
Note: This applies only to partitioned user tables.
namespace
- table namespacetableName
- table nametable
- new dataflush
- true to flush the table to disk; false to wait for flushing (if the implementation supports waiting)IOException
- problem appendingvoid closeAndDeleteCentral(String namespace, String tableName) throws IOException
USE WITH EXTREME CAUTION!!!
Note: This applies only to partitioned user tables.
namespace
- table namespacetableName
- table nameIOException
- problems encounteredDatabase.LogHandle logPartitionTableSnapshot(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, String logInterval, ReplayerInterface replayer, boolean append) throws Exception
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 table; false to replace the existing table.Exception
- problemsDatabase.LogHandle logPartitionTableSnapshot(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, String logInterval, boolean append) throws Exception
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 table; false to replace the existing table.Exception
- problemsDatabase.LogHandle logPartitionTableSnapshot(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, long logIntervalMillis, ReplayerInterface replayer, boolean append) throws IOException
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 table; false to replace the existing table.IOException
- problemsDatabase.LogHandle logPartitionTableSnapshot(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, long logIntervalMillis, boolean append) throws IOException
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 table; false to replace the existing table.IOException
- problemsDatabase.LogHandle logPartitionTableIncremental(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, ReplayerInterface replayer, boolean append) throws IOException
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 table; false to replace the existing table.IOException
- problemsDatabase.LogHandle logPartitionTableIncremental(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, Table table, boolean append) throws IOException
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 table; false to replace the existing table.IOException
- problemsTableWriter getColumnPartitionTableWriter(String namespace, String tableName, String partitioningColumnName, String columnPartitionValue, TableDefinition tableDefinition, boolean append)
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.TableWriter getTableWriter(String namespace, String tableName, TableDefinition tableDefinition, boolean append) throws IOException
namespace
- table namespacetableName
- table nametableDefinition
- table definitionappend
- true to append to an existing partition; false to overwrite an existing partition.IOException