Class BPlusTree.Remove
- All Implemented Interfaces:
ReuseBag
- Direct Known Subclasses:
BPlusTree.RemoveRange
Remove operation.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddFreePage(long pageId) protected final org.apache.ignite.internal.persistence.tree.BPlusTree.Tail<L>final booleancanRelease(long pageId, int lvl) protected booleanceil()protected final booleancheckTailLevel(int rootLvl) protected final voiddoReleaseTail(org.apache.ignite.internal.persistence.tree.BPlusTree.Tail<L> t) protected voidprotected BPlusTree.Resultprotected BPlusTree.Resultfinish(BPlusTree.Result res) Finish the operation.protected BPlusTree.ResultfinishOrLockTail(long pageId, long page, long backId, long fwdId, int lvl) Method that's invoked when operation goes up from the recursion andBPlusTree.Get.isFinished()returns false.protected BPlusTree.ResultProcess tail and finish.protected final org.apache.ignite.internal.persistence.tree.BPlusTree.Tail<L>protected final intinsertionPoint(org.apache.ignite.internal.persistence.tree.BPlusTree.Tail<L> tail) booleanisEmpty()protected booleanprotected final booleanisTail(long pageId, int lvl) protected BPlusTree.ResultlockForward(int lvl) longprotected final StringprintTail(boolean keys) protected booleanreleaseForRetry(org.apache.ignite.internal.persistence.tree.BPlusTree.Tail<L> t) protected final voidRelease pages for all locked levels at the tail.protected voidremoveDataRowFromLeaf(long pageId, long page, long pageAddr, Boolean walPlc, BPlusIO<L> io, int cnt, int idx) Methods inherited from class org.apache.ignite.internal.persistence.tree.BPlusTree.Get
row
-
Method Details
-
pollFreePage
public long pollFreePage()- Specified by:
pollFreePagein interfaceReuseBag- Returns:
- Free page ID for reuse or
0if empty.
-
addFreePage
public void addFreePage(long pageId) - Specified by:
addFreePagein interfaceReuseBag- Parameters:
pageId- Free page ID for reuse.
-
isEmpty
public boolean isEmpty() -
ceil
protected boolean ceil()- Returns:
- Flag indicating that values are removed using an interval
(i.e.
BPlusTree.Get.rowspecifies the start of the interval, not an exact match).
-
finish
Finish the operation. -
isRemoved
protected boolean isRemoved()- Returns:
trueIf already removed from leaf.
-
releaseForRetry
protected boolean releaseForRetry(org.apache.ignite.internal.persistence.tree.BPlusTree.Tail<L> t) throws IgniteCheckedException - Parameters:
t- Tail to release.- Returns:
trueIf we need to retry orfalseto exit.- Throws:
IgniteCheckedException
-
finishTail
Process tail and finish. Same asfinishOrLockTail(long, long, long, long, int)but doesn't add the page to the tail.- Returns:
- Result.
- Throws:
IgniteCheckedException- If failed.
-
doRemoveFromLeaf
- Returns:
- Result code.
- Throws:
IgniteCheckedException- If failed.
-
lockForward
- Parameters:
lvl- Level.- Returns:
- Result code.
- Throws:
IgniteCheckedException- If failed.
-
removeDataRowFromLeaf
protected void removeDataRowFromLeaf(long pageId, long page, long pageAddr, Boolean walPlc, BPlusIO<L> io, int cnt, int idx) throws IgniteCheckedException - Parameters:
pageId- Page ID.page- Page pointer.pageAddr- Page address.walPlc- Full page WAL record policy.io- IO.cnt- Count.idx- Index to remove.- Throws:
IgniteCheckedException- If failed.
-
doRemove
protected void doRemove(long pageId, long page, long pageAddr, Boolean walPlc, BPlusIO<L> io, int cnt, int idx) throws IgniteCheckedException - Parameters:
pageId- Page ID.page- Page pointer.pageAddr- Page address.walPlc- Full page WAL record policy.io- IO.cnt- Count.idx- Index to remove.- Throws:
IgniteCheckedException- If failed.
-
finishOrLockTail
protected BPlusTree.Result finishOrLockTail(long pageId, long page, long backId, long fwdId, int lvl) throws IgniteCheckedException Method that's invoked when operation goes up from the recursion andBPlusTree.Get.isFinished()returns false. Either finishes the operation or locks the page for further processing on another level. ReturnsBPlusTree.Result.FOUNDif operation has finished andBPlusTree.Get.isFinished()returnstruenow. ReturnsBPlusTree.Result.RETRYif operation should be retried. ReturnsBPlusTree.Result.NOT_FOUNDif operation has added the page to tail, meaning that operation can't be finished on current level.- Parameters:
pageId- Page ID.page- Page pointer.backId- Back page ID.fwdId- Forward ID.lvl- Level.- Returns:
- Result.
- Throws:
IgniteCheckedException- If failed.
-
releaseTail
Release pages for all locked levels at the tail.- Throws:
IgniteCheckedException
-
checkTailLevel
protected final boolean checkTailLevel(int rootLvl) - Parameters:
rootLvl- Actual root level.- Returns:
trueIf tail level is correct.
-
doReleaseTail
protected final void doReleaseTail(org.apache.ignite.internal.persistence.tree.BPlusTree.Tail<L> t) throws IgniteCheckedException - Parameters:
t- Tail.- Throws:
IgniteCheckedException- If failed.
-
canRelease
public final boolean canRelease(long pageId, int lvl) -
isTail
protected final boolean isTail(long pageId, int lvl) - Parameters:
pageId- Page ID.lvl- Level.- Returns:
trueIf the given page is in tail.
-
addTail
protected final org.apache.ignite.internal.persistence.tree.BPlusTree.Tail<L> addTail(long pageId, long page, long pageAddr, BPlusIO<L> io, int lvl, byte type) - Parameters:
pageId- Page ID.page- Page pointer.pageAddr- Page address.io- IO.lvl- Level.type- Type.- Returns:
- Added tail.
-
getTail
protected final org.apache.ignite.internal.persistence.tree.BPlusTree.Tail<L> getTail(org.apache.ignite.internal.persistence.tree.BPlusTree.Tail<L> tail, int lvl) - Parameters:
tail- Tail to start with.lvl- Level.- Returns:
- Tail of
BPlusTree.Tail.EXACTtype at the given level.
-
insertionPoint
protected final int insertionPoint(org.apache.ignite.internal.persistence.tree.BPlusTree.Tail<L> tail) throws IgniteCheckedException - Parameters:
tail- Tail.- Returns:
- Insertion point. May be negative.
- Throws:
IgniteCheckedException- If failed.
-
printTail
- Parameters:
keys- If we have to show keys.- Returns:
- Tail as a String.
- Throws:
IgniteCheckedException- If failed.
-