Created
May 17, 2020 15:20
-
-
Save ayende/603fe985bd8be863a6129b4f4c1a3148 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// map<string, set<string>> | |
public void MultiDeleteAll(Slice key) | |
{ | |
State.IsModified = true; | |
var page = FindPageFor(key, out _); | |
if (page == null || page.LastMatch != 0) | |
{ | |
return; //nothing to delete - key not found | |
} | |
page = ModifyPage(page); | |
var item = page.GetNode(page.LastSearchPosition); | |
if (item->Flags == TreeNodeFlags.MultiValuePageRef) //multi-value tree exists | |
{ | |
var tree = OpenMultiValueTree(key, item); | |
_tx.TryRemoveMultiValueTree(this, key); | |
foreach (long treePage in tree.AllPages()) | |
{ | |
if (_newPageAllocator != null) | |
{ | |
if (IsIndexTree == false) | |
ThrowAttemptToFreePageToNewPageAllocator(Name, treePage); | |
_newPageAllocator.FreePage(treePage); | |
} | |
else | |
{ | |
if (IsIndexTree) | |
ThrowAttemptToFreeIndexPageToFreeSpaceHandling(Name, treePage); | |
_llt.FreePage(treePage); | |
} | |
} | |
Delete(key); | |
} | |
Delete(key); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment