-
Notifications
You must be signed in to change notification settings - Fork 523
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
feat(bindings/java): add layers onto ops #3392
Conversation
Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
As for #3363 (comment), I'm not sure if we should enable RetryLayer in BehaviorExtension for all ops in tests. |
Signed-off-by: tison <[email protected]>
I think we just need to keep the same behavior with https://github.com/apache/incubator-opendal/blob/main/core/tests/behavior/utils.rs#L88-L91 |
This is required since it's normal that services returns errors. |
It's possible to have a native layer wrapper with API - public abstract class NativeLayer {
public abstract long layer(long operatorNativeHandle);
} I implement it locally, while the visibility and clone issue is suboptimal from my perspective. I don't have too much time now to dive into the trade-off so close this PR as won't do. |
... and something like - public static Operator of(String schema, Map<String, String> map, List<NativeLayer> layers) {
final long nativeHandle = constructor(schema, map);
final OperatorInfo info = makeOperatorInfo(nativeHandle);
Operator op = new Operator(nativeHandle, info);
for (NativeLayer layer : layers) {
op = new Operator(layer.layer(op.nativeHandle), info);
}
return op;
} If as @Xuanwo stated, layer to be outside of constructor API but standalone API, it can be a bit complicated. FYI, in Rust core, |
|
@Xuanwo the ownership issue is the major issue here. Reopen for reference. |
Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
bindings/java/src/main/java/org/apache/opendal/layer/RetryNativeLayer.java
Outdated
Show resolved
Hide resolved
bindings/java/src/main/java/org/apache/opendal/NativeLayer.java
Outdated
Show resolved
Hide resolved
bindings/java/src/test/java/org/apache/opendal/test/NativeLayerTest.java
Outdated
Show resolved
Hide resolved
bindings/java/src/test/java/org/apache/opendal/test/NativeLayerTest.java
Outdated
Show resolved
Hide resolved
Passing layer as - protected abstract Operator layer(Operator op); The implementation is more than awful. I don't want to push the change.. |
Signed-off-by: tison <[email protected]>
bindings/java/src/main/java/org/apache/opendal/layer/RetryNativeLayer.java
Outdated
Show resolved
Hide resolved
This reverts commit 62f5e27.
Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! We can enable the retry layer for behavior tests now.
It's already enabled in this patch. |
While we may investigate how to add Java layer support, native layers should use different tech solutions as explained in this PR.