public final class V2MasterTableDataSource extends Object
Unlike V1MasterTableDataSource, this manages data and index information in a single store which can be backed by a single file in the file system.
The structure of the store comprises of a header block that contains the following information;
HEADER BLOCK +-------------------------------+ | version | | table id | | table sequence id | | pointer to DataTableDef | | pointer to DataIndexSetDef | | pointer to index block | | LIST BLOCK HEADER pointer | +-------------------------------+
Each record is comprised of a header which contains offsets to the fields in the record, and a serializable of the fields themselves.
Modifier and Type | Field and Description |
---|---|
protected BlobStoreInterface |
blob_store_interface
An abstracted reference to a BlobStore for managing blob references and
blob data.
|
protected com.mckoi.database.DataCellCache |
cache
A reference to the DataCellCache object.
|
protected int |
column_count
The number of columns in this table.
|
protected com.mckoi.database.RIDList[] |
column_rid_list
The list of RIDList objects for each column in this table.
|
protected boolean |
DATA_CELL_CACHING
Set to false to disable cell caching.
|
protected String |
delete_hits_key |
protected String |
file_hits_key |
protected com.mckoi.database.MasterTableGarbageCollector |
garbage_collector
Manages scanning and deleting of rows marked as deleted within this
data source.
|
protected DataIndexSetDef |
index_def
A DataIndexSetDef object that describes the indexes on the table.
|
protected String |
insert_hits_key |
protected boolean |
is_closed
True if this table source is closed.
|
protected String |
root_lock_key
The keys we use for Database.stats() for information for this table.
|
protected DataTableDef |
table_def
A DataTableDef object that describes the table topology.
|
protected int |
table_id
An integer that uniquely identifies this data source within the
conglomerate.
|
protected com.mckoi.database.MultiVersionTableIndices |
table_indices
A multi-version representation of the table indices kept for this table
including the row list and the scheme indices.
|
protected String |
total_hits_key |
Constructor and Description |
---|
V2MasterTableDataSource(TransactionSystem system,
com.mckoi.database.StoreSystem store_system,
com.mckoi.database.OpenTransactionList open_transactions,
BlobStoreInterface blob_store_interface)
The Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
checkAndRepair(String file_name,
UserTerminal terminal)
Performs a complete check and repair of the table.
|
protected void |
clearAllRootLocks()
Clears all root locks on the table.
|
DebugLogger |
Debug()
Returns the DebugLogger object that can be used to log debug messages.
|
protected void |
doOpeningScan()
This is called by the 'open' method.
|
String |
getName()
Returns the name of this table source.
|
String |
getSchema()
Returns the schema name of this table source.
|
TransactionSystem |
getSystem()
Returns the TransactionSystem for this table.
|
TableName |
getTableName()
Returns the TableName of this table source.
|
protected void |
loadInternal()
Loads the internal variables.
|
protected static String |
makeTableFileName(TransactionSystem system,
int table_id,
TableName table_name)
Creates a unique table name to give a file.
|
protected TableDataSource |
minimalTableDataSource(IntegerListInterface master_index)
Creates a minimal TableDataSource object that represents this
MasterTableDataSource.
|
void |
open(String file_name)
Opens an existing master table from the file system at the path of the
conglomerate this belongs to.
|
void |
scanForLeaks()
Looks for any leaks in the file.
|
protected void |
setupDataIndexSetDef()
Sets up the DataIndexSetDef object from the information set in this object.
|
protected void |
setupDataTableDef(DataTableDef table_def)
Sets up the DataTableDef.
|
protected com.mckoi.database.StoreSystem |
storeSystem()
Returns the StoreSystem object used to manage stores in the persistence
system.
|
String |
toString()
For diagnostic.
|
protected int table_id
protected boolean is_closed
protected DataTableDef table_def
protected DataIndexSetDef index_def
protected com.mckoi.database.MultiVersionTableIndices table_indices
protected com.mckoi.database.RIDList[] column_rid_list
protected boolean DATA_CELL_CACHING
protected final com.mckoi.database.DataCellCache cache
protected int column_count
protected com.mckoi.database.MasterTableGarbageCollector garbage_collector
protected BlobStoreInterface blob_store_interface
protected String root_lock_key
protected String total_hits_key
protected String file_hits_key
protected String delete_hits_key
protected String insert_hits_key
public V2MasterTableDataSource(TransactionSystem system, com.mckoi.database.StoreSystem store_system, com.mckoi.database.OpenTransactionList open_transactions, BlobStoreInterface blob_store_interface)
public void open(String file_name) throws IOException
IOException
public void scanForLeaks() throws IOException
Assumes the master table is open.
IOException
public void checkAndRepair(String file_name, UserTerminal terminal) throws IOException
IOException
public final TransactionSystem getSystem()
public final DebugLogger Debug()
public TableName getTableName()
public String getName()
public String getSchema()
protected static String makeTableFileName(TransactionSystem system, int table_id, TableName table_name)
The 'table_id' is a guarenteed unique number between all tables.
protected TableDataSource minimalTableDataSource(IntegerListInterface master_index)
protected void setupDataIndexSetDef()
protected void setupDataTableDef(DataTableDef table_def)
protected void loadInternal()
protected com.mckoi.database.StoreSystem storeSystem()
protected void doOpeningScan() throws IOException
IOException
protected void clearAllRootLocks()
Copyright © 2015. All rights reserved.