Xuanwo opened a new pull request, #7218:
URL: https://github.com/apache/opendal/pull/7218

   # Which issue does this PR close?
   
   Part of #7062.
   
   # Rationale for this change
   
   `CompleteLayer` now guarantees `content_length` for file entries returned by 
`list`, but backends that don't populate size in lister metadata still trigger 
per-entry fallback `stat` calls.
   
   For local KV-like backends where size is already available at list time, we 
can fill `content_length` directly in service listers and avoid unnecessary 
fallback `stat` requests.
   
   # What changes are included in this PR?
   
   - `compfs`: populate file `content_length` from `DirEntry::metadata().len()` 
in lister.
   - `dashmap`: lister now reuses cached `Metadata` instead of reconstructing 
metadata from key suffix.
   - `mini_moka`: lister now reuses cached `Metadata`.
   - `moka`: lister now reuses cached `Metadata`.
   - `rocksdb`: core `list` now returns `(key, value_len)` and lister sets file 
`content_length` directly.
   - `sled`: core `list` now returns `(key, value_len)` and lister sets file 
`content_length` directly.
   
   Validation:
   
   - `cargo fmt`
   - `cargo check --features 
services-compfs,services-dashmap,services-mini-moka,services-moka,services-rocksdb,services-sled,services-etcd,tests`
   - `cargo clippy --all-targets --features 
services-compfs,services-dashmap,services-mini-moka,services-moka,services-rocksdb,services-sled,services-etcd,tests
 -- -D warnings`
   - `OPENDAL_TEST=dashmap cargo test --features 
services-compfs,services-dashmap,services-mini-moka,services-moka,services-rocksdb,services-sled,tests
 behavior::test_list_dir -- --nocapture`
   - `OPENDAL_TEST=mini_moka cargo test --features 
services-compfs,services-dashmap,services-mini-moka,services-moka,services-rocksdb,services-sled,tests
 behavior::test_list_dir -- --nocapture`
   - `OPENDAL_TEST=moka cargo test --features 
services-compfs,services-dashmap,services-mini-moka,services-moka,services-rocksdb,services-sled,tests
 behavior::test_list_dir -- --nocapture`
   - `OPENDAL_TEST=compfs OPENDAL_COMPFS_ROOT=<tmp_dir> cargo test --features 
services-compfs,services-dashmap,services-mini-moka,services-moka,services-rocksdb,services-sled,tests
 behavior::test_list_dir -- --nocapture`
   - `OPENDAL_TEST=rocksdb OPENDAL_ROCKSDB_DATADIR=<tmp_dir> 
OPENDAL_ROCKSDB_ROOT=/ cargo test --features 
services-compfs,services-dashmap,services-mini-moka,services-moka,services-rocksdb,services-sled,tests
 behavior::test_list_dir -- --nocapture`
   - `OPENDAL_TEST=sled OPENDAL_SLED_DATADIR=<tmp_dir> 
OPENDAL_SLED_TREE=opendal cargo test --features 
services-compfs,services-dashmap,services-mini-moka,services-moka,services-rocksdb,services-sled,tests
 behavior::test_list_dir -- --nocapture`
   
   # Are there any user-facing changes?
   
   Yes.
   
   For `compfs`, `dashmap`, `mini-moka`, `moka`, `rocksdb`, and `sled`, file 
entries returned by `list` now include `content_length` directly from lister 
metadata, which reduces extra fallback `stat` requests.
   
   # AI Usage Statement
   
   This PR was developed with Codex (GPT-5) assistance.
   


-- 
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