Class BPlusTree.Put
Put operation.
-
Method Summary
Modifier and TypeMethodDescriptionprotected final org.apache.ignite.internal.persistence.tree.BPlusTree.Tail<L>final booleancanRelease(long pageId, int lvl) protected final booleancheckTailLevel(int rootLvl) protected final voiddoReleaseTail(org.apache.ignite.internal.persistence.tree.BPlusTree.Tail<L> t) 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) protected final booleanisTail(long pageId, int lvl) protected final StringprintTail(boolean keys) protected final voidRelease pages for all locked levels at the tail.voidreplaceRowInPage(BPlusIO<L> io, long pageId, long page, long pageAddr, int idx) Replaces a row in the page with a new one.tryReplace(long pageId, long page, long fwdId, int lvl) Methods inherited from class org.apache.ignite.internal.persistence.tree.BPlusTree.Get
row
-
Method Details
-
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.
-
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.
-
tryReplace
public BPlusTree.Result tryReplace(long pageId, long page, long fwdId, int lvl) throws IgniteCheckedException - Parameters:
pageId- Page ID.page- Page pointer.fwdId- Forward ID.lvl- Level.- Returns:
- Result.
- Throws:
IgniteCheckedException- If failed.
-
replaceRowInPage
public void replaceRowInPage(BPlusIO<L> io, long pageId, long page, long pageAddr, int idx) throws IgniteCheckedException Replaces a row in the page with a new one.- Parameters:
io- Page IO for the page.pageId- Page id.page- Page pointer.pageAddr- Page address.idx- Replacement index.- Throws:
IgniteCheckedException
-
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.
-