diff --git a/ingester-protocol/pom.xml b/ingester-protocol/pom.xml index 653cfe3..1a29458 100644 --- a/ingester-protocol/pom.xml +++ b/ingester-protocol/pom.xml @@ -10,7 +10,6 @@ ingester-protocol - 10.0.1 8 8 UTF-8 @@ -29,7 +28,7 @@ io.greptime greptimedb-proto - 0.4.2 + 0.4.3 com.google.guava diff --git a/ingester-protocol/src/main/java/io/greptime/WriteClient.java b/ingester-protocol/src/main/java/io/greptime/WriteClient.java index 5511cc3..347253b 100644 --- a/ingester-protocol/src/main/java/io/greptime/WriteClient.java +++ b/ingester-protocol/src/main/java/io/greptime/WriteClient.java @@ -164,8 +164,10 @@ private CompletableFuture> write0(WriteTables writeTables, } private CompletableFuture> writeTo(Endpoint endpoint, WriteTables writeTables, Context ctx, int retries) { + // Some info will be set into the GreptimeDB Request header. String database = this.opts.getDatabase(); AuthInfo authInfo = this.opts.getAuthInfo(); + Database.GreptimeRequest req = TableHelper.toGreptimeRequest(writeTables, database, authInfo); ctx.with("retries", retries); @@ -211,12 +213,14 @@ public void onCompleted() { } }); + // Some info will be set into the GreptimeDB Request header. + String database = this.opts.getDatabase(); + AuthInfo authInfo = this.opts.getAuthInfo(); + return new Observer() { @Override public void onNext(WriteTables writeTables) { - String database = WriteClient.this.opts.getDatabase(); - AuthInfo authInfo = WriteClient.this.opts.getAuthInfo(); Database.GreptimeRequest req = TableHelper.toGreptimeRequest(writeTables, database, authInfo); rpcObserver.onNext(req); }