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

   # Which issue does this PR close?
   
   None.
   
   # Rationale for this change
   
   The .NET binding cannot call three core operations: `restore`, `compose`, 
and deleting several paths in one call (`delete_iter`). This PR adds them.
   
   # What changes are included in this PR?
   
   - Add `Operator.Restore` and `RestoreAsync` with `RestoreOptions`, 
forwarding to `restore_options`.
   
   - Add `Operator.Compose` and `ComposeAsync` with `ComposeOptions` and 
per-source `ComposeSourceOptions`, forwarding to `compose_options`. Both return 
the `Metadata` of the composed object.
   
   - Add `Operator.DeleteMany` and `DeleteManyAsync`, forwarding to 
`delete_iter`. They consume the targets lazily in chunks of 1000 and make one 
native call per chunk, so a large sequence is never held in memory at once and 
no native handle outlives a call. Batches do not span chunks: services whose 
`delete_max_size` is at most 1000 see at most one extra request per chunk, 
while services with a limit of 10000 (Swift, Cloudflare KV) see about ten times 
as many requests as one long-lived `Deleter` would send.
   
   - Add `ComposeInput` and `DeleteInput`, which pair a path with its options 
and stand in for the `(String, Options)` pair that core's `IntoComposeInput` 
and `IntoDeleteInput` produce. Both convert implicitly from `string` and from a 
listed `Entry`; the `Entry` conversion carries the entry's version, as core 
does.
   
   - Generate `RestoreOptions`, `ComposeOptions` and `ComposeSourceOptions` 
from core by adding three entries to `EXPOSED_OPTIONS` in 
`dev/src/generate/dotnet.rs`.
   
   - Pass per-item options across the FFI as an array of 
`OpendalPathOptions<T>` (`path`, `options*`) plus a length. 
`PathOptionsArray<TNative>` writes it through the existing `NativeOptionsScope` 
and `read_path_options` reads it in Rust. Compose sources and delete targets 
share this encoding.
   
   - Add behavior tests that mirror core's, and document the three operations 
in the .NET guide.
   
   Tested on Windows against memory, fs, and RustFS (versioned and plain 
buckets) on net8.0 and net10.0.
   
   # Are there any user-facing changes?
   
   Yes. `Operator` gains `Restore`, `RestoreAsync`, `Compose`, `ComposeAsync`, 
`DeleteMany` and `DeleteManyAsync`, along with the new `ComposeInput`, 
`DeleteInput`, `RestoreOptions`, `ComposeOptions` and `ComposeSourceOptions` 
types. Nothing existing changes.
   
   # Breaking changes
   
   None.
   
   # AI Usage Statement
   
   - Harness: Claude Code
   - Model: Claude Fable 5.2
   - Effort: medium
   - Role: Wrote the FFI functions, the managed API, the tests, and this 
description under my direction. I chose the scope, the 
`ComposeInput`/`DeleteInput` naming, and the chunked `DeleteMany` design after 
comparing it with a long-lived `Deleter`, and reviewed the changes. Unknowns 
affecting review: `Compose` is only supported by GCS and has not run against a 
real service; request counts for batch limits other than 1000 are derived from 
core's `BatchDeleter` rather than measured; no in-tree test crosses a 
`DeleteMany` chunk boundary.
   


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