Posnet opened a new issue, #593:
URL: https://github.com/apache/arrow-rs-object-store/issues/593

   ## Problem
   
   PR #456 added `Attribute::StorageClass` support, which is great for setting 
storage class per-request via `PutOptions`. However, many use cases require 
setting a storage class for **all** objects written by a client.
   
   Currently, to achieve this, users must either:
   1. Wrap `ObjectStore` and intercept all PUT operations to inject the 
attribute
   2. Modify every call site to pass `PutOptions` with the storage class
   
   Both approaches are verbose and error-prone.
   
   ## Proposed Solution
   
   Add a builder method to set default attributes that apply to all PUT 
operations:
   
   ```rust
   let store = AmazonS3Builder::new()
       .with_bucket_name("my-bucket")
       .with_default_attributes(
           Attributes::from_iter([(Attribute::StorageClass, 
"ONEZONE_IA".into())])
       )
       .build()?;
   
   // All puts now use ONEZONE_IA storage class
   store.put(&path, payload).await?;
   ```
   
   Or specifically for storage class:
   ```rust
   let store = AmazonS3Builder::new()
       .with_bucket_name("my-bucket")
       .with_default_storage_class("ONEZONE_IA")
       .build()?;
   ```
   
   ## Alternatives Considered
   
   1. **ObjectStore wrapper** - Works but requires implementing all trait 
methods just to override PUT operations
   2. **Modify all call sites** - Not feasible when using libraries like 
slatedb that internally call the ObjectStore
   
   ## Use Case
   
   I'm using ZeroFS (which uses slatedb → object_store internally). I want all 
objects stored in S3 to use `ONEZONE_IA` storage class for cost savings, but I 
have no way to configure this without forking and wrapping the ObjectStore.


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