Skip to content

Commit

Permalink
chore: define remote_engine grpc service (#505)
Browse files Browse the repository at this point in the history
Co-authored-by: kamille <34352236+Rachelint@users.noreply.github.com>
  • Loading branch information
chunshao90 and Rachelint authored Dec 25, 2022
1 parent 72d3542 commit 6139d89
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ workspace = true

[dependencies]
prost = { workspace = true }
tonic = { workspace = true }

[build-dependencies]
protoc-bin-vendored = "3.0.0"
Expand Down
1 change: 1 addition & 0 deletions proto/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
"protos/table_requests.proto",
"protos/wal_on_mq.proto",
"protos/oss_cache.proto",
"protos/remote_engine.proto",
],
&["protos"],
)?;
Expand Down
82 changes: 82 additions & 0 deletions proto/protos/remote_engine.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Copyright 2022 CeresDB Project Authors. Licensed under Apache-2.0.

syntax = "proto3";
package remote_engine;

import "common.proto";

message ResponseHeader {
uint32 code = 1;
string error = 2;
}

service RemoteEngineService {
rpc Read(ReadRequest) returns (stream ReadResponse) {}
rpc Write(WriteRequest) returns (WriteResponse) {}
}

message TableIdentifier {
string catalog = 1;
string schema = 2;
string table = 3;
}

message ReadOptions {
uint64 batch_size = 1;
uint64 read_parallelism = 2;
}

message Projection {
repeated uint64 idx = 1;
}

message ProjectedSchema {
common.TableSchema table_schema = 1;
Projection projection = 2;
}

message Predicate {
repeated bytes exprs = 1;
common.TimeRange time_range = 2;
}

enum ReadOrder {
None = 0;
Asc = 1;
Desc = 2;
}

message TableReadRequest {
uint64 request_id = 1;
ReadOptions opts = 2;
ProjectedSchema projected_schema = 3;
Predicate predicate = 4;
ReadOrder order = 5;
}

message ReadRequest {
TableIdentifier table = 1;
TableReadRequest read_request = 2;
}

message ReadResponse {
ResponseHeader header = 1;
repeated bytes rows = 2;
}

message RowGroup {
common.TableSchema table_schema = 1;
repeated bytes rows = 2;
int64 min_timestamp = 3;
int64 max_timestamp = 4;
}

message WriteRequest {
TableIdentifier table = 1;
RowGroup row_group = 2;
}

message WriteResponse {
ResponseHeader header = 1;
uint64 affected_rows = 2;
}
1 change: 1 addition & 0 deletions proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ pub mod sst;
pub mod sys_catalog;
pub mod table_requests;
pub mod wal_on_mq;
pub mod remote_engine;

0 comments on commit 6139d89

Please sign in to comment.