chore: Setup code skeleton of datanode

This commit is contained in:
evenyag
2022-04-20 18:38:00 +08:00
parent ced9a7c97f
commit 1fa0b4e3f9
25 changed files with 215 additions and 1 deletions

View File

@@ -6,3 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
snafu = "0.7"

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,8 @@
use snafu::Snafu;
/// business error of datanode.
#[derive(Debug, Snafu)]
#[snafu(display("DataNode error"))]
pub struct Error;
pub type Result<T> = std::result::Result<T, Error>;

View File

@@ -1 +1,21 @@
mod catalog;
mod error;
mod processors;
mod rpc;
use crate::error::Result;
use crate::rpc::Services;
/// DataNode service.
pub struct DataNode {
services: Services,
}
impl DataNode {
/// Shutdown the datanode service gracefully.
pub async fn shutdown(&self) -> Result<()> {
self.services.shutdown().await?;
unimplemented!()
}
}

View File

@@ -0,0 +1 @@

10
src/datanode/src/rpc.rs Normal file
View File

@@ -0,0 +1,10 @@
use crate::error::Result;
/// All rpc services.
pub struct Services {}
impl Services {
pub async fn shutdown(&self) -> Result<()> {
unimplemented!()
}
}

View File

@@ -0,0 +1 @@
mod schema;

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,8 @@
[package]
name = "logical-plans"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@

View File

@@ -1 +1,4 @@
mod executor;
mod logical_optimizer;
mod physical_optimizer;
mod physical_planner;

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@

9
src/sql/Cargo.toml Normal file
View File

@@ -0,0 +1,9 @@
[package]
name = "sql"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
sqlparser = "0.16.0"

1
src/sql/src/ast.rs Normal file
View File

@@ -0,0 +1 @@

3
src/sql/src/lib.rs Normal file
View File

@@ -0,0 +1,3 @@
mod ast;
mod parser;
mod planner;

1
src/sql/src/parser.rs Normal file
View File

@@ -0,0 +1 @@

1
src/sql/src/planner.rs Normal file
View File

@@ -0,0 +1 @@

View File

@@ -6,3 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
async-trait = "0.1"

3
src/table/src/engine.rs Normal file
View File

@@ -0,0 +1,3 @@
/// Table engine abstraction.
#[async_trait::async_trait]
pub trait Engine {}

View File

@@ -1 +1,5 @@
mod engine;
/// Table abstraction.
#[async_trait::async_trait]
pub trait Table: Send + Sync {}