aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-19 13:22:28 +0200
committerAlex Auvolat <alex@adnab.me>2020-04-19 13:22:28 +0200
commit7131553c53d4414d2da0e9b60e6e3425f1b46ec2 (patch)
tree22c4f225ebdbc600c9cbe38e11a01dbc228c5c11 /src/main.rs
parent4ba54ccfca2ff8e56c58d0a652de256428282490 (diff)
downloadgarage-7131553c53d4414d2da0e9b60e6e3425f1b46ec2.tar.gz
garage-7131553c53d4414d2da0e9b60e6e3425f1b46ec2.zip
Refactor sharding logic; coming next: full replication with epidemic dissemination
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main.rs b/src/main.rs
index 3e91b21d..cc9da8e2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4,6 +4,7 @@ mod error;
mod background;
mod membership;
mod table;
+mod table_sharded;
mod table_sync;
mod block;
@@ -22,12 +23,15 @@ use std::collections::HashSet;
use std::net::SocketAddr;
use std::path::PathBuf;
use std::sync::Arc;
+use std::time::Duration;
use structopt::StructOpt;
use error::Error;
use membership::*;
use rpc_client::*;
-use server::{TlsConfig, DEFAULT_TIMEOUT};
+use server::TlsConfig;
+
+const DEFAULT_TIMEOUT: Duration = Duration::from_secs(10);
#[derive(StructOpt, Debug)]
#[structopt(name = "garage")]
@@ -158,11 +162,8 @@ async fn cmd_status(rpc_cli: RpcAddrClient<Message>, rpc_host: SocketAddr) -> Re
for adv in status.iter() {
if let Some(cfg) = config.members.get(&adv.id) {
println!(
- "{}\t{}\t{}\t{}",
- hex::encode(&adv.id),
- cfg.datacenter,
- cfg.n_tokens,
- adv.addr
+ "{:?}\t{}\t{}\t{}",
+ adv.id, cfg.datacenter, cfg.n_tokens, adv.addr
);
}
}
@@ -176,7 +177,7 @@ async fn cmd_status(rpc_cli: RpcAddrClient<Message>, rpc_host: SocketAddr) -> Re
println!("\nFailed nodes:");
for (id, cfg) in config.members.iter() {
if !status.iter().any(|x| x.id == *id) {
- println!("{}\t{}\t{}", hex::encode(&id), cfg.datacenter, cfg.n_tokens);
+ println!("{:?}\t{}\t{}", id, cfg.datacenter, cfg.n_tokens);
}
}
}
@@ -188,7 +189,7 @@ async fn cmd_status(rpc_cli: RpcAddrClient<Message>, rpc_host: SocketAddr) -> Re
println!("\nUnconfigured nodes:");
for adv in status.iter() {
if !config.members.contains_key(&adv.id) {
- println!("{}\t{}", hex::encode(&adv.id), adv.addr);
+ println!("{:?}\t{}", adv.id, adv.addr);
}
}
}