nonTxnState = new BptTxnState(BPlusTreeParams.RootId, nodeManager.allocLimit(), recordsMgr.allocLimit()) ; break ; case IMMUTABLE_ALL: nonTxnState = new BptTxnState(BPlusTreeParams.RootId, Long.MAX_VALUE, Long.MAX_VALUE) ; break ; case MUTABLE : nonTxnState = new BptTxnState(BPlusTreeParams.RootId, 0, 0) ; break ; case MUTABLE_ROOT : nonTxnState = new BptTxnState(BPlusTreeParams.RootId, 1, 1) ; break ; case TRANSACTIONAL :
public int getRootId() { if ( super.isActiveTxn() ) return super.getDataState().getRoot() ; else return rootIdx ; }
public void newRoot(BPTreeNode newRoot) { if ( isTransactional() ) getDataState().setRoot(newRoot.getId()) ; else rootIdx = newRoot.getId() ; }
@Override final boolean promote() { if ( bpTree.getNodeManager().isWritable(this.getId()) ) return false ; // This calls reset is needed. // The id, records buffer and pointer buffers need resetting if the block changed. boolean promoteInPlace = bpTree.state().modifiableNodeBlock(getId()) ; if ( promoteInPlace ) { bpTree.getNodeManager().promoteInPlace(this) ; return false ; } else { Block oldBlock = block ; boolean b = bpTree.getNodeManager().promoteDuplicate(this) ; if ( b ) { bpTree.getNodeManager().getBlockMgr().release(oldBlock); } return b ; } }
@Override final boolean promote() { if ( bprRecordsMgr.isWritable(getId()) ) return false ; // reset() will be called if necessary. boolean promoteInPlace = (bpTree == null) ? true : bpTree.state().modifiableRecordsBlock(getId()) ; if ( promoteInPlace ) { bprRecordsMgr.promoteInPlace(this) ; if ( getBackingBlock().isReadOnly() ) bprRecordsMgr.getBlockMgr().promote(getBackingBlock()) ; return false ; } else { Block oldBlock = getBackingBlock() ; boolean b = bprRecordsMgr.promoteDuplicate(this) ; if ( b ) bprRecordsMgr.getBlockMgr().release(oldBlock) ; return b ; } }
public void newRoot(BPTreeNode newRoot) { if ( isTransactional() ) getDataState().setRoot(newRoot.getId()) ; else rootIdx = newRoot.getId() ; }
@Override final boolean promote() { if ( bpTree.getNodeManager().isWritable(this.getId()) ) return false ; // This calls reset is needed. // The id, records buffer and pointer buffers need resetting if the block changed. boolean promoteInPlace = bpTree.state().modifiableNodeBlock(getId()) ; if ( promoteInPlace ) { bpTree.getNodeManager().promoteInPlace(this) ; return false ; } else { Block oldBlock = block ; boolean b = bpTree.getNodeManager().promoteDuplicate(this) ; if ( b ) { bpTree.getNodeManager().getBlockMgr().release(oldBlock); } return b ; } }
@Override final boolean promote() { if ( bprRecordsMgr.isWritable(getId()) ) return false ; // reset() will be called if necessary. boolean promoteInPlace = (bpTree == null) ? true : bpTree.state().modifiableRecordsBlock(getId()) ; if ( promoteInPlace ) { bprRecordsMgr.promoteInPlace(this) ; if ( getBackingBlock().isReadOnly() ) bprRecordsMgr.getBlockMgr().promote(getBackingBlock()) ; return false ; } else { Block oldBlock = getBackingBlock() ; boolean b = bprRecordsMgr.promoteDuplicate(this) ; if ( b ) bprRecordsMgr.getBlockMgr().release(oldBlock) ; return b ; } }
@Override protected void _commit(TxnId txnId, BptTxnState state) { if ( isWriteTxn() ) { rootIdx = state.getRoot() ; stateManager.sync(); } }
nonTxnState = new BptTxnState(BPlusTreeParams.RootId, nodeManager.allocLimit(), recordsMgr.allocLimit()) ; break ; case IMMUTABLE_ALL: nonTxnState = new BptTxnState(BPlusTreeParams.RootId, Long.MAX_VALUE, Long.MAX_VALUE) ; break ; case MUTABLE : nonTxnState = new BptTxnState(BPlusTreeParams.RootId, 0, 0) ; break ; case MUTABLE_ROOT : nonTxnState = new BptTxnState(BPlusTreeParams.RootId, 1, 1) ; break ; case TRANSACTIONAL :
public int getRootId() { if ( super.isActiveTxn() ) return super.getDataState().getRoot() ; else return rootIdx ; }
private BptTxnState createState() { return new BptTxnState(rootIdx, nodeManager.allocLimit(), recordsMgr.allocLimit()) ; }
@Override protected void _commit(TxnId txnId, BptTxnState state) { if ( isWriteTxn() ) { rootIdx = state.getRoot() ; stateManager.sync(); } }
private BptTxnState createState() { return new BptTxnState(rootIdx, nodeManager.allocLimit(), recordsMgr.allocLimit()) ; }
private BPTreeNode getRootRead() { if ( isTransactional() ) { super.checkTxn() ; int rootId = super.getDataState().getRoot() ; return nodeManager.getRead(rootId, BPlusTreeParams.RootParent) ; } return nodeManager.getRead(rootIdx, BPlusTreeParams.RootParent) ; }
private BPTreeNode getRootWrite() { if ( isTransactional() ) { super.checkWriteTxn() ; int rootId = super.getDataState().getRoot() ; return nodeManager.getRead(rootId, BPlusTreeParams.RootParent) ; } return nodeManager.getRead(rootIdx, BPlusTreeParams.RootParent) ; }
private BPTreeNode getRootWrite() { if ( isTransactional() ) { super.checkWriteTxn() ; int rootId = super.getDataState().getRoot() ; return nodeManager.getRead(rootId, BPlusTreeParams.RootParent) ; } return nodeManager.getRead(rootIdx, BPlusTreeParams.RootParent) ; }
private BPTreeNode getRootRead() { if ( isTransactional() ) { super.checkTxn() ; int rootId = super.getDataState().getRoot() ; return nodeManager.getRead(rootId, BPlusTreeParams.RootParent) ; } return nodeManager.getRead(rootIdx, BPlusTreeParams.RootParent) ; }
@Override protected ByteBuffer _commitPrepare(TxnId txnId, BptTxnState state) { nodeManager.getBlockMgr().sync(); recordsMgr.getBlockMgr().sync(); long nodeLimit = nodeManager.allocLimit() ; long recordsLimit = recordsMgr.allocLimit() ; // But don't write it yet. stateManager.setState(state.getRoot(), nodeLimit, recordsLimit); return stateManager.getState() ; }
@Override protected ByteBuffer _commitPrepare(TxnId txnId, BptTxnState state) { nodeManager.getBlockMgr().sync(); recordsMgr.getBlockMgr().sync(); long nodeLimit = nodeManager.allocLimit() ; long recordsLimit = recordsMgr.allocLimit() ; // But don't write it yet. stateManager.setState(state.getRoot(), nodeLimit, recordsLimit); return stateManager.getState() ; }