Skip to content

Commit

Permalink
feat: upgrade proto to 0.4.3 (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengjiachun authored Jan 31, 2024
1 parent c20b0e4 commit b47085f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions ingester-protocol/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<artifactId>ingester-protocol</artifactId>

<properties>
<arrow.flight.version>10.0.1</arrow.flight.version>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -29,7 +28,7 @@
<dependency>
<groupId>io.greptime</groupId>
<artifactId>greptimedb-proto</artifactId>
<version>0.4.2</version>
<version>0.4.3</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand Down
8 changes: 6 additions & 2 deletions ingester-protocol/src/main/java/io/greptime/WriteClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ private CompletableFuture<Result<WriteOk, Err>> write0(WriteTables writeTables,
}

private CompletableFuture<Result<WriteOk, Err>> 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);

Expand Down Expand Up @@ -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<WriteTables>() {

@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);
}
Expand Down

0 comments on commit b47085f

Please sign in to comment.