|
|||||||||||
| 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 Columnto 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 Rows 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
AxionExceptionprotected 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
TableColumnto this table.
addColumn in interface TableaddColumn in class BaseTableAxionException
public void addColumn(Column col,
boolean metaUpdateNeeded)
throws AxionException
AxionException
public void addConstraint(Constraint constraint)
throws AxionException
addConstraint in interface TableaddConstraint in class BaseTableAxionException
public void applyDeletes(org.apache.commons.collections.primitives.IntCollection rowIds)
throws AxionException
Table
applyDeletes in interface TableapplyDeletes in class BaseTableAxionException
public void applyInserts(Collection rows)
throws AxionException
Table
applyInserts in interface TableapplyInserts in class BaseTableAxionException
public void applyUpdates(Collection rows)
throws AxionException
Table
applyUpdates in interface TableapplyUpdates in class BaseTableAxionException
public void drop()
throws AxionException
Table
drop in interface Tabledrop in class BaseTableAxionExceptionpublic void freeRowId(int id)
Table
freeRowId in interface TablefreeRowId in class BaseTablepublic int getNextRowId()
Table
getNextRowId in interface TablegetNextRowId in class BaseTable
public Row getRow(int id)
throws AxionException
getRow in interface RowSourcegetRow in class BaseTableAxionExceptionpublic int getRowCount()
TableRows I contain.
getRowCount in interface TablegetRowCount in class BaseTable
public void populateIndex(Index index)
throws AxionException
TableIndex, adding my current rows to it. Does not
addthe index.
populateIndex in interface TablepopulateIndex in class BaseTableAxionException
public void remount(File newdir,
boolean datafilesonly)
throws AxionException
Table
remount in interface Tableremount in class BaseTableAxionException
public void removeIndex(Index index)
throws AxionException
Table
removeIndex in interface TableremoveIndex in class BaseTableAxionException
public void rename(String oldName,
String newName)
throws AxionException
rename in interface Tablerename in class BaseTableAxionException
public void truncate()
throws AxionException
Table
truncate in interface TableAxionException
public void shutdown()
throws AxionException
Table
shutdown in interface Tableshutdown in class BaseTableAxionException
protected void appendLongFile(String file,
long value)
throws AxionException
file - the Fileto append tovalue - the value to write
AxionException
protected void appendLongFile(String file,
org.apache.commons.collections.primitives.LongList value)
throws AxionException
file - the Fileto 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
AxionExceptionprotected 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
AxionExceptionprotected boolean deleteFile(File file)
protected String getCanonicalPath(File file)
throws AxionException
AxionExceptionprotected File getMetaFile()
protected RandomAccessFile getReadFile()
throws AxionException
AxionExceptionprotected 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
AxionExceptionprotected void initializeRowCount()
protected org.apache.commons.collections.primitives.IntList parseIntFile(File file)
throws AxionException
file - the Fileto 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
AxionExceptionprotected 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 Fileto write to
AxionException
protected void writeLongFile(String file,
org.apache.commons.collections.primitives.LongList list)
throws AxionException
file - the Fileto 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 | ||||||||||