(firstOverflowPageId == 0 ? "" : " overflow:" + firstOverflowPageId) +
" keys:" + Arrays.toString(keys) + " offsets:" + Arrays.toString(offsets);
}
public void moveTo(Session session, int newPos) {
PageStore store = index.getPageStore();
// load the pages into the cache, to ensure old pages
// are written
if (parentPageId != ROOT) {
store.getPage(parentPageId);
}
store.logUndo(this, data);
PageDataLeaf p2 = PageDataLeaf.create(index, newPos, parentPageId);
readAllRows();
p2.keys = keys;
p2.overflowRowSize = overflowRowSize;
p2.firstOverflowPageId = firstOverflowPageId;
p2.rowRef = rowRef;
p2.rows = rows;
if (firstOverflowPageId != 0) {
p2.rows[0] = getRowAt(0);
}
p2.entryCount = entryCount;
p2.offsets = offsets;
p2.start = start;
p2.remapChildren(getPos());
p2.writeData();
p2.data.truncate(index.getPageStore().getPageSize());
store.update(p2);
store.free(getPos());
if (parentPageId == ROOT) {
index.setRootPageId(session, newPos);
} else {
PageDataNode p = (PageDataNode) store.getPage(parentPageId);
p.moveChild(getPos(), newPos);
}
}