You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "ShadowySpirits (via GitHub)" <gi...@apache.org> on 2023/04/25 11:18:42 UTC
[GitHub] [incubator-opendal] ShadowySpirits commented on a diff in pull request #2112: feat(java): connect rust async/await with java future
ShadowySpirits commented on code in PR #2112:
URL: https://github.com/apache/incubator-opendal/pull/2112#discussion_r1176369189
##########
bindings/java/src/main/java/org/apache/opendal/Operator.java:
##########
@@ -50,17 +49,24 @@ public Operator(String schema, Map<String, String> params) {
private native void write(long ptr, String fileName, String content);
+ private native void asyncWrite(long ptr, String fileName, String content, CompletableFuture<Boolean> future);
+
private native String read(long ptr, String fileName);
private native void delete(long ptr, String fileName);
private native long stat(long ptr, String file);
-
public void write(String fileName, String content) {
write(this.ptr, fileName, content);
}
+ public CompletableFuture<Boolean> asyncWrite(String fileName, String content) {
Review Comment:
I think both of them are ok. [kafka consumer](https://github.com/apache/kafka/blob/d83a734c41c43a03aa571e602cf8535f0893fd79/clients/src/main/java/org/apache/kafka/clients/consumer/Consumer.java#L105-L112) provides blocking and async function in one class. But aws s3 client spit them into [DelegatingS3Client](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/s3/DelegatingS3Client.html) and [DelegatingS3AsyncClient](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/s3/DelegatingS3AsyncClient.html).
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org