feat: grpc client support multi peers (#380)

* feat: grpc client use channel manager

* cr
This commit is contained in:
fys
2022-11-03 11:55:22 +08:00
committed by GitHub
parent 5abff7a536
commit 1fad67cf4d
19 changed files with 254 additions and 100 deletions

View File

@@ -45,7 +45,7 @@ async fn setup_grpc_server(name: &str, port: usize) -> (String, TestGuard, Arc<G
async fn test_auto_create_table() {
let (addr, _guard, grpc_server) = setup_grpc_server("auto_create_table", 3991).await;
let grpc_client = Client::connect(format!("http://{}", addr)).await.unwrap();
let grpc_client = Client::with_urls(vec![addr]);
let db = Database::new("greptime", grpc_client);
insert_and_assert(&db).await;
@@ -111,7 +111,7 @@ fn expect_data() -> (Column, Column, Column, Column) {
async fn test_insert_and_select() {
let (addr, _guard, grpc_server) = setup_grpc_server("insert_and_select", 3990).await;
let grpc_client = Client::connect(format!("http://{}", addr)).await.unwrap();
let grpc_client = Client::with_urls(vec![addr]);
let db = Database::new("greptime", grpc_client.clone());
let admin = Admin::new("greptime", grpc_client);