public class TableDataConglomerate extends Object
Modifier and Type | Field and Description |
---|---|
static TableName |
CHECK_INFO_TABLE |
static TableName |
FOREIGN_COLS_TABLE |
static TableName |
FOREIGN_INFO_TABLE |
static TableName |
PERSISTENT_VAR_TABLE |
static TableName |
PRIMARY_COLS_TABLE |
static TableName |
PRIMARY_INFO_TABLE |
static TableName |
SCHEMA_INFO_TABLE
The schema info table.
|
static String |
STATE_POST
The postfix on the name of the state file for the database store name.
|
static TableName |
SYS_SEQUENCE |
static TableName |
SYS_SEQUENCE_INFO |
static String |
SYSTEM_SCHEMA
The name of the system schema where persistant conglomerate state is
stored.
|
static TableName |
UNIQUE_COLS_TABLE |
static TableName |
UNIQUE_INFO_TABLE |
Constructor and Description |
---|
TableDataConglomerate(TransactionSystem system,
com.mckoi.database.StoreSystem store_system)
Constructs the conglomerate.
|
Modifier and Type | Method and Description |
---|---|
void |
addTransactionModificationListener(TableName table_name,
TransactionModificationListener listener)
Adds a listener for transactional modification events that occur on the
given table in this conglomerate.
|
void |
checkVisibleTables(UserTerminal terminal)
Checks the list of committed tables in this conglomerate.
|
void |
close()
Closes this conglomerate.
|
void |
create(String name)
Creates a new conglomerate at the given path in the file system.
|
Transaction |
createTransaction()
Starts a new transaction.
|
DebugLogger |
Debug()
Returns the DebugLogger object that we use to log debug messages to.
|
void |
delete()
Deletes and closes the conglomerate.
|
boolean |
exists(String name)
Returns true if the conglomerate exists in the file system and can
be opened.
|
void |
finalize() |
void |
fix(String name,
UserTerminal terminal)
Checks the conglomerate state file.
|
String[] |
getAllTableFileNames()
Returns the list of file names for all tables in this conglomerate.
|
RawDiagnosticTable |
getDiagnosticTable(String table_file_name)
Returns a RawDiagnosticTable object that is used for diagnostics of the
table with the given file name.
|
TransactionSystem |
getSystem()
Returns the TransactionSystem that this conglomerate is part of.
|
boolean |
isClosed()
Returns true if the conglomerate is closed.
|
void |
liveCopyTo(TableDataConglomerate dest_conglomerate)
Makes a complete copy of this database to the position represented by the
given TableDataConglomerate object.
|
void |
open(String name)
Opens a conglomerate.
|
void |
removeTransactionModificationListener(TableName table_name,
TransactionModificationListener listener)
Removes a listener for transaction modification events on the given table
in this conglomerate as previously set by the
'addTransactionModificationListener' method.
|
com.mckoi.database.StoreSystem |
storeSystem()
Returns the StoreSystem used by this conglomerate to manage the
persistent state of the database.
|
public static final String STATE_POST
public static final String SYSTEM_SCHEMA
public static final TableName SCHEMA_INFO_TABLE
public static final TableName PERSISTENT_VAR_TABLE
public static final TableName FOREIGN_COLS_TABLE
public static final TableName UNIQUE_COLS_TABLE
public static final TableName PRIMARY_COLS_TABLE
public static final TableName CHECK_INFO_TABLE
public static final TableName UNIQUE_INFO_TABLE
public static final TableName FOREIGN_INFO_TABLE
public static final TableName PRIMARY_INFO_TABLE
public static final TableName SYS_SEQUENCE_INFO
public static final TableName SYS_SEQUENCE
public TableDataConglomerate(TransactionSystem system, com.mckoi.database.StoreSystem store_system)
public final TransactionSystem getSystem()
public final com.mckoi.database.StoreSystem storeSystem()
public final DebugLogger Debug()
public void checkVisibleTables(UserTerminal terminal) throws IOException
IOException
public void create(String name) throws IOException
IOException
public void open(String name) throws IOException
IOException
public void close() throws IOException
IOException
public void delete() throws IOException
WARNING: Will result in total loss of all data stored in the conglomerate.
IOException
public boolean isClosed()
public boolean exists(String name) throws IOException
IOException
public void liveCopyTo(TableDataConglomerate dest_conglomerate) throws IOException
The conglomerate must be open before this method is called.
IOException
public RawDiagnosticTable getDiagnosticTable(String table_file_name)
public String[] getAllTableFileNames()
public void addTransactionModificationListener(TableName table_name, TransactionModificationListener listener)
The BEFORE_* type triggers are given the opportunity to modify the contents of the RowData before the update or insert occurs. All triggers may generate an exception which will cause the transaction to rollback.
The event carries with it the event type, the transaction that the event occurred in, and any information regarding the modification itself.
This event/listener mechanism is intended to be used to implement higher layer database triggering systems. Note that care must be taken with the commit level events because they occur inside a commit lock on this conglomerate and so synchronization and deadlock issues need to be carefully considered.
NOTE: A listener on the given table will be notified of ALL table modification events by all transactions at the time they happen.
table_name
- the name of the table in the conglomerate to listen for
events from.listener
- the listener to be notified of events.public void removeTransactionModificationListener(TableName table_name, TransactionModificationListener listener)
table_name
- the name of the table in the conglomerate to remove from
the listener list.listener
- the listener to be removed.public Transaction createTransaction()
public void fix(String name, UserTerminal terminal)
Copyright © 2015. All rights reserved.