|
|||||||||||
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.BaseTable
org.axiondb.engine.tables.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 String |
_freeIdsFileName
The name of my ".frid" file. |
protected int |
_modCount
|
protected org.apache.commons.collections.primitives.LongList |
_pidx
List of offsets into the .data file, by row id. |
protected String |
_pidxFileName
|
protected int |
_rowCount
|
protected static long |
INVALID_OFFSET
|
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)
|
protected void |
appendLongFile(String file,
long value)
Appends a long value to a file. |
protected void |
appendLongFile(String file,
org.apache.commons.collections.primitives.LongList value)
Appends several long values to a file. |
void |
applyDeletes(org.apache.commons.collections.primitives.IntCollection rowIds)
Remove the specified rows from this table and any associated indices. |
void |
applyInserts(Collection rows)
Insert the given rows into this table and any associated indices. |
protected abstract void |
applyInserts(Iterator rows)
|
void |
applyUpdates(Collection rows)
Update the given rows in this table and any associated indices. |
protected abstract void |
applyUpdates(Iterator rows)
|
protected void |
clearDataFileReference()
|
protected void |
clearMetaFileReference()
|
protected void |
closeFiles()
|
protected void |
createOrLoadDataFile()
|
protected void |
createOrLoadFreeIdsFile()
|
protected void |
createOrLoadMetaFile()
|
protected void |
createOrLoadPidxFile()
|
protected boolean |
deleteFile(File file)
|
void |
drop()
Drop this table from the database. |
void |
freeRowId(int id)
Un-reserve a row id. |
protected String |
getCanonicalPath(File file)
|
protected abstract File |
getDataFile()
|
protected String |
getDefaultDataFileExtension()
|
protected abstract File |
getLobDir()
|
protected File |
getMetaFile()
|
int |
getNextRowId()
Reserve a row id. |
protected RandomAccessFile |
getReadFile()
|
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 File |
getTableFile(String extension)
|
protected RandomAccessFile |
getWriteFile()
|
protected void |
initFiles(File basedir,
boolean datafilesonly)
|
protected void |
initializeRowCount()
|
protected RandomAccessFile |
openFile(File file,
boolean writable)
|
protected org.apache.commons.collections.primitives.IntList |
parseIntFile(File file)
Reads a list of int values from a file. |
protected void |
parseMetaFile(File file)
|
protected void |
parseTableProperties(ObjectInputStream in)
|
void |
populateIndex(Index index)
Populate an Index , adding my current rows to it. |
protected abstract void |
reloadDataFile()
|
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 |
renameFile(File dir,
String old,
String name,
String ext)
|
protected void |
renameTableFiles(String oldName,
String name)
|
protected void |
saveIndices()
|
protected void |
saveIndicesAfterTruncate()
|
protected void |
setPidx(int rowid,
long dataFileOffset)
|
void |
shutdown()
The database is shutting down, shutdown this table also. |
void |
truncate()
Unconditionally delete all rows in this table. |
protected void |
tryToRemove(Iterator iter)
|
protected void |
updateLongFile(RandomAccessFile pidxFile,
long pidxFileOffset,
long dataFileoffset)
Updates a long value to a file. |
protected void |
writeFridFile()
|
protected void |
writeIntFile(String file,
org.apache.commons.collections.primitives.IntList list)
Writes a list of int values to a file. |
protected void |
writeLongFile(String file,
org.apache.commons.collections.primitives.LongList list)
Writes a list of long values to a file. |
protected void |
writeMetaFile(File file)
|
protected void |
writeNameToFile(File file,
Object obj)
|
protected void |
writePidxFile()
|
protected void |
writeTableProperties(ObjectOutputStream out)
|
Methods inherited from class org.axiondb.event.BaseTableModificationPublisher |
addTableModificationListener, getTableModificationListeners, publishEvent, removeTableModificationListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final long INVALID_OFFSET
protected File _dataFile
protected File _dbdir
protected org.apache.commons.collections.primitives.IntList _freeIds
protected String _freeIdsFileName
protected int _modCount
protected org.apache.commons.collections.primitives.LongList _pidx
protected String _pidxFileName
protected int _rowCount
Constructor Detail |
public BaseDiskTable(String name, Database db, TableFactory factory) throws AxionException
Method Detail |
protected abstract void applyInserts(Iterator rows) throws AxionException
AxionException
protected abstract void applyUpdates(Iterator rows) throws AxionException
AxionException
protected abstract File getDataFile()
protected abstract File getLobDir()
protected abstract Row getRowByOffset(int idToAssign, long ptr) throws AxionException
AxionException
protected abstract void reloadDataFile() throws AxionException
AxionException
public void addColumn(Column col) throws AxionException
Table
Column
to this 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(Collection rows) throws AxionException
Table
applyInserts
in interface Table
applyInserts
in class BaseTable
AxionException
public void applyUpdates(Collection rows) throws AxionException
Table
applyUpdates
in interface Table
applyUpdates
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 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
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 truncate() throws AxionException
Table
truncate
in interface Table
AxionException
public void shutdown() throws AxionException
Table
shutdown
in interface Table
shutdown
in class BaseTable
AxionException
protected void appendLongFile(String file, long value) throws AxionException
file
- the File
to append tovalue
- the value to write
AxionException
protected void appendLongFile(String file, org.apache.commons.collections.primitives.LongList value) throws AxionException
file
- the File
to append to
AxionException
protected void updateLongFile(RandomAccessFile pidxFile, long pidxFileOffset, long dataFileoffset) throws AxionException
pidxFileOffset
- the pidx file offset to writedataFileoffset
- data file pointer for a given pidx offset
AxionException
protected void clearDataFileReference()
protected void closeFiles()
protected String getDefaultDataFileExtension()
protected void createOrLoadFreeIdsFile() throws AxionException
AxionException
protected void createOrLoadMetaFile() throws AxionException
AxionException
protected void createOrLoadDataFile() throws AxionException
AxionException
protected void createOrLoadPidxFile() throws AxionException
AxionException
protected boolean deleteFile(File file)
protected String getCanonicalPath(File file) throws AxionException
AxionException
protected File getMetaFile()
protected RandomAccessFile getReadFile() throws AxionException
AxionException
protected File getRootDir()
protected File getTableFile(String extension)
protected RandomAccessFile getWriteFile() throws AxionException
AxionException
protected RandomAccessFile openFile(File file, boolean writable) throws AxionException
AxionException
protected void initFiles(File basedir, boolean datafilesonly) throws AxionException
AxionException
protected void initializeRowCount()
protected org.apache.commons.collections.primitives.IntList parseIntFile(File file) throws AxionException
file
- the File
to read from
AxionException
protected void parseMetaFile(File file) throws AxionException
AxionException
protected void parseTableProperties(ObjectInputStream in) throws AxionException
AxionException
protected void saveIndices() throws AxionException
AxionException
protected void saveIndicesAfterTruncate() throws AxionException
AxionException
protected void tryToRemove(Iterator iter)
protected final void writeFridFile() throws AxionException
AxionException
protected void writeIntFile(String file, org.apache.commons.collections.primitives.IntList list) throws AxionException
file
- the File
to write to
AxionException
protected void writeLongFile(String file, org.apache.commons.collections.primitives.LongList list) throws AxionException
file
- the File
to write to
AxionException
protected void writeMetaFile(File file) throws AxionException
AxionException
protected void writeNameToFile(File file, Object obj) throws AxionException
AxionException
protected final void writePidxFile() throws AxionException
AxionException
protected void writeTableProperties(ObjectOutputStream out) throws AxionException
AxionException
protected void setPidx(int rowid, long dataFileOffset)
protected void clearMetaFileReference()
protected void renameTableFiles(String oldName, String name)
protected void renameFile(File dir, String old, String name, String ext)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |