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

Support extend layers for Java binding #3367

Closed
2 tasks
tisonkun opened this issue Oct 24, 2023 · 3 comments · Fixed by #3392
Closed
2 tasks

Support extend layers for Java binding #3367

tisonkun opened this issue Oct 24, 2023 · 3 comments · Fixed by #3392

Comments

@tisonkun
Copy link
Member

tisonkun commented Oct 24, 2023

  • Define Accessor and LayeredAccessor interface and wrap {Blocking}Operator into this abstraction
  • Implement a demo layer
@Xuanwo
Copy link
Member

Xuanwo commented Oct 24, 2023

Recently, I've been considering the concept of layers in bindings. I previously believed that all bindings should have their own unique layer abstractions and implementations. However, I discovered that it's illogical for each binding to implement the same layer individually. This contradicts our OpenDAL's VISON.

Looking back at the Java binding, perhaps the main issue lies in how we've designed the API to expose Rust layers in Java. We could consider exposing them as org.apache.opendal.layers.RetryLayer, and construct a similar API like op.layer(new RetryLayer()).

@tisonkun
Copy link
Member Author

@Xuanwo the layer implemented in Java API should include a way to export Rust's layers, while it's not conflict with making a pure Java layer to leverage Java ecosystem. The first challenge I meet is how to pipeline the accessor and adapt operator class into this absraction :D

@Xuanwo
Copy link
Member

Xuanwo commented Oct 26, 2023

The first challenge I meet is how to pipeline the accessor and adapt operator class into this absraction :D

I strongly oppose exposing Accessor to the bindings realm. It's OpenDAL's raw API, which users should never interact with. Technically, it's challenging for Java to access generic types in Rust through FFI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants