org.hsqldb.persist
Class TextCache
- java.lang.Object
-
- org.hsqldb.persist.DataFileCache
-
- org.hsqldb.persist.TextCache
-
public class TextCache extends DataFileCache
Acts as a buffer manager for a single TEXT table and 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. fredt - This used to write rows as soon as they are inserted but now this is subject to transaction management. A memory buffer contains the rows not yet committed. Refactored for version 2.2.6.
- Since:
- 1.7.0
-
-
Field Summary
-
Fields inherited from class org.hsqldb.persist.DataFileCache
FLAG_190, FLAG_HX, FLAG_ISSAVED, FLAG_ISSHADOWED, FLAG_ROWINFO, maxDataFileSize, rowOut, spaceManager
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(CachedObject object)voidaddInit(CachedObject object)voidclose()Writes newly created rows to disk.CachedObjectget(CachedObject object, PersistentStore store, boolean keep)cannot use isInMemory() for text cached objectCachedObjectget(long i, PersistentStore store, boolean keep)java.lang.StringgetHeader()intgetLineNumber()TextFileReadergetTextFileReader()TextFileSettingsgetTextFileSettings()booleanisIgnoreFirstLine()voidopen(boolean readonly)Opens a data source file.voidrelease()Abandons changed rows and closes the .data file.voidremove(CachedObject object)Used when a row is deleted as a result of some DML or DDL statement.voidremovePersistence(CachedObject row)voidsaveRow(CachedObject row)The row is always in uncommittedCache.voidsetHeader(java.lang.String header)voidsetHeaderInitialise(java.lang.String header)-
Methods inherited from class org.hsqldb.persist.DataFileCache
adjustStoreCount, bytesCapacity, capacity, enlargeFileSpace, get, getAccessCount, getCachedObjectCount, getDataFileScale, getFileFreePos, getFileName, getFlags, getLostBlockSize, getShadowFile, getStorageSize, getTotalCachedBlockSize, hasRowInfo, isDataReadOnly, isFileModified, isFileOpen, isModified, release, releaseRange, reopen, replace, reset, saveRowOutput
-
-
-
-
Method Detail
-
open
public void open(boolean readonly)
Opens a data source file.- Overrides:
openin classDataFileCache
-
release
public void release()
Description copied from class:DataFileCacheAbandons changed rows and closes the .data file.- Overrides:
releasein classDataFileCache
-
close
public void close()
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.- Overrides:
closein classDataFileCache
-
remove
public void remove(CachedObject object)
Description copied from class:DataFileCacheUsed when a row is deleted as a result of some DML or DDL statement. Removes the row from the cache data structures. Adds the file space for the row to the list of free positions.- Overrides:
removein classDataFileCache
-
removePersistence
public void removePersistence(CachedObject row)
- Overrides:
removePersistencein classDataFileCache
-
addInit
public void addInit(CachedObject object)
-
add
public void add(CachedObject object)
- Overrides:
addin classDataFileCache
-
get
public CachedObject get(CachedObject object, PersistentStore store, boolean keep)
cannot use isInMemory() for text cached object- Overrides:
getin classDataFileCache
-
get
public CachedObject get(long i, PersistentStore store, boolean keep)
- Overrides:
getin classDataFileCache
-
saveRow
public void saveRow(CachedObject row)
The row is always in uncommittedCache. Saves the row as normal and removes it- Overrides:
saveRowin classDataFileCache
-
getHeader
public java.lang.String getHeader()
-
setHeaderInitialise
public void setHeaderInitialise(java.lang.String header)
-
setHeader
public void setHeader(java.lang.String header)
-
getLineNumber
public int getLineNumber()
-
getTextFileSettings
public TextFileSettings getTextFileSettings()
-
isIgnoreFirstLine
public boolean isIgnoreFirstLine()
-
getTextFileReader
public TextFileReader getTextFileReader()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG