Skip to content

Commit

Permalink
Use string keys for peers in config files.
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgrinaker committed Nov 18, 2023
1 parent 5838caf commit 75c33b4
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 41 deletions.
8 changes: 4 additions & 4 deletions clusters/docker/toydb1/toydb.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id: 1
data_dir: /var/lib/toydb
peers:
2: 172.20.0.102
3: 172.20.0.103
4: 172.20.0.104
5: 172.20.0.105
'2': 172.20.0.102
'3': 172.20.0.103
'4': 172.20.0.104
'5': 172.20.0.105
8 changes: 4 additions & 4 deletions clusters/docker/toydb2/toydb.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id: 2
data_dir: /var/lib/toydb
peers:
1: 172.20.0.101
3: 172.20.0.103
4: 172.20.0.104
5: 172.20.0.105
'1': 172.20.0.101
'3': 172.20.0.103
'4': 172.20.0.104
'5': 172.20.0.105
8 changes: 4 additions & 4 deletions clusters/docker/toydb3/toydb.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
3: toydb-c
data_dir: /var/lib/toydb
peers:
1: 172.20.0.101
2: 172.20.0.102
4: 172.20.0.104
5: 172.20.0.105
'1': 172.20.0.101
'2': 172.20.0.102
'4': 172.20.0.104
'5': 172.20.0.105
8 changes: 4 additions & 4 deletions clusters/docker/toydb4/toydb.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
4: toydb-d
data_dir: /var/lib/toydb
peers:
1: 172.20.0.101
2: 172.20.0.102
3: 172.20.0.103
5: 172.20.0.105
'1': 172.20.0.101
'2': 172.20.0.102
'3': 172.20.0.103
'5': 172.20.0.105
8 changes: 4 additions & 4 deletions clusters/docker/toydb5/toydb.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
5: toydb-e
data_dir: /var/lib/toydb
peers:
1: 172.20.0.101
2: 172.20.0.102
3: 172.20.0.103
4: 172.20.0.104
'1': 172.20.0.101
'2': 172.20.0.102
'3': 172.20.0.103
'4': 172.20.0.104
8 changes: 4 additions & 4 deletions clusters/local/toydb1/toydb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sync: false
listen_sql: 0.0.0.0:9601
listen_raft: 0.0.0.0:9701
peers:
2: 127.0.0.1:9702
3: 127.0.0.1:9703
4: 127.0.0.1:9704
5: 127.0.0.1:9705
'2': 127.0.0.1:9702
'3': 127.0.0.1:9703
'4': 127.0.0.1:9704
'5': 127.0.0.1:9705
8 changes: 4 additions & 4 deletions clusters/local/toydb2/toydb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sync: false
listen_sql: 0.0.0.0:9602
listen_raft: 0.0.0.0:9702
peers:
1: 127.0.0.1:9701
3: 127.0.0.1:9703
4: 127.0.0.1:9704
5: 127.0.0.1:9705
'1': 127.0.0.1:9701
'3': 127.0.0.1:9703
'4': 127.0.0.1:9704
'5': 127.0.0.1:9705
8 changes: 4 additions & 4 deletions clusters/local/toydb3/toydb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sync: false
listen_sql: 0.0.0.0:9603
listen_raft: 0.0.0.0:9703
peers:
1: 127.0.0.1:9701
2: 127.0.0.1:9702
4: 127.0.0.1:9704
5: 127.0.0.1:9705
'1': 127.0.0.1:9701
'2': 127.0.0.1:9702
'4': 127.0.0.1:9704
'5': 127.0.0.1:9705
8 changes: 4 additions & 4 deletions clusters/local/toydb4/toydb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sync: false
listen_sql: 0.0.0.0:9604
listen_raft: 0.0.0.0:9704
peers:
1: 127.0.0.1:9701
2: 127.0.0.1:9702
3: 127.0.0.1:9703
5: 127.0.0.1:9705
'1': 127.0.0.1:9701
'2': 127.0.0.1:9702
'3': 127.0.0.1:9703
'5': 127.0.0.1:9705
8 changes: 4 additions & 4 deletions clusters/local/toydb5/toydb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sync: false
listen_sql: 0.0.0.0:9605
listen_raft: 0.0.0.0:9705
peers:
1: 127.0.0.1:9701
2: 127.0.0.1:9702
3: 127.0.0.1:9703
4: 127.0.0.1:9704
'1': 127.0.0.1:9701
'2': 127.0.0.1:9702
'3': 127.0.0.1:9703
'4': 127.0.0.1:9704
1 change: 0 additions & 1 deletion src/bin/toydb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ impl Config {
fn new(file: &str) -> Result<Self> {
Ok(config::Config::builder()
.set_default("id", "toydb")?
.set_default("peers", HashMap::<String, String>::new())?
.set_default("listen_sql", "0.0.0.0:9605")?
.set_default("listen_raft", "0.0.0.0:9705")?
.set_default("log_level", "info")?
Expand Down

0 comments on commit 75c33b4

Please sign in to comment.