}
@Override
protected Record rebalance(int id1, Record r1, int id2, Record r2)
{
RecordBufferPageMgr mgr = bpt.getRecordsMgr().getRecordBufferPageMgr() ;
RecordBufferPage page1 = mgr.getWrite(id1) ;
RecordBufferPage page2 = mgr.getWrite(id2) ;
// Wrong calculatation.
for ( int i = page2.getCount() ; i < page1.getMaxSize()/2 ; i++ )
{
//shiftOneup(node1, node2) ;
Record r = page1.getRecordBuffer().getHigh() ;
page1.getRecordBuffer().removeTop() ;
page2.getRecordBuffer().add(0, r) ;
}
mgr.put(page1) ;
mgr.put(page2) ;
Record splitPoint = page1.getRecordBuffer().getHigh() ;
splitPoint = bpt.getRecordFactory().createKeyOnly(splitPoint) ;
//Record splitPoint = node1.maxRecord() ;
return splitPoint ;