| java.lang.Object org.hsqldb.persist.DataFileCache org.hsqldb.persist.TextCache
TextCache | public class TextCache extends DataFileCache (Code) | | Acts as a buffer manager for a single TEXT table with respect its Row data.
Handles read/write operations on the table's text format data file using a
compatible pair of org.hsqldb.rowio input/output class instances.
author: sqlbob@users (RMP) version: 1.8.0 since: 1.7.0 |
Method Summary | |
public synchronized void | add(CachedObject object) | public void | close(boolean write) Writes newly created rows to disk. | int | findNextUsedLinePos(int pos) Searches from file pointer, pos, and finds the beginning of the first
line that contains any non-space character. | public synchronized CachedObject | get(int i, PersistentStore store, boolean keep) | public String | getHeader() | public int | getLineNumber() | protected void | initBuffers() | protected void | initParams(Database database, String baseFileName) | public void | open(boolean readonly) Opens a data source file. | void | purge() Closes the source file and deletes it if it is not read-only. | public int | readHeaderLine() | protected synchronized RowInputInterface | readObject(int pos) | public synchronized void | remove(int pos, PersistentStore store) | public synchronized void | removePersistence(int pos, PersistentStore store) | void | reopen() | public synchronized void | saveRow(CachedObject row) In case the row has been moved to the uncommittedCache, removes it. | protected synchronized void | saveRows(CachedObject[] rows, int offset, int count) This is called internally when old rows need to be removed from the
cache. | protected void | setFileModified() | public void | setHeader(String header) |
BACKSLASH_CHAR | final static char BACKSLASH_CHAR(Code) | | |
CR_CHAR | final static char CR_CHAR(Code) | | |
DOUBLE_QUOTE_CHAR | final static char DOUBLE_QUOTE_CHAR(Code) | | |
LF_CHAR | final static char LF_CHAR(Code) | | |
ignoreFirst | public boolean ignoreFirst(Code) | | |
isAllQuoted | public boolean isAllQuoted(Code) | | |
isQuoted | public boolean isQuoted(Code) | | |
TextCache | TextCache(Table table, String name) throws HsqlException(Code) | | The source string for a cached table is evaluated and the parameters
are used to open the source file.
Settings are used in this order: (1) settings specified in the
source string for the table (2) global database settings in
.properties file (3) program defaults
fredt - this used to write rows as soon as they are inserted
but now this is subject to session autoCommit / or commit
storeOnInsert = true;
|
close | public void close(boolean write) throws HsqlException(Code) | | Writes newly created rows to disk. In the current implentation,
such rows have already been saved, so this method just removes a
source file that has no rows.
|
findNextUsedLinePos | int findNextUsedLinePos(int pos) throws IOException(Code) | | Searches from file pointer, pos, and finds the beginning of the first
line that contains any non-space character. Increments the row counter
when a blank line is skipped.
If none found return -1
|
getLineNumber | public int getLineNumber()(Code) | | |
initBuffers | protected void initBuffers()(Code) | | |
purge | void purge() throws HsqlException(Code) | | Closes the source file and deletes it if it is not read-only.
|
saveRow | public synchronized void saveRow(CachedObject row) throws IOException(Code) | | In case the row has been moved to the uncommittedCache, removes it.
Then saves the row as normal.
|
saveRows | protected synchronized void saveRows(CachedObject[] rows, int offset, int count) throws IOException(Code) | | This is called internally when old rows need to be removed from the
cache. Text table rows that have not been saved are those that have not
been committed yet. So we don't save them but add them to the
uncommitted cache until such time that they are committed or rolled
back- fredt
|
|
|