use of org.hsqldb_voltpatches.index.NodeAVL in project voltdb by VoltDB.
the class RowAVLDisk method setInMemory.
public synchronized void setInMemory(boolean in) {
isInMemory = in;
if (in) {
return;
}
NodeAVL n = nPrimaryNode;
while (n != null) {
n.setInMemory(in);
n = n.nNext;
}
RowAction action = rowAction;
if (action != null) {
action.memoryRow = null;
}
}
use of org.hsqldb_voltpatches.index.NodeAVL in project voltdb by VoltDB.
the class RowAVLDisk method writeNodes.
/**
* Writes the Nodes, immediately after the row size.
*
* @param out
*
* @throws IOException
*/
private void writeNodes(RowOutputInterface out) throws IOException {
out.writeSize(storageSize);
NodeAVL n = nPrimaryNode;
while (n != null) {
n.write(out);
n = n.nNext;
}
hasNodesChanged = false;
}
use of org.hsqldb_voltpatches.index.NodeAVL in project voltdb by VoltDB.
the class RowStoreAVLMemory method insertIndexNodes.
boolean insertIndexNodes(Index primaryIndex, Index newIndex) {
int position = newIndex.getPosition();
RowIterator it = primaryIndex.firstRow(this);
int rowCount = 0;
HsqlException error = null;
try {
while (it.hasNext()) {
Row row = it.getNextRow();
((RowAVL) row).insertNode(position);
// count before inserting
rowCount++;
newIndex.insert(null, this, row);
}
return true;
} catch (java.lang.OutOfMemoryError e) {
error = Error.error(ErrorCode.OUT_OF_MEMORY);
} catch (HsqlException e) {
error = e;
}
// backtrack on error
// rowCount rows have been modified
it = primaryIndex.firstRow(this);
for (int i = 0; i < rowCount; i++) {
Row row = it.getNextRow();
NodeAVL backnode = ((RowAVL) row).getNode(0);
int j = position;
while (--j > 0) {
backnode = backnode.nNext;
}
backnode.nNext = backnode.nNext.nNext;
}
throw error;
}
use of org.hsqldb_voltpatches.index.NodeAVL in project voltdb by VoltDB.
the class RowStoreAVLMemory method dropIndexFromRows.
void dropIndexFromRows(Index primaryIndex, Index oldIndex) {
RowIterator it = primaryIndex.firstRow(this);
int position = oldIndex.getPosition() - 1;
while (it.hasNext()) {
Row row = it.getNextRow();
int i = position - 1;
NodeAVL backnode = ((RowAVL) row).getNode(0);
while (i-- > 0) {
backnode = backnode.nNext;
}
backnode.nNext = backnode.nNext.nNext;
}
}
use of org.hsqldb_voltpatches.index.NodeAVL in project voltdb by VoltDB.
the class RowStoreAVLDisk method setAccessor.
public void setAccessor(Index key, int accessor) {
CachedObject object = get(accessor, false);
if (object != null) {
NodeAVL node = ((RowAVL) object).getNode(key.getPosition());
object = node;
}
setAccessor(key, object);
}
Aggregations