Debug.pageHistory(op);
}
String details = e.toString() + ". nodeoffset=0x" + Integer.toHexString(nodeOffset) + " keysize=0x" + Integer.toHexString(keySize) + " pg=0x" + Integer.toHexString(overflowPage.pageNumber.getPageNumber()) + " of file " + PageBufferManager.getInstance().getBTreeName(overflowPage.pageNumber.getTreeId()) + ".";
throw new ChaiDBException(ErrorCode.BTREE_BUFFER_OVERFLOW, details);
}
// unfix / release the overflow page
page.buffer.releasePage(pageNumber.getTreeId(), overflowPage.pageNumber, false);
keyStartPos += keyLength;
keyLeft -= keyLength;
if (keyLeft > 0 && overflowPage.nextPage.getPageNumber() > 0) {
overflowPage = new BTreePage(pageNumber.getTreeId(), overflowPage.nextPage, page.btreeSpec, page.buffer);
dataLength = page.btreeSpec.getPageSize() - overflowPage.upperBound;
keyLength = (keyLeft < dataLength) ? keyLeft : dataLength;
} else if (keyLeft > 0 && overflowPage.nextPage.getPageNumber() <= 0) {
logger.error("[" + Thread.currentThread().getName() + "] time=" + System.currentTimeMillis() + " node offset=0x" + Integer.toHexString(getNodeOffset()) + " keyLeft=0x" + Integer.toHexString(keyLeft) + " keySize=0x" + Integer.toHexString(keySize) + " node pageNumber=0x" + Integer.toHexString(page.pageNumber.getPageNumber()) + " overflowpage=0x" + Integer.toHexString(overflowPage.pageNumber.getPageNumber()) + " of " + page.buffer.getBTreeName(overflowPage.pageNumber.getTreeId()));
for (int i = 0; i < v.size(); i++) {
PageNumber op = (PageNumber) v.get(i);
Debug.dumpPage(op, page.buffer.getPage(page.pageNumber.getTreeId(), page.pageNumber));
}
//page in mem!
Debug.dumpPage(page.pageNumber, page.buffer.getPage(page.pageNumber.getTreeId(), page.pageNumber));
//page we have got!
Debug.dumpPage(page.pageNumber, ByteTool.append(new String("Error??\r\n").getBytes(), page.getPage()));
Debug.flushPages();
// details -ranjeet
String details = "Non-match key length in overflow page. The node page number is " + pageNumber.toString() + ".";
throw new ChaiDBException(ErrorCode.DATA_LENGTH_NOT_MATCH, details);
}
}
}
return KeyFactory.createInstance((int) page.getKeyType(), key);
}