Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new feature: Expose conditional writes for Java bindings #5651

Open
1 task done
geruh opened this issue Feb 23, 2025 · 3 comments · May be fixed by #5664
Open
1 task done

new feature: Expose conditional writes for Java bindings #5651

geruh opened this issue Feb 23, 2025 · 3 comments · May be fixed by #5664
Labels
enhancement New feature or request

Comments

@geruh
Copy link

geruh commented Feb 23, 2025

Feature Description

Currently, the java bindings is missing some write options including the conditional writes.

Problem and Solution

This would allow for users to use the operators to conditionally write data to specified locations

Additional Context

No response

Are you willing to contribute to the development of this feature?

  • Yes, I am willing to contribute to the development of this feature.
@geruh geruh added the enhancement New feature or request label Feb 23, 2025
@Xuanwo
Copy link
Member

Xuanwo commented Feb 24, 2025

I will invite @tisonkun and @G-XD to participate in the API design first. Are there any special considerations when adding more options to our write API? Is it complex to implement such support?

In rust side, we use conditional writes in the way like:

op.write_with(path).if_not_exists(true).await;
op.write_with(path).if_none_match(etag).await;

Or passing it into a writer:

let w = op.writer_with(path).if_not_exists(true).await;
let w = op.writer_with(path).if_none_match(etag).await;

The links to API: https://docs.rs/opendal/latest/opendal/operator_futures/struct.OperatorFuture.html#method.if_not_exists-1

@geruh
Copy link
Author

geruh commented Feb 24, 2025

Hey @Xuanwo, yeah, I was testing it out locally by passing in some write options similar to the approach taken in #4785 for the Node.js bindings. Granted, they don’t have conditional writes yet, but I've added some additional options. You can check my local fork here: https://github.com/geruh/opendal/tree/java-write-options. I can open a PR if @tisonkun and @G-XD think this approach looks correct.

@tisonkun
Copy link
Member

tisonkun commented Feb 26, 2025

@geruh I don't check your branch yet but it's generally encouraged to submit a PR So that we can browse the changeset and continue the concrete discussion there.

@geruh geruh linked a pull request Feb 26, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants