org.axiondb.engine.tables

Class BaseDiskTable

public abstract class BaseDiskTable extends BaseTable implements Table

Abstract base disk-resident implementation of Table. BaseDiskTable manages the column meta-data for a disk-based table.

Version: $Revision: 1.36 $ $Date: 2005/12/22 09:02:31 $

Author: Chuck Burdick Rodney Waldhoff Ahimanikya Satapathy

Field Summary
protected File_dataFile
The name of my ".data" file.
protected File_dbdir
protected IntList_freeIds
List of free ids.
protected boolean_readOnly
protected int_rowCount
protected static intCURRENT_META_VERSION
protected static StringFRID_FILE_EXT
protected static AxionFileSystemFS
protected static StringINDICES_DIR_NAME
protected static longINVALID_OFFSET
protected static StringMETA_FILE_EXT
protected static StringPIDX_FILE_EXT
protected static StringSEQ_FILE_EXT
protected static StringTYPE_FILE_EXT
Constructor Summary
BaseDiskTable(String name, Database db, TableFactory factory)
Method Summary
voidaddColumn(Column col)
voidaddColumn(Column col, boolean metaUpdateNeeded)
voidaddConstraint(Constraint constraint)
voidapplyDeletes(IntCollection rowIds)
voidapplyInserts(RowCollection rows)
voidapplyUpdates(RowCollection rows)
voidcheckpoint()
protected voidclearDataFileReference()
protected voidcloseFiles()
protected voidcreateOrLoadDataFile()
protected voidcreateOrLoadFreeIdsFile()
voiddrop()
voidfreeRowId(int id)
protected abstract FilegetDataFile()
protected StringgetDefaultDataFileExtension()
protected BufferedDataInputStreamgetInputStream()
protected abstract FilegetLobDir()
intgetNextRowId()
protected BufferedDataOutputStreamgetOutputStream()
protected AxionFileSystem.PidxListgetPidxList()
protected FilegetRootDir()
RowgetRow(int id)
protected abstract RowgetRowByOffset(int idToAssign, long ptr)
intgetRowCount()
protected RowIteratorgetRowIterator()
protected FilegetTableFile(String extension)
protected voidinitFiles(File basedir, boolean datafilesonly)
protected voidinitializeRowCount()
protected booleanisReadOnly()
protected voidloadOrMigrateMetaFile(Database db)
voidmigrate(Database db)
Migrate from older version to newer version for this table
protected AxionFileSystem.PidxListparsePidxFile(File pidxFile)
protected voidparseTableProperties(ObjectInputStream in)
voidpopulateIndex(Index index)
protected abstract voidreloadFilesAfterTruncate()
voidremount(File newdir, boolean datafilesonly)
voidremoveIndex(Index index)
voidrename(String oldName, String newName)
protected voidrenameTableFiles(String oldName, String name)
protected voidresetLobColumns()
protected voidsaveIndicesAfterTruncate()
voidsetSequence(Sequence seq)
voidshutdown()
voidtruncate()
protected voidtryToRemove(RowIterator iter)
protected voidwriteFridFile()
protected voidwriteMetaFile()
protected voidwriteNameToFile(File file, Object obj)
protected abstract voidwriteRow(BufferedDataOutputStream buffer, Row row)
protected voidwriteTableProperties(ObjectOutputStream out)

Field Detail

_dataFile

protected File _dataFile
The name of my ".data" file.

_dbdir

protected File _dbdir

_freeIds

protected IntList _freeIds
List of free ids.

_readOnly

protected boolean _readOnly

_rowCount

protected int _rowCount

CURRENT_META_VERSION

protected static final int CURRENT_META_VERSION

FRID_FILE_EXT

protected static final String FRID_FILE_EXT

FS

protected static AxionFileSystem FS

INDICES_DIR_NAME

protected static final String INDICES_DIR_NAME

INVALID_OFFSET

protected static final long INVALID_OFFSET

META_FILE_EXT

protected static final String META_FILE_EXT

PIDX_FILE_EXT

protected static final String PIDX_FILE_EXT

SEQ_FILE_EXT

protected static final String SEQ_FILE_EXT

TYPE_FILE_EXT

protected static final String TYPE_FILE_EXT

Constructor Detail

BaseDiskTable

public BaseDiskTable(String name, Database db, TableFactory factory)

Method Detail

addColumn

public void addColumn(Column col)

addColumn

public void addColumn(Column col, boolean metaUpdateNeeded)

addConstraint

public void addConstraint(Constraint constraint)

applyDeletes

public void applyDeletes(IntCollection rowIds)

applyInserts

public void applyInserts(RowCollection rows)

applyUpdates

public void applyUpdates(RowCollection rows)

checkpoint

public void checkpoint()

clearDataFileReference

protected void clearDataFileReference()

closeFiles

protected void closeFiles()

createOrLoadDataFile

protected void createOrLoadDataFile()

createOrLoadFreeIdsFile

protected void createOrLoadFreeIdsFile()

drop

public void drop()

freeRowId

public void freeRowId(int id)

getDataFile

protected abstract File getDataFile()

getDefaultDataFileExtension

protected String getDefaultDataFileExtension()

getInputStream

protected BufferedDataInputStream getInputStream()

getLobDir

protected abstract File getLobDir()

getNextRowId

public int getNextRowId()

getOutputStream

protected BufferedDataOutputStream getOutputStream()

getPidxList

protected AxionFileSystem.PidxList getPidxList()

getRootDir

protected File getRootDir()

getRow

public Row getRow(int id)

getRowByOffset

protected abstract Row getRowByOffset(int idToAssign, long ptr)

getRowCount

public int getRowCount()

getRowIterator

protected RowIterator getRowIterator()

getTableFile

protected File getTableFile(String extension)

initFiles

protected void initFiles(File basedir, boolean datafilesonly)

initializeRowCount

protected void initializeRowCount()

isReadOnly

protected boolean isReadOnly()

loadOrMigrateMetaFile

protected void loadOrMigrateMetaFile(Database db)

migrate

public void migrate(Database db)
Migrate from older version to newer version for this table

parsePidxFile

protected AxionFileSystem.PidxList parsePidxFile(File pidxFile)

parseTableProperties

protected void parseTableProperties(ObjectInputStream in)

populateIndex

public void populateIndex(Index index)

reloadFilesAfterTruncate

protected abstract void reloadFilesAfterTruncate()

remount

public void remount(File newdir, boolean datafilesonly)

removeIndex

public void removeIndex(Index index)

rename

public void rename(String oldName, String newName)

renameTableFiles

protected void renameTableFiles(String oldName, String name)

resetLobColumns

protected void resetLobColumns()

saveIndicesAfterTruncate

protected void saveIndicesAfterTruncate()

setSequence

public void setSequence(Sequence seq)

shutdown

public void shutdown()

truncate

public void truncate()

tryToRemove

protected void tryToRemove(RowIterator iter)

writeFridFile

protected final void writeFridFile()

writeMetaFile

protected void writeMetaFile()

writeNameToFile

protected void writeNameToFile(File file, Object obj)

writeRow

protected abstract void writeRow(BufferedDataOutputStream buffer, Row row)

writeTableProperties

protected void writeTableProperties(ObjectOutputStream out)