feat(io): support in-memory local cache - #710
Open
jerry-024 wants to merge 4 commits into
Open
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Add a catalog-scoped in-memory local block cache aligned with Paimon Java. When
local-cache.enabled=true, omittinglocal-cache.dirselects the memory backend; setting a directory keeps the existing persistent disk backend.Usage and configuration
Create an in-memory cache by enabling local cache without setting
local-cache.dir:To use the persistent disk backend instead, add a cache directory before creating the catalog:
local-cache.enabledfalsetrue.local-cache.dirlocal-cache.max-sizelocal-cache.block-size1 MiBlocal-cache.whitelistmeta,global-indexmeta,global-index,bucket-index,data, andfile-index.Size values are case-insensitive and accept Java-style units (
b,kb,mb,gb,tb,kib,mib,gib,tib, and their full byte names) plus the existing Rust binary aliases.The in-memory cache lives for the owning
Catalog. ItsFileIOclones and REST token-refresh rebuilds reuse the same cache; separate catalogs do not share it. A disk cache persists across catalog lifetimes, and catalogs using the same canonical directory share in-process state.Brief change log
local-cache.max-sizeis unset and oversized blocks skipped.Tests
cargo +1.97.0 test -p paimoncargo +1.97.0 clippy -p paimon --all-targets -- -D warningscargo fmt --all -- --checkAPI and Format
No public API or storage-format changes. The configuration behavior changes so that enabling local cache without
local-cache.dircreates an in-memory cache instead of requiring a disk directory.Documentation
Updated the getting-started guide with backend selection, defaults, lifetime, and size-accounting behavior.