Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add contribute to the block cache option to the iterators. #84

Conversation

koculu
Copy link
Owner

@koculu koculu commented Aug 30, 2024

Summary

The CreateIterator method now includes a contributeToTheBlockCache flag, giving you control over whether the iterator’s scan should impact the block cache:

IZoneTreeIterator<TKey, TValue> CreateIterator(
    IteratorType iteratorType = IteratorType.AutoRefresh,
    bool includeDeletedRecords = false,
    bool contributeToTheBlockCache = false);

New Flag: contributeToTheBlockCache

  • contributeToTheBlockCache: When set to true, the blocks read by the iterator will be added to the block cache. When set to false (default), the iterator’s scan will not affect the block cache.

Example Usage:

using var iterator = zoneTree.CreateIterator(contributeToTheBlockCache: true);
while(iterator.Next()) {
    var key = iterator.CurrentKey;
    var value = iterator.CurrentValue;
}

@koculu koculu linked an issue Aug 30, 2024 that may be closed by this pull request
@koculu koculu merged commit 2f00997 into main Aug 30, 2024
1 check passed
@koculu koculu deleted the 83-enhancement-iterators-must-optionally-contribute-to-the-block-cache branch August 30, 2024 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] Iterators must optionally contribute to the block cache.
1 participant