Skip to content

Commit

Permalink
refactor data panel
Browse files Browse the repository at this point in the history
  • Loading branch information
juaby committed Mar 15, 2021
1 parent 5425399 commit c60c63e
Show file tree
Hide file tree
Showing 131 changed files with 2,785 additions and 823 deletions.
8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
[workspace]

members = [
"data-panel",
"control-panel",

"data-panel",
"data-panel-common",
"data-panel-database",
"data-panel-cache",
"data-panel-rpc",
"data-panel-mq",

# Internal
]
62 changes: 62 additions & 0 deletions data-panel-cache/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[package]
name = "data-panel-cache"
version = "0.1.0"
authors = ["AlphaPo <[email protected]>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

#[lib]
#name = "data-panel-cache"
#path = "src/lib.rs"

[dependencies]

data-panel-common = { path = "../data-panel-common", version = "0.1.0-SNAPSHOT" }

futures = "0.3"
tokio = { version = "1.1", features = ["full"] }
tokio-util = { version = "0.6", features = ["full"] }
tokio-stream = "0.1"
bytes = "1.0"

# sqlparser = "0.8"
sqlparser = { git = "https://github.com/juaby/sqlparser-rs", branch = "po/mysql"}
# sqlx = { version = "0.4", default-features = false, features = [ "runtime-tokio", "tls", "mysql", "postgres", "bigdecimal", "json", "chrono", "ipnetwork", "uuid" ]}
# sqlx = { version = "0.4", default-features = false, features = [ "runtime-tokio", "macros", "all" ]}
mysql = "20.1"
# mysql_async = "0.26"
# r2d2 = "0.8"
# r2d2_mysql = "18.0"
mysqlbinlog = "0.1.5"

rand = "0.8.2"
bitflags = "1.2.1"
byteorder = "1.4.2"

hyper = "0.14"
serde_json = "1.0.61"
chrono = "0.4.19"

log = "0.4.13"
env_logger = "0.8.2"

clap = { version = "2.33", features = ["yaml"] }
yaml-rust = "0.4.5"

serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.8"
toml = "0.5"

rhai = { version = "0.19" }

lazy_static = "1.4.0"
dashmap = "4.0.2"

casbin = { version = "2.0.5", default-features = false, features = ["runtime-async-std", "logging"] }
async-std = { version = "1.9.0", features = ["attributes"] }

async-trait = "0.1.48"

[build-dependencies]
cc = "1.0"
11 changes: 11 additions & 0 deletions data-panel-cache/etc/app.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[app]
name = "Database Mesh"
host = "localhost"
port = 13306
version = '0.1.0'
[control]
pilot = "localhost:6306"
mixer = "localhost:7306"
citadel = "localhost:8306"
[system]
timeout = 5000
82 changes: 82 additions & 0 deletions data-panel-cache/etc/dbmesh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: martlet
segments:
meta_segment:
primary:
id: 0
url: "jdbc:mysql://localhost:3306/martlet"
username: root
password: root
mirrors:
- id: 0
url: "jdbc:mysql://localhost:3306/martlet"
username: root
password: root
- id: 1
url: "jdbc:mysql://localhost:3306/martlet"
username: root
password: root
data_segments:
200:
primary:
id: 0
url: "jdbc:mysql://localhost:3306/martlet"
username: root
password: root
mirrors:
- id: 1
url: "jdbc:mysql://localhost:3306/martlet"
username: root
password: root
- id: 2
url: "jdbc:mysql://localhost:3306/martlet"
username: root
password: root
300:
primary:
id: 0
url: "jdbc:mysql://localhost:3306/martlet"
username: root
password: root
mirrors:
- id: 0
url: "jdbc:mysql://localhost:3306/martlet"
username: root
password: root
- id: 1
url: "jdbc:mysql://localhost:3306/martlet"
username: root
password: root
100:
primary:
id: 0
url: "jdbc:mysql://localhost:3306/martlet"
username: root
password: root
mirrors:
- id: 0
url: "jdbc:mysql://localhost:3306/martlet"
username: root
password: root
- id: 1
url: "jdbc:mysql://localhost:3306/martlet"
username: root
password: root
dis_rules:
distributed_tables:
t_order_item:
dis_keys: []
dis_algorithm:
dis_type: HASH
dis_expression: x + y / 3
dis_relatives: []
t_order:
dis_keys:
- user_id
dis_algorithm:
dis_type: HASH
dis_expression: x + y / 3
dis_relatives:
- t_order_item
replicated_tables:
- t_dept
- t_root
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions data-panel-cache/src/config/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod config;
File renamed without changes.
Loading

0 comments on commit c60c63e

Please sign in to comment.