org.hsqldb
Class DataFileCache

java.lang.Object
  extended byorg.hsqldb.Cache
      extended byorg.hsqldb.DataFileCache
Direct Known Subclasses:
TextCache

public class DataFileCache
extends org.hsqldb.Cache


Field Summary
protected  int cachedRowPadding
           
protected  org.hsqldb.HsqlDatabaseProperties dbProps
           
protected  Database dDatabase
           
protected  int iFreePos
           
protected  org.hsqldb.ScaledRAFile rFile
           
protected  RowOutputInterface rowOut
           
protected  int rowStoreExtra
           
protected  String sName
           
protected  boolean storeOnInsert
           
 
Method Summary
protected  void init()
          Structural initialisations take place here.
protected  void initBuffers()
           
protected  void initParams()
          initial external parameters are set here.
protected  CachedRow makeRow(int pos, Table t)
          Constructs a new Row for the specified table, using row data read at the specified position (pos) in this object's database file.
protected  CachedRow remove(CachedRow r)
          Removes a Row from this Cache object.
protected  void remove(Table t)
          Removes all Row objects for a table from this Cache object.
protected  void saveAll()
          Writes out all modified cached Rows.
protected  void saveRow(CachedRow r)
          Writes out the specified Row.
protected  void setStorageSize(CachedRow r)
          Calculates the number of bytes required to store a Row in this object's database file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dDatabase

protected Database dDatabase

dbProps

protected org.hsqldb.HsqlDatabaseProperties dbProps

sName

protected String sName

storeOnInsert

protected boolean storeOnInsert

cachedRowPadding

protected int cachedRowPadding

rowStoreExtra

protected int rowStoreExtra

rFile

protected org.hsqldb.ScaledRAFile rFile

iFreePos

protected int iFreePos

rowOut

protected RowOutputInterface rowOut
Method Detail

makeRow

protected CachedRow makeRow(int pos,
                            Table t)
                     throws HsqlException
Constructs a new Row for the specified table, using row data read at the specified position (pos) in this object's database file.

Throws:
HsqlException

saveRow

protected void saveRow(CachedRow r)
                throws IOException,
                       HsqlException
Writes out the specified Row. Will write only the Nodes or both Nodes and table row data depending on what is not already persisted to disk.

Throws:
IOException
HsqlException

setStorageSize

protected void setStorageSize(CachedRow r)
                       throws HsqlException
Calculates the number of bytes required to store a Row in this object's database file.

Throws:
HsqlException

initParams

protected void initParams()
                   throws HsqlException
initial external parameters are set here.

Throws:
HsqlException

init

protected void init()
Structural initialisations take place here. This allows the Cache to be resized while the database is in operation.


initBuffers

protected void initBuffers()
                    throws HsqlException
Throws:
HsqlException

remove

protected void remove(Table t)
               throws HsqlException
Removes all Row objects for a table from this Cache object. This is done when a table is dropped. Necessary because the Rows corresponding to index roots will never be removed otherwise. This doesn't add the Rows to the free list and does not by itself modify the *.data file.

Throws:
HsqlException

remove

protected CachedRow remove(CachedRow r)
                    throws HsqlException
Removes a Row from this Cache object. This is done when there is no room for extra rows to be read from the disk.

Throws:
HsqlException

saveAll

protected void saveAll()
                throws HsqlException
Writes out all modified cached Rows.

Throws:
HsqlException


Copyright © 2001 - 2004 HSQL Development Group. All Rights Reserved.