@Module public class Table extends BlockStore
Block 0: allocation table
Block 1: table definition
0 - store data
1024 - table data
1024 - index pointers
2048 - CREATE text
Block 2: first data
| Modifier and Type | Field and Description |
|---|---|
static int |
INLINE_BLOB_SIZE |
static byte |
ROW_ALLOC |
static byte |
ROW_MASK |
static byte |
ROW_VALID |
_blockManager, _database, ALLOC_DATA, ALLOC_FREE, ALLOC_INDEX, ALLOC_INODE_PTR, ALLOC_MASK, ALLOC_MINI_FRAG, ALLOC_ROW, BLOCK_BITS, BLOCK_INDEX_MASK, BLOCK_MASK, BLOCK_OFFSET_MASK, BLOCK_SIZE, DATABASE_CORRUPT_EVENT, METADATA_START, MINI_FRAG_ALLOC_OFFSET, MINI_FRAG_PER_BLOCK, MINI_FRAG_SIZE, STORE_CREATE_END| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the store.
|
void |
create()
Creates the table.
|
TableIterator |
createTableIterator() |
Column |
getAutoIncrementColumn()
Returns the auto-increment column.
|
Column |
getColumn(java.lang.String name)
Returns the column for the given column name.
|
int |
getColumnIndex(java.lang.String name)
Returns the column index for the given column name.
|
Column[] |
getColumns() |
Constraint[] |
getConstraints()
Returns the table's constraints.
|
long |
getRowDeleteCount() |
int |
getRowLength()
Returns the length of a row.
|
long |
insert(QueryContext queryContext,
DbTransaction xa,
java.util.ArrayList<Column> columns,
java.util.ArrayList<Expr> values)
Inserts a new row, returning the row address.
|
void |
insertRow(QueryContext queryContext,
DbTransaction xa,
java.util.ArrayList<Column> columns,
java.util.ArrayList<Expr> values,
Block block,
int rowOffset) |
boolean |
isActive()
True if active
|
static Table |
loadFromFile(Database db,
java.lang.String name)
Loads the table from the file.
|
long |
nextAutoIncrement(QueryContext context)
Returns the next auto-increment value.
|
java.lang.String |
toString() |
void |
validate()
Rebuilds the indexes
|
addressToBlockId, allocateBlock, allocateIndexBlock, allocateIndirectBlock, allocateMiniFragment, allocateRow, assertStoreActive, blockIdToAddress, blockIdToAddress, blockIdToIndex, blockIndexToAddr, codeToName, create, create, createMmap, createNoMmap, deallocateBlock, deleteMiniFragment, fatalCorrupted, firstBlock, firstRowBlock, flush, fsync, getAllocation, getAllocationByAddress, getAllocationTable, getBlockCount, getBlockManager, getFileSize, getId, getMmap, getName, getPath, getReadWrite, getTableLock, getWriteLock, init, isClosed, isFlushDirtyBlocksOnCommit, isIndexBlock, isInodePtrBlock, isRowBlock, loadBlock, readBlock, readBlock, readBlock, readBlock, readBlockLong, readBlockNoLock, readLong, readMiniFragment, readMiniFragment, readMiniFragmentLong, readMiniFragmentNoLock, remove, saveAllocation, setEnableMmap, setFlushDirtyBlocksOnCommit, validateBlockId, wakeWriter, writeBlock, writeBlock, writeBlockLong, writeLong, writeMiniFragment, writeMiniFragmentpublic static final int INLINE_BLOB_SIZE
public static final byte ROW_VALID
public static final byte ROW_ALLOC
public static final byte ROW_MASK
public boolean isActive()
BlockStoreisActive in class BlockStorepublic int getRowLength()
public final Column[] getColumns()
public final Constraint[] getConstraints()
public Column getAutoIncrementColumn()
public Column getColumn(java.lang.String name)
name - the column namepublic int getColumnIndex(java.lang.String name)
throws java.sql.SQLException
name - the column namejava.sql.SQLExceptionpublic static Table loadFromFile(Database db, java.lang.String name) throws java.io.IOException, java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic void create()
throws java.io.IOException,
java.sql.SQLException
create in class BlockStorejava.io.IOExceptionjava.sql.SQLExceptionpublic void validate()
throws java.sql.SQLException
java.sql.SQLExceptionpublic TableIterator createTableIterator()
public long nextAutoIncrement(QueryContext context) throws java.sql.SQLException
java.sql.SQLExceptionpublic long insert(QueryContext queryContext, DbTransaction xa, java.util.ArrayList<Column> columns, java.util.ArrayList<Expr> values) throws java.io.IOException, java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic void insertRow(QueryContext queryContext, DbTransaction xa, java.util.ArrayList<Column> columns, java.util.ArrayList<Expr> values, Block block, int rowOffset) throws java.sql.SQLException
java.sql.SQLExceptionpublic long getRowDeleteCount()
public void close()
BlockStoreclose in class BlockStorepublic java.lang.String toString()
toString in class BlockStore