You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "hailin0 (via GitHub)" <gi...@apache.org> on 2023/09/01 15:21:00 UTC

[GitHub] [skywalking-banyandb-java-client] hailin0 commented on a diff in pull request #46: Add mod revision check to write requests(measure/stream)

hailin0 commented on code in PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#discussion_r1313174999


##########
src/main/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClient.java:
##########
@@ -198,33 +204,75 @@ void connect(Channel channel) {
      * Perform a single write with given entity.
      *
      * @param streamWrite the entity to be written
+     * @return a future of write result
      */
-    public void write(StreamWrite streamWrite) {
+    public CompletableFuture<Void> write(StreamWrite streamWrite) {
         checkState(this.streamServiceStub != null, "stream service is null");
 
+        CompletableFuture<Void> future = new CompletableFuture<>();
         final StreamObserver<BanyandbStream.WriteRequest> writeRequestStreamObserver
                 = this.streamServiceStub
                 .withDeadlineAfter(this.getOptions().getDeadline(), TimeUnit.SECONDS)
                 .write(
                         new StreamObserver<BanyandbStream.WriteResponse>() {
+                            private BanyanDBException responseException;
+
                             @Override
                             public void onNext(BanyandbStream.WriteResponse writeResponse) {
+                                switch (writeResponse.getStatus()) {
+                                case STATUS_RECEIVE_ERROR:

Review Comment:
   fixed



-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org