gripleaf commented on code in PR #430:
URL: https://github.com/apache/paimon-cpp/pull/430#discussion_r4306100997


##########
src/paimon/core/operation/file_store_scan.cpp:
##########
@@ -396,44 +388,81 @@ Status FileStoreScan::ReadManifestEntries(const 
std::vector<ManifestFileMeta>& m
 // bucket counts, with the current count and schema in the cache key. Exact 
hits
 // can be returned directly; cache misses rebuild the target snapshot bucket 
from the target
 // snapshot's data manifests.
-Status FileStoreScan::ReadManifestEntriesWithCache(
+Result<uint64_t> FileStoreScan::ReadManifestEntriesWithCache(
     const Snapshot& snapshot, const std::vector<ManifestFileMeta>& 
all_manifest_metas,
     int32_t bucket, std::vector<ManifestEntry>* manifest_entries, bool* 
cache_hit) const {
     Duration cache_load_duration;
-    PAIMON_ASSIGN_OR_RAISE(SnapshotLiveManifestEntries cached_entries,
-                           LoadSnapshotLiveManifestEntries(bucket));
+    const int32_t max_snapshots = 
core_options_.GetScanManifestEntryCacheMaxSnapshots();
+    SnapshotLiveManifestEntries cached_entries(max_snapshots);
+    bool predicate_failed = false;
+    auto row_filter = CreateManifestEntryRowFilter(&predicate_failed);
+    bool partition_filtered = false;
+    uint64_t candidate_entries = 0;
+    *cache_hit = false;
+    Result<std::shared_ptr<CacheValue>> value = core_options_.GetCache()->Get(
+        CreateSnapshotLiveManifestEntriesCacheKey(bucket),
+        [](const std::shared_ptr<CacheKey>&) -> 
Result<std::shared_ptr<CacheValue>> {
+            return std::shared_ptr<CacheValue>();
+        });

Review Comment:
   Thanks for pointing this out. In our serving system, bucket is the unit of 
distributed computation. The original cache design followed that model, so we 
scoped the cached results by snapshot and bucket and overlooked the partition 
dimension—sorry for that oversight.
   
     We plan to introduce partition-aware grouping and indexing in a follow-up 
change, aligning the cache organization with Java’s (partition, bucket) 
hierarchy as closely as practical. I’ll open a follow-up issue to track this 
work, while keeping this PR focused on reducing metadata decoding with the 
current layout. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to