feat(bindings/java): add layers onto ops#3392
Conversation
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
|
As for #3363 (comment), I'm not sure if we should enable RetryLayer in BehaviorExtension for all ops in tests. |
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 <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
|
Passing layer as - protected abstract Operator layer(Operator op);The implementation is more than awful. I don't want to push the change.. |
This reverts commit 62f5e27.
Xuanwo
left a comment
There was a problem hiding this comment.
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.