@@ -34,8 +34,9 @@ namespace paimon {
3434// / ReadAheadCache to balance memory usage, I/O efficiency, and latency hiding.
3535class PAIMON_EXPORT CacheConfig {
3636 public:
37- // / Returns the maximum allowed size (in bytes) for a single cached range.
38- // / Defaults to 32 MiB.
37+ // / Returns the maximum allowed size (in bytes) for a single cached range, both for the ranges
38+ // / registered up front and, as the cap, for the ones registered mid-read.
39+ // / Defaults to 8 MiB.
3940 uint64_t GetRangeSizeLimit () const {
4041 return range_size_limit_;
4142 }
@@ -45,19 +46,6 @@ class PAIMON_EXPORT CacheConfig {
4546 range_size_limit_ = range_size_limit;
4647 }
4748
48- // / Returns the maximum allowed size (in bytes) for a single range registered after the cache
49- // / was initialized, i.e. for the ranges that only become known while reading.
50- // / Defaults to 8 MiB.
51- uint64_t GetLateRangeSizeLimit () const {
52- return late_range_size_limit_;
53- }
54-
55- // / Sets the maximum allowed size (in bytes) for a single range registered after the cache was
56- // / initialized.
57- void SetLateRangeSizeLimit (uint64_t late_range_size_limit) {
58- late_range_size_limit_ = late_range_size_limit;
59- }
60-
6149 // / Returns the maximum gap size (in bytes) considered mergeable between
6250 // / adjacent ranges. Defaults to 512 KiB.
6351 uint64_t GetHoleSizeLimit () const {
@@ -131,27 +119,24 @@ class PAIMON_EXPORT CacheConfig {
131119 private:
132120 // The defaults are aligned with the reader's request granularity and with
133121 // realistic data file sizes:
134- // - range_size_limit matches the parquet reader's 32 MiB request blocks
135- // (Arrow ReadRangeCache's own range limit); a smaller limit cuts entries
136- // below the request size, so a request can never be served from one piece.
122+ // - range_size_limit bounds a single coalesced cached range, both for the
123+ // ranges registered up front at Init and, as the cap, for the ones
124+ // registered mid-read (see range_split_alignment below). One range is one
125+ // prefetch IO, so a smaller limit spreads a large pass over several
126+ // concurrent requests instead of one long serial one; a read spanning
127+ // several adjacent ranges is still served as one hit, as they are
128+ // contiguous. 8 MiB keeps a just-in-time mid-read pass concurrent while
129+ // staying large enough to amortize each request's round trip.
137130 // - pre_buffer_limit must exceed the LARGEST single read a reader issues
138131 // (coalesced column-chunk reads of ~128 MiB were observed): fetches are
139132 // only dispatched up to this window, so a request reaching past it can
140133 // never be served and falls back to a second fetch of the same bytes.
141- // - late_range_size_limit bounds the ranges registered mid-read instead of
142- // at Init: those are fetched only just before they are read, and one range
143- // is one request, so they are cut smaller than range_size_limit to be
144- // fetched concurrently rather than in one long request. A read spanning
145- // several of them is still served, as they are adjacent. It is an upper
146- // bound only: the size such a round is actually cut at is derived from the
147- // bytes it registers, see range_split_alignment below.
148134 // - hole_size_limit trades bytes against requests: coalescing across a gap
149135 // reads the gap too, but saves a request, and on remote storage a request
150136 // costs a round trip whatever its size. The limit is therefore well above
151137 // the page-sized gaps a filtered read leaves between the pages it keeps,
152138 // which would otherwise each cost a request of their own.
153- uint64_t range_size_limit_ = 32 * 1024 * 1024 ;
154- uint64_t late_range_size_limit_ = 8 * 1024 * 1024 ;
139+ uint64_t range_size_limit_ = 8 * 1024 * 1024 ;
155140 uint64_t hole_size_limit_ = 512 * 1024 ;
156141 uint64_t pre_buffer_limit_ = 256 * 1024 * 1024 ;
157142 // A fixed size limit cuts a small round into fewer requests than could be
0 commit comments