Search in sources :

Example 1 with RowAVLDisk

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;
}
Also used : RowAVLDisk(org.hsqldb_voltpatches.RowAVLDisk) Row(org.hsqldb_voltpatches.Row)

Example 2 with RowAVLDisk

use of org.hsqldb_voltpatches.RowAVLDisk in project voltdb by VoltDB.

the class NodeAVLDisk method getLeft.

NodeAVL getLeft(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.iLeft == NO_POS) {
        return null;
    }
    if (node.nLeft == null || !node.nLeft.isInMemory()) {
        node.nLeft = findNode(store, node.iLeft);
        node.nLeft.nParent = node;
    }
    return node.nLeft;
}
Also used : RowAVLDisk(org.hsqldb_voltpatches.RowAVLDisk)

Example 3 with RowAVLDisk

use of org.hsqldb_voltpatches.RowAVLDisk in project voltdb by VoltDB.

the class NodeAVLDisk method getRight.

NodeAVL getRight(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.iRight == NO_POS) {
        return null;
    }
    if (node.nRight == null || !node.nRight.isInMemory()) {
        node.nRight = findNode(store, node.iRight);
        node.nRight.nParent = node;
    }
    return node.nRight;
}
Also used : RowAVLDisk(org.hsqldb_voltpatches.RowAVLDisk)

Example 4 with RowAVLDisk

use of org.hsqldb_voltpatches.RowAVLDisk in project voltdb by VoltDB.

the class NodeAVLDisk method findNode.

private NodeAVLDisk findNode(PersistentStore store, int pos) {
    NodeAVLDisk ret = null;
    RowAVLDisk r = (RowAVLDisk) store.get(pos, false);
    if (r != null) {
        ret = (NodeAVLDisk) r.getNode(iId);
    }
    return ret;
}
Also used : RowAVLDisk(org.hsqldb_voltpatches.RowAVLDisk)

Example 5 with RowAVLDisk

use of org.hsqldb_voltpatches.RowAVLDisk in project voltdb by VoltDB.

the class NodeAVLDisk method setBalance.

public NodeAVL setBalance(PersistentStore store, int b) {
    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.iBalance = b;
    row.keepInMemory(false);
    return node;
}
Also used : RowAVLDisk(org.hsqldb_voltpatches.RowAVLDisk)

Aggregations

RowAVLDisk (org.hsqldb_voltpatches.RowAVLDisk)10 Row (org.hsqldb_voltpatches.Row)2 RowAVL (org.hsqldb_voltpatches.RowAVL)1