criccomini opened a new pull request, #743:
URL: https://github.com/apache/arrow-rs-object-store/pull/743

   # Which issue does this PR close?
   
   Closes #740
   
   # Rationale for this change
   
   We make extensive use of `ObjectStore` wrappers that do things like caching, 
metrics tracking, handle retries, and so on. We've found it would be helpful to 
use `Extensions` not just for requests (which are already supported today), but 
also responses.
   
   One example: we have a `CachedObjectStore` in SlateDB that we are going to 
make pluggable. We have an internal metrics wrapper that (among other things) 
tracks cache hits/misses. Now that we're exposing the cache publicly, we need a 
way for our wrapper to track whether the reads were a hit or miss. An 
`Extensions` in the `Result` seems appropriate here. Then users that implement 
a cache can use the extension to signal such information.
   
   This is just one example.
   
   # What changes are included in this PR?
   
   Adds a public extensions: http::Extensions field to the existing result 
types — GetResult, PutResult, ListResult, and PaginatedListResult — mirroring 
the extensions field already present on the options structs (GetOptions, 
PutOptions, etc.). This gives ObjectStore implementations (e.g. caching 
wrappers) a way to return context-specific information, such as cache hit/miss 
status, to callers.
   
   I did not add `Extensions` support for Delete/Head as there aren't `Result` 
types for these right now. That seemed like a heavier change.
   
   # Are there any user-facing changes?
   
   - GetResult, PutResult, ListResult, and PaginatedListResult gain a new 
public field extensions. Code constructing these types with struct literals 
must add the field (e.g. extensions: Default::default()).
   - PutResult no longer derives PartialEq/Eq; the manual impls compare e_tag 
and version only, ignoring extensions.
   
   _WARN: This was coded with Claude Fable with some steering from me._


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