* (2) if (1) fail, load BTree from disk
* (3) if (2) fail too, create BTree and load it in buffer
* todo fix new btree() problem
*/
public byte[] getPage(int txnId, int treeId, short btreeType, int pgno, boolean redo, ArrayList locks) throws ChaiDBException {
IDBIndex tree;
if (btreeName2Id.getBTreeName(treeId) == null) {
tree = BTreeFactory.createBTree(btreeType);
String btreeFileName = retrieveBTreeFileName(treeId);
tree.openForRecovery(btreeFileName, treeId);
}
PageNumber p = new PageNumber(pgno);
p.setTreeId(treeId);