2727#include " paimon/result.h"
2828#include " paimon/type_fwd.h"
2929#include " paimon/utils/read_ahead_cache.h"
30- #include " paimon/utils/special_field_ids.h"
3130#include " paimon/visibility.h"
3231
3332namespace paimon {
@@ -54,8 +53,8 @@ class PAIMON_EXPORT ReadContext {
5453 const std::shared_ptr<Executor>& executor,
5554 const std::shared_ptr<FileSystem>& specific_file_system,
5655 const std::map<std::string, std::string>& fs_scheme_to_identifier_map,
57- const std::map<std::string, std::string>& options, bool enable_prefetch_cache,
58- const CacheConfig& cache_config);
56+ const std::map<std::string, std::string>& options,
57+ PrefetchCacheMode prefetch_cache_mode, const CacheConfig& cache_config);
5958 ~ReadContext ();
6059
6160 const std::string& GetPath () const {
@@ -117,8 +116,8 @@ class PAIMON_EXPORT ReadContext {
117116 return specific_file_system_;
118117 }
119118
120- bool EnablePrefetchCache () const {
121- return enable_prefetch_cache_ ;
119+ PrefetchCacheMode GetPrefetchCacheMode () const {
120+ return prefetch_cache_mode_ ;
122121 }
123122
124123 const CacheConfig& GetCacheConfig () const {
@@ -143,7 +142,7 @@ class PAIMON_EXPORT ReadContext {
143142 std::shared_ptr<FileSystem> specific_file_system_;
144143 std::map<std::string, std::string> fs_scheme_to_identifier_map_;
145144 std::map<std::string, std::string> options_;
146- bool enable_prefetch_cache_ ;
145+ PrefetchCacheMode prefetch_cache_mode_ ;
147146 CacheConfig cache_config_;
148147};
149148
@@ -179,9 +178,9 @@ class PAIMON_EXPORT ReadContextBuilder {
179178 // / @param read_field_ids Vector of field ids to read from the table.
180179 // / @return Reference to this builder for method chaining.
181180 // / @note Currently supports top-level field selection. Future versions may support
182- // / nested field selection using ArrowSchema for more granular projection,
183- // / If SetReadFieldIds() call and SetReadSchema() are natually are mutually
184- // / exclusive. Calling both will ignore the read schema set by SetReadSchema().
181+ // / nested field selection using ArrowSchema for more granular projection.
182+ // / @note SetReadFieldIds() and SetReadSchema() are mutually exclusive.
183+ // / Calling both will ignore the read schema set by SetReadSchema().
185184 ReadContextBuilder& SetReadFieldIds (const std::vector<int32_t >& read_field_ids);
186185
187186 // / Set a configuration options map to set some option entries which are not defined in the
@@ -227,13 +226,13 @@ class PAIMON_EXPORT ReadContextBuilder {
227226 // / @return Reference to this builder for method chaining.
228227 ReadContextBuilder& EnablePrefetch (bool enabled);
229228
230- // / Enable or disable prefetch cache for read operations.
229+ // / Set prefetch cache mode for read operations.
231230 // /
232- // / When enabled, a prefetch cache is used to prebuffer data ranges before they are needed,
231+ // / A prefetch cache is used to prebuffer data ranges before they are needed,
233232 // / which can improve read performance by reducing redundant I/O operations.
234- // / @param enabled Whether to enable prefetch cache (default: true )
233+ // / @param mode (default: PrefetchCacheMode::ALWAYS )
235234 // / @return Reference to this builder for method chaining.
236- ReadContextBuilder& EnablePrefetchCache ( bool enabled );
235+ ReadContextBuilder& SetPrefetchCacheMode (PrefetchCacheMode mode );
237236
238237 // / Set the cache configuration for prefetch read operations.
239238 // /
0 commit comments