Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: define remote_engine grpc service #505

Merged
merged 2 commits into from
Dec 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Rachelint marked this conversation as resolved.
Show resolved Hide resolved
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;