|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.axiondb.event.BaseTableModificationPublisher
org.axiondb.engine.tables.AbstractBaseTable
org.axiondb.engine.tables.BaseTable
org.axiondb.engine.tables.BaseDiskTable
public abstract class BaseDiskTable
Abstract base disk-resident implementation of Table
.
BaseDiskTable
manages the column meta-data for a disk-based table.
Field Summary | |
---|---|
protected File |
_dataFile
The name of my ".data" file. |
protected File |
_dbdir
|
protected org.apache.commons.collections.primitives.IntList |
_freeIds
List of free ids. |
protected boolean |
_readOnly
|
protected int |
_rowCount
|
protected static int |
CURRENT_META_VERSION
|
protected static String |
FRID_FILE_EXT
|
protected static AxionFileSystem |
FS
|
protected static String |
INDICES_DIR_NAME
|
protected static long |
INVALID_OFFSET
|
protected static String |
META_FILE_EXT
|
protected static String |
PIDX_FILE_EXT
|
protected static String |
SEQ_FILE_EXT
|
protected static String |
TYPE_FILE_EXT
|
Fields inherited from interface org.axiondb.Table |
---|
REGULAR_TABLE_TYPE, SYSTEM_TABLE_TYPE |
Constructor Summary | |
---|---|
BaseDiskTable(String name,
Database db,
TableFactory factory)
|
Method Summary | |
---|---|
void |
addColumn(Column col)
Add the given Column to this table. |
void |
addColumn(Column col,
boolean metaUpdateNeeded)
|
void |
addConstraint(Constraint constraint)
|
void |
applyDeletes(org.apache.commons.collections.primitives.IntCollection rowIds)
Remove the specified rows from this table and any associated indices. |
void |
applyInserts(RowCollection rows)
Insert the given rows into this table and any associated indices. |
void |
applyUpdates(RowCollection rows)
Update the given rows in this table and any associated indices. |
void |
checkpoint()
|
protected void |
clearDataFileReference()
|
protected void |
closeFiles()
|
protected void |
createOrLoadDataFile()
|
protected void |
createOrLoadFreeIdsFile()
|
void |
drop()
Drop this table from the database. |
void |
freeRowId(int id)
Un-reserve a row id. |
protected abstract File |
getDataFile()
|
protected String |
getDefaultDataFileExtension()
|
protected BufferedDataInputStream |
getInputStream()
|
protected abstract File |
getLobDir()
|
int |
getNextRowId()
Reserve a row id. |
protected BufferedDataOutputStream |
getOutputStream()
|
protected AxionFileSystem.PidxList |
getPidxList()
|
protected File |
getRootDir()
|
Row |
getRow(int id)
|
protected abstract Row |
getRowByOffset(int idToAssign,
long ptr)
|
int |
getRowCount()
Return the number of Row s I contain. |
protected RowIterator |
getRowIterator()
|
protected File |
getTableFile(String extension)
|
protected void |
initFiles(File basedir,
boolean datafilesonly)
|
protected void |
initializeRowCount()
|
protected boolean |
isReadOnly()
|
protected void |
loadOrMigrateMetaFile(Database db)
|
void |
migrate(Database db)
Migrate from older version to newer version for this table |
protected AxionFileSystem.PidxList |
parsePidxFile(File pidxFile)
|
protected void |
parseTableProperties(ObjectInputStream in)
|
void |
populateIndex(Index index)
Populate an Index , adding my current rows to it. |
protected abstract void |
reloadFilesAfterTruncate()
|
void |
remount(File newdir,
boolean datafilesonly)
Notify this table that its disk-location has moved. |
void |
removeIndex(Index index)
Remove an index, both from the indices and as a TableModificationListener |
void |
rename(String oldName,
String newName)
|
protected void |
renameTableFiles(String oldName,
String name)
|
protected void |
resetLobColumns()
|
protected void |
saveIndicesAfterTruncate()
|
void |
setSequence(Sequence seq)
|
void |
shutdown()
The database is shutting down, shutdown this table also. |
void |
truncate()
Unconditionally delete all rows in this table. |
protected void |
tryToRemove(RowIterator iter)
|
protected void |
writeFridFile()
|
protected void |
writeMetaFile()
|
protected void |
writeNameToFile(File file,
Object obj)
|
protected abstract void |
writeRow(BufferedDataOutputStream buffer,
Row row)
|
protected void |
writeTableProperties(ObjectOutputStream out)
|
Methods inherited from class org.axiondb.engine.tables.AbstractBaseTable |
---|
checkConstraints, checkConstraints, checkConstraints, getMatchingRows, hasDeferredConstraint, isDeferAll, migrate |
Methods inherited from class org.axiondb.event.BaseTableModificationPublisher |
---|
addTableModificationListener, getTableModificationListeners, publishEvent, removeTableModificationListener, setDeferAllConstraints |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static AxionFileSystem FS
protected static final long INVALID_OFFSET
protected static final int CURRENT_META_VERSION
protected static final String FRID_FILE_EXT
protected static final String INDICES_DIR_NAME
protected static final String META_FILE_EXT
protected static final String PIDX_FILE_EXT
protected static final String SEQ_FILE_EXT
protected static final String TYPE_FILE_EXT
protected File _dataFile
protected File _dbdir
protected org.apache.commons.collections.primitives.IntList _freeIds
protected boolean _readOnly
protected int _rowCount
Constructor Detail |
---|
public BaseDiskTable(String name, Database db, TableFactory factory) throws AxionException
AxionException
Method Detail |
---|
public void addColumn(Column col) throws AxionException
BaseTable
Column
to this table. This implementation throws an
AxionException
if rows have already been added to the table.
addColumn
in interface Table
addColumn
in class BaseTable
AxionException
public void addColumn(Column col, boolean metaUpdateNeeded) throws AxionException
AxionException
public void addConstraint(Constraint constraint) throws AxionException
addConstraint
in interface Table
addConstraint
in class BaseTable
AxionException
public void applyDeletes(org.apache.commons.collections.primitives.IntCollection rowIds) throws AxionException
Table
applyDeletes
in interface Table
applyDeletes
in class BaseTable
AxionException
public void applyInserts(RowCollection rows) throws AxionException
Table
applyInserts
in interface Table
applyInserts
in class BaseTable
rows
- a collection of Rows
AxionException
public void applyUpdates(RowCollection rows) throws AxionException
Table
applyUpdates
in interface Table
applyUpdates
in class BaseTable
AxionException
public void checkpoint() throws AxionException
checkpoint
in interface Table
checkpoint
in class BaseTable
AxionException
public void drop() throws AxionException
Table
drop
in interface Table
drop
in class BaseTable
AxionException
public void freeRowId(int id)
Table
freeRowId
in interface Table
freeRowId
in class BaseTable
public int getNextRowId()
Table
getNextRowId
in interface Table
getNextRowId
in class BaseTable
public Row getRow(int id) throws AxionException
getRow
in interface RowSource
getRow
in class BaseTable
AxionException
public void migrate(Database db) throws AxionException
AxionException
public int getRowCount()
Table
Row
s I contain.
getRowCount
in interface Table
getRowCount
in class BaseTable
public void populateIndex(Index index) throws AxionException
Table
Index
, adding my current rows to it. Does not
add
the index.
populateIndex
in interface Table
populateIndex
in class BaseTable
AxionException
Table.addIndex(org.axiondb.Index)
public void remount(File newdir, boolean datafilesonly) throws AxionException
Table
remount
in interface Table
remount
in class BaseTable
AxionException
public void removeIndex(Index index) throws AxionException
Table
removeIndex
in interface Table
removeIndex
in class BaseTable
AxionException
public void rename(String oldName, String newName) throws AxionException
rename
in interface Table
rename
in class BaseTable
AxionException
public void setSequence(Sequence seq) throws AxionException
setSequence
in interface Table
setSequence
in class BaseTable
AxionException
public void shutdown() throws AxionException
Table
shutdown
in interface Table
shutdown
in class BaseTable
AxionException
public void truncate() throws AxionException
Table
truncate
in interface Table
AxionException
protected void clearDataFileReference()
protected void closeFiles()
protected void createOrLoadDataFile() throws AxionException
AxionException
protected void createOrLoadFreeIdsFile() throws AxionException
AxionException
protected void loadOrMigrateMetaFile(Database db) throws AxionException
AxionException
protected abstract File getDataFile()
protected String getDefaultDataFileExtension()
protected BufferedDataInputStream getInputStream() throws AxionException
AxionException
protected abstract File getLobDir()
protected BufferedDataOutputStream getOutputStream() throws AxionException
AxionException
protected AxionFileSystem.PidxList getPidxList()
protected File getRootDir()
protected RowIterator getRowIterator() throws AxionException
getRowIterator
in class BaseTable
AxionException
protected abstract Row getRowByOffset(int idToAssign, long ptr) throws AxionException
AxionException
protected File getTableFile(String extension)
protected boolean isReadOnly()
protected void initFiles(File basedir, boolean datafilesonly) throws AxionException
AxionException
protected void initializeRowCount() throws AxionException
AxionException
protected AxionFileSystem.PidxList parsePidxFile(File pidxFile) throws AxionException
AxionException
protected void parseTableProperties(ObjectInputStream in) throws AxionException
AxionException
protected abstract void reloadFilesAfterTruncate() throws AxionException
AxionException
protected void renameTableFiles(String oldName, String name)
protected void saveIndicesAfterTruncate() throws AxionException
AxionException
protected void tryToRemove(RowIterator iter) throws AxionException
AxionException
protected final void writeFridFile() throws AxionException
AxionException
protected void writeMetaFile() throws AxionException
AxionException
protected void writeNameToFile(File file, Object obj) throws AxionException
AxionException
protected abstract void writeRow(BufferedDataOutputStream buffer, Row row) throws AxionException
AxionException
protected void writeTableProperties(ObjectOutputStream out) throws AxionException
AxionException
protected void resetLobColumns() throws AxionException
AxionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |