You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "dentiny (via GitHub)" <gi...@apache.org> on 2026/06/11 23:31:17 UTC

[PR] fix(layer/foyers): support suffix read [opendal]

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

   # Which issue does this PR close?
   
   Closes https://github.com/apache/opendal/issues/7736
   
   # Rationale for this change
   
   The support for suffix read feature should be decided by storage backends, and layers should panic on this feature.
   
   # What changes are included in this PR?
   
   Change the way how full object is sliced with suffix read involved.
   
   # Are there any user-facing changes?
   
   No.
   
   # AI Usage Statement
   
   fable-5 helped me make the code change for me, opus-4.6 and me doing code review.


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(layer/foyers): support suffix read [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #7738:
URL: https://github.com/apache/opendal/pull/7738#discussion_r3401247743


##########
core/layers/foyer/src/full.rs:
##########


Review Comment:
   > In one word, foyer layer, at least for now, still benefits?
   
   Yes, but there is no need for extra maintenance efforts.



-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(layer/foyers): support suffix read [opendal]

Posted by "dentiny (via GitHub)" <gi...@apache.org>.
dentiny closed pull request #7738: fix(layer/foyers): support suffix read
URL: https://github.com/apache/opendal/pull/7738


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(layer/foyers): support suffix read [opendal]

Posted by "dentiny (via GitHub)" <gi...@apache.org>.
dentiny commented on code in PR #7738:
URL: https://github.com/apache/opendal/pull/7738#discussion_r3400761477


##########
core/layers/foyer/src/full.rs:
##########


Review Comment:
   Hi may I ask for some context on foyer/cache layer? I, somehow, didn't find the a related open issue.
   The most relevant issue might be https://github.com/apache/opendal/issues/7107, which reads to me:
   - we're working on a more general caching layer
   - foyer layer should be replaced with foyer service after caching layer implemented
   
   Currently without foyer layer, the gap seems to be we don't have a transparent caching impl?
   eg, caching layer impl
   ```rust
   let cache = HybridCacheBuilder::new()
       .memory(64 * 1024 * 1024)       // 64MB memory
       .storage()
       .build()
       .await?;
   let op = Operator::new(S3::default())?
       .layer(FoyerLayer::new(cache).with_size_limit(0..10 * 1024 * 1024))
       .finish();
   // transparent
   let data = op.read("path/to/file").await?;
   ```
   while for caching service we need to explicitly do lookaside cache
   ```rust
   let cache_op = Operator::new(Foyer::new().memory(64 * 1024 * 1024))?.finish();
   let source_op = Operator::new(S3::default())?.finish();
   // lookaside cache
   let data = match cache_op.read("path/to/file").await {
       Ok(data) => data,
       Err(e) if e.kind() == ErrorKind::NotFound => {
           let data = source_op.read("path/to/file").await?;
           let _ = cache_op.write("path/to/file", data.clone()).await; // best-effort fill
           data
       }
       Err(e) => return Err(e),
   };
   ```
   after caching layer implemented
   ```rust
   let cache_op = Operator::new(
       Foyer::new()
           .memory(64 * 1024 * 1024)
           .disk_path("/tmp/cache")
           .disk_capacity(16 * 1024 * 1024 * 1024)
   )?.finish();
   let op = Operator::new(S3::default())?
       .layer(CacheLayer::new(cache_op, WholeCachePolicy::new()))
       .finish();
   // transparent
   let data = op.read("path/to/file").await?;
   ```
   In one word, foyer layer, at least for now, still benefits?
   
   



-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(layer/foyers): support suffix read [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #7738:
URL: https://github.com/apache/opendal/pull/7738#discussion_r3400531274


##########
core/layers/foyer/src/full.rs:
##########


Review Comment:
   we should remove foyer layer



-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(layer/foyers): support suffix read [opendal]

Posted by "dentiny (via GitHub)" <gi...@apache.org>.
dentiny commented on code in PR #7738:
URL: https://github.com/apache/opendal/pull/7738#discussion_r3401256555


##########
core/layers/foyer/src/full.rs:
##########


Review Comment:
   fair



-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org