Search in sources :

Example 1 with NodeAVL

use of org.hsqldb_voltpatches.index.NodeAVL in project voltdb by VoltDB.

the class RowAVLDiskData method insertNode.

public NodeAVL insertNode(int index) {
    NodeAVL backnode = getNode(index - 1);
    NodeAVL newnode = new NodeAVLMemoryPointer(this);
    newnode.nNext = backnode.nNext;
    backnode.nNext = newnode;
    return newnode;
}
Also used : NodeAVL(org.hsqldb_voltpatches.index.NodeAVL) NodeAVLMemoryPointer(org.hsqldb_voltpatches.index.NodeAVLMemoryPointer)

Example 2 with NodeAVL

use of org.hsqldb_voltpatches.index.NodeAVL in project voltdb by VoltDB.

the class RowAVLDiskData method setNewNodes.

/**
     *  Used when data is read from the disk into the Cache the first time.
     *  New Nodes are created which are then indexed.
     */
void setNewNodes() {
    int index = tTable.getIndexCount();
    nPrimaryNode = new NodeAVLMemoryPointer(this);
    NodeAVL n = nPrimaryNode;
    for (int i = 1; i < index; i++) {
        n.nNext = new NodeAVLMemoryPointer(this);
        n = n.nNext;
    }
}
Also used : NodeAVL(org.hsqldb_voltpatches.index.NodeAVL) NodeAVLMemoryPointer(org.hsqldb_voltpatches.index.NodeAVLMemoryPointer)

Example 3 with NodeAVL

use of org.hsqldb_voltpatches.index.NodeAVL in project voltdb by VoltDB.

the class RowStoreAVLDisk method getAccessor.

public CachedObject getAccessor(Index key) {
    NodeAVL node = (NodeAVL) accessorList[key.getPosition()];
    if (node == null) {
        return null;
    }
    if (!node.isInMemory()) {
        RowAVL row = (RowAVL) get(node.getPos(), false);
        node = row.getNode(key.getPosition());
        accessorList[key.getPosition()] = node;
    }
    return node;
}
Also used : NodeAVL(org.hsqldb_voltpatches.index.NodeAVL) RowAVL(org.hsqldb_voltpatches.RowAVL)

Example 4 with NodeAVL

use of org.hsqldb_voltpatches.index.NodeAVL in project voltdb by VoltDB.

the class RowAVLDiskData method setPos.

/**
     * Sets the file position for the row and registers the row with
     * the table.
     *
     * @param pos position in data file
     */
public void setPos(int pos) {
    position = pos;
    NodeAVL n = nPrimaryNode;
    while (n != null) {
        ((NodeAVLMemoryPointer) n).iData = position;
        n = n.nNext;
    }
}
Also used : NodeAVL(org.hsqldb_voltpatches.index.NodeAVL)

Example 5 with NodeAVL

use of org.hsqldb_voltpatches.index.NodeAVL in project voltdb by VoltDB.

the class RowAVL method clearNonPrimaryNodes.

public void clearNonPrimaryNodes() {
    NodeAVL n = nPrimaryNode.nNext;
    while (n != null) {
        n.delete();
        n.iBalance = 0;
        n = n.nNext;
    }
}
Also used : NodeAVL(org.hsqldb_voltpatches.index.NodeAVL)

Aggregations

NodeAVL (org.hsqldb_voltpatches.index.NodeAVL)15 RowAVL (org.hsqldb_voltpatches.RowAVL)4 Row (org.hsqldb_voltpatches.Row)2 NodeAVLDisk (org.hsqldb_voltpatches.index.NodeAVLDisk)2 NodeAVLMemoryPointer (org.hsqldb_voltpatches.index.NodeAVLMemoryPointer)2 RowIterator (org.hsqldb_voltpatches.navigator.RowIterator)2 HsqlException (org.hsqldb_voltpatches.HsqlException)1 NodeAVLMemory (org.hsqldb_voltpatches.index.NodeAVLMemory)1