Top Description Fields Constructors Methods
org.hsqldb

public Class RowAVLDisk

extends RowAVL
Class Inheritance
Known Direct Subclasses
org.hsqldb.RowAVLDiskLarge, org.hsqldb.RowDiskDataChange
Imports
org.hsqldb.error.Error, .ErrorCode, org.hsqldb.index.NodeAVL, .NodeAVLDisk, org.hsqldb.lib.LongLookup, org.hsqldb.persist.PersistentStore, org.hsqldb.rowio.RowInputInterface, .RowOutputInterface

In-memory representation of a disk-based database row object with methods for serialization and de-serialization.

New class derived from Hypersonic SQL code and enhanced in HSQLDB.

Authors
Fred Toussi (fredt@users dot sourceforge dot net), Thomas Mueller (Hypersonic SQL Group)
Since
Hypersonic SQL
Version
2.5.1

Field Summary

Modifier and TypeField and Description
pack-priv boolean
hasDataChanged

Flag indicating unwritten data.

private boolean
hasNodesChanged

Flag indicating Node data has changed.

pack-priv boolean
pack-priv volatile boolean
pack-priv boolean
pack-priv int
public static final int
pack-priv int
Inherited from org.hsqldb.RowAVL:
nPrimaryNode

Constructor Summary

AccessConstructor and Description
public
RowAVLDisk(TableBase
table
t
,
Object[]
row data
o
,
PersistentStore store)

Constructor for new Rows.

public
RowAVLDisk(PersistentStore
store
store
,
RowInputInterface
data source
in
)

Constructor when read from the disk into the Cache.

pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
delete(PersistentStore store)

Overrides org.hsqldb.RowAVL.delete.

No action as references don't need to be removed

public void
destroy()

Overrides org.hsqldb.RowAVL.destroy.

Implements org.hsqldb.persist.CachedObject.destroy.

Helps GC, removing secondary node links.

public int
public int
public int
public TableBase

Returns:

Table
getTable
()

Overrides org.hsqldb.Row.getTable.

Returns the Table to which this Row belongs.

public synchronized boolean

Returns:

boolean
hasChanged
()

Overrides org.hsqldb.Row.hasChanged.

Implements org.hsqldb.persist.CachedObject.hasChanged.

Returns true if Node data has changed.

public NodeAVL
public synchronized boolean
public synchronized boolean

Returns:

boolean
isKeepInMemory
()

Overrides org.hsqldb.Row.isKeepInMemory.

Implements org.hsqldb.persist.CachedObject.isKeepInMemory.

Returns true if any of the Nodes for this row is a root node.

public boolean
public boolean
public synchronized boolean
private void
public synchronized void
public synchronized void
public void
public synchronized void
setNodesChanged()

Sets flag for Node data change.

public void
setPos(long
position in data file
pos
)

Overrides org.hsqldb.Row.setPos.

Implements org.hsqldb.persist.CachedObject.setPos.

Sets the file position for the row

public void
public void
public void
write(RowOutputInterface out)

Overrides org.hsqldb.Row.write.

Implements org.hsqldb.persist.CachedObject.write.

Used exclusively by Cache to save the row to disk.

public void
pack-priv void
writeNodes(RowOutputInterface
row output
out
)

Writes the Nodes, immediately after the row size.

Inherited from org.hsqldb.RowAVL:
clearNonPrimaryNodesgetNextNodegetNoderestore

Field Detail

hasDataChangedback to summary
pack-priv boolean hasDataChanged

Flag indicating unwritten data.

hasNodesChangedback to summary
private boolean hasNodesChanged

Flag indicating Node data has changed.

isFromFileback to summary
pack-priv boolean isFromFile
isInMemoryback to summary
pack-priv volatile boolean isInMemory
isNewback to summary
pack-priv boolean isNew
keepCountback to summary
pack-priv int keepCount
NO_POSback to summary
public static final int NO_POS
storageSizeback to summary
pack-priv int storageSize

Constructor Detail

RowAVLDiskback to summary
public RowAVLDisk(TableBase t, Object[] o, PersistentStore store)

Constructor for new Rows. Variable hasDataChanged is set to true in order to indicate the data needs saving.

Parameters
t:TableBase

table

o:Object[]

row data

RowAVLDiskback to summary
public RowAVLDisk(PersistentStore store, RowInputInterface in)

Constructor when read from the disk into the Cache.

Parameters
store:PersistentStore

store

in:RowInputInterface

data source

RowAVLDiskback to summary
pack-priv RowAVLDisk(TableBase t)

Method Detail

deleteback to summary
public void delete(PersistentStore store)

Overrides org.hsqldb.RowAVL.delete.

No action as references don't need to be removed

destroyback to summary
public void destroy()

Overrides org.hsqldb.RowAVL.destroy.

Implements org.hsqldb.persist.CachedObject.destroy.

Doc from org.hsqldb.RowAVL.destroy.

Helps GC, removing secondary node links. Keeps primary index links to allow iteration.

getAccessCountback to summary
public int getAccessCount()

Overrides org.hsqldb.Row.getAccessCount.

Implements org.hsqldb.persist.CachedObject.getAccessCount.

getRealSizeback to summary
public int getRealSize(RowOutputInterface out)

Overrides org.hsqldb.Row.getRealSize.

Implements org.hsqldb.persist.CachedObject.getRealSize.

getStorageSizeback to summary
public int getStorageSize()

Overrides org.hsqldb.Row.getStorageSize.

Implements org.hsqldb.persist.CachedObject.getStorageSize.

getTableback to summary
public TableBase getTable()

Overrides org.hsqldb.Row.getTable.

Returns the Table to which this Row belongs.

Returns:TableBase

Table

hasChangedback to summary
public synchronized boolean hasChanged()

Overrides org.hsqldb.Row.hasChanged.

Implements org.hsqldb.persist.CachedObject.hasChanged.

Returns true if Node data has changed.

Returns:boolean

boolean

insertNodeback to summary
public NodeAVL insertNode(int index)

Overrides org.hsqldb.RowAVL.insertNode.

isInMemoryback to summary
public synchronized boolean isInMemory()

Overrides org.hsqldb.Row.isInMemory.

Implements org.hsqldb.persist.CachedObject.isInMemory.

isKeepInMemoryback to summary
public synchronized boolean isKeepInMemory()

Overrides org.hsqldb.Row.isKeepInMemory.

Implements org.hsqldb.persist.CachedObject.isKeepInMemory.

Returns true if any of the Nodes for this row is a root node. Used only in Cache.java to avoid removing the row from the cache.

Returns:boolean

boolean

isMemoryback to summary
public boolean isMemory()

Overrides org.hsqldb.Row.isMemory.

Implements org.hsqldb.persist.CachedObject.isMemory.

isNewback to summary
public boolean isNew()

Overrides org.hsqldb.Row.isNew.

Implements org.hsqldb.persist.CachedObject.isNew.

keepInMemoryback to summary
public synchronized boolean keepInMemory(boolean keep)

Overrides org.hsqldb.Row.keepInMemory.

Implements org.hsqldb.persist.CachedObject.keepInMemory.

readRowInfoback to summary
private void readRowInfo(RowInputInterface in)
setChangedback to summary
public synchronized void setChanged(boolean flag)

Overrides org.hsqldb.Row.setChanged.

Implements org.hsqldb.persist.CachedObject.setChanged.

setInMemoryback to summary
public synchronized void setInMemory(boolean in)

Overrides org.hsqldb.Row.setInMemory.

Implements org.hsqldb.persist.CachedObject.setInMemory.

setNewNodesback to summary
public void setNewNodes(PersistentStore store)

Overrides org.hsqldb.RowAVL.setNewNodes.

setNodesChangedback to summary
public synchronized void setNodesChanged()

Sets flag for Node data change.

setPosback to summary
public void setPos(long pos)

Overrides org.hsqldb.Row.setPos.

Implements org.hsqldb.persist.CachedObject.setPos.

Sets the file position for the row

Parameters
pos:long

position in data file

setStorageSizeback to summary
public void setStorageSize(int size)

Overrides org.hsqldb.Row.setStorageSize.

Implements org.hsqldb.persist.CachedObject.setStorageSize.

updateAccessCountback to summary
public void updateAccessCount(int count)

Overrides org.hsqldb.Row.updateAccessCount.

Implements org.hsqldb.persist.CachedObject.updateAccessCount.

writeback to summary
public void write(RowOutputInterface out)

Overrides org.hsqldb.Row.write.

Implements org.hsqldb.persist.CachedObject.write.

Used exclusively by Cache to save the row to disk. New implementation in 1.7.2 writes out only the Node data if the table row data has not changed. This situation accounts for the majority of invocations as for each row deleted or inserted, the Nodes for several other rows will change.

writeback to summary
public void write(RowOutputInterface out, LongLookup lookup)

Overrides org.hsqldb.Row.write.

Implements org.hsqldb.persist.CachedObject.write.

writeNodesback to summary
pack-priv void writeNodes(RowOutputInterface out)

Writes the Nodes, immediately after the row size.

Parameters
out:RowOutputInterface

row output