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

OAK-11155: Allow using a custom segment loading strategy #1747

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

Nicolapps
Copy link
Contributor

Currently, AbstractFileStore loads segments from the tar files by calling its package-private readSegmentUncached method. This is too limiting when its user needs to customize the segment loading strategy.

This PR allows the user of AbstractFileStore to customize the behavior of readSegmentUncached by adding a new @FunctionalInterface parameter, SegmentLoader. If not set explicitly by the caller, FileStoreBuilder uses an implementation of SegmentLoader which behaves the same way as it currently does, which makes this change backwards-compatible with existing code.

Closes OAK-11155

Currently, `AbstractFileStore` loads segments from the tar files by calling its package-private `readSegmentUncached` method. This is too limiting when its user needs to customize the segment loading strategy.

This PR allows the user of `AbstractFileStore` to customize the behavior of `readSegmentUncached` by adding a new `@FunctionalInterface` parameter, `SegmentLoader`. If not set explicitly by the caller, FileStoreBuilder uses an implementation of `SegmentLoader` which behaves the same way as it currently does, which makes this change backwards-compatible with existing code.

Closes OAK-11155
@Nicolapps Nicolapps marked this pull request as ready for review September 27, 2024 09:47
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.

1 participant