use of org.hsqldb_voltpatches.RowAVLDisk in project voltdb by VoltDB.
the class NodeAVLDisk method setRight.
NodeAVL setRight(PersistentStore store, NodeAVL n) {
NodeAVLDisk node = this;
RowAVLDisk row = this.row;
if (!row.keepInMemory(true)) {
row = (RowAVLDisk) store.get(this.row, true);
node = (NodeAVLDisk) row.getNode(iId);
}
if (!row.isInMemory()) {
throw Error.runtimeError(ErrorCode.U_S0500, "NAVLD");
}
row.setNodesChanged();
node.iRight = n == null ? NO_POS : n.getPos();
if (n != null && !n.isInMemory()) {
n = findNode(store, n.getPos());
}
node.nRight = (NodeAVLDisk) n;
row.keepInMemory(false);
return node;
}
use of org.hsqldb_voltpatches.RowAVLDisk in project voltdb by VoltDB.
the class RowStoreAVLDisk method getNewCachedObject.
public CachedObject getNewCachedObject(Session session, Object object) {
Row row = new RowAVLDisk(table, (Object[]) object);
add(row);
if (session != null) {
RowAction.addAction(session, RowAction.ACTION_INSERT, table, row);
}
return row;
}
use of org.hsqldb_voltpatches.RowAVLDisk in project voltdb by VoltDB.
the class NodeAVLDisk method setParent.
NodeAVL setParent(PersistentStore store, NodeAVL n) {
NodeAVLDisk node = this;
RowAVLDisk row = this.row;
if (!row.keepInMemory(true)) {
row = (RowAVLDisk) store.get(this.row, true);
node = (NodeAVLDisk) row.getNode(iId);
}
if (!row.isInMemory()) {
throw Error.runtimeError(ErrorCode.U_S0500, "NAVLD");
}
row.setNodesChanged();
node.iParent = n == null ? NO_POS : n.getPos();
if (n != null && !n.isInMemory()) {
n = findNode(store, n.getPos());
}
node.nParent = (NodeAVLDisk) n;
row.keepInMemory(false);
return node;
}
use of org.hsqldb_voltpatches.RowAVLDisk in project voltdb by VoltDB.
the class NodeAVLDisk method getParent.
NodeAVL getParent(PersistentStore store) {
NodeAVLDisk node = this;
RowAVLDisk row = this.row;
if (!row.isInMemory()) {
row = (RowAVLDisk) store.get(this.row, false);
node = (NodeAVLDisk) row.getNode(iId);
}
if (node.iParent == NO_POS) {
return null;
}
if (node.nParent == null || !node.nParent.isInMemory()) {
node.nParent = findNode(store, iParent);
}
return node.nParent;
}
use of org.hsqldb_voltpatches.RowAVLDisk in project voltdb by VoltDB.
the class RowStoreAVLHybrid method getNewCachedObject.
public CachedObject getNewCachedObject(Session session, Object object) {
if (isCached) {
Row row = new RowAVLDisk(table, (Object[]) object);
add(row);
if (isTempTable) {
RowAction.addAction(session, RowAction.ACTION_INSERT, (Table) table, row);
}
return row;
} else {
memoryRowCount++;
if (useCache && memoryRowCount > maxMemoryRowCount) {
changeToDiskTable();
return getNewCachedObject(session, object);
}
Row row = new RowAVL(table, (Object[]) object);
int id = rowIdSequence++;
row.setPos(id);
rowIdMap.put(id, row);
if (isTempTable) {
RowAction.addAction(session, RowAction.ACTION_INSERT, (Table) table, row);
}
return row;
}
}
Aggregations