mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-24 00:40:40 +00:00
chore: Setup code skeleton of datanode
This commit is contained in:
@@ -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"
|
||||
|
||||
1
src/datanode/src/catalog.rs
Normal file
1
src/datanode/src/catalog.rs
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
8
src/datanode/src/error.rs
Normal file
8
src/datanode/src/error.rs
Normal 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>;
|
||||
@@ -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!()
|
||||
}
|
||||
}
|
||||
|
||||
1
src/datanode/src/processors.rs
Normal file
1
src/datanode/src/processors.rs
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
10
src/datanode/src/rpc.rs
Normal file
10
src/datanode/src/rpc.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
use crate::error::Result;
|
||||
|
||||
/// All rpc services.
|
||||
pub struct Services {}
|
||||
|
||||
impl Services {
|
||||
pub async fn shutdown(&self) -> Result<()> {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user