-
Notifications
You must be signed in to change notification settings - Fork 0
feat: introduce storage node configuration #69
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #69 +/- ##
==========================================
- Coverage 87.17% 85.01% -2.17%
==========================================
Files 22 23 +1
Lines 3299 3437 +138
Branches 3299 3437 +138
==========================================
+ Hits 2876 2922 +46
- Misses 253 348 +95
+ Partials 170 167 -3 ☔ View full report in Codecov by Sentry. |
@@ -105,12 +97,147 @@ pub async fn storage_node_serve(ip_addr: &str, port: u16) -> ParpulseResult<()> | |||
let routes = route.or(heartbeat).or(catch_all); | |||
let ip_addr: IpAddr = ip_addr.parse().unwrap(); | |||
warp::serve(routes).run((ip_addr, port)).await; | |||
} | |||
|
|||
pub async fn storage_node_serve( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have to explicitly match xxx to LRU or LRU-K for every type of data store...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The concrete types have to match when we initialize a variable. We can't assign a variable as LRU or LRUK at the same time. So we have to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. I mean if it is possible to modularize repetitive code.
use bytes::Bytes; | ||
use log::debug; | ||
use parpulse_client::RequestParams; | ||
use tokio::sync::mpsc::Receiver; | ||
|
||
#[async_trait] | ||
pub trait StorageManager: Send + Sync { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to extract this out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to enable route
to accept StorageManager<C>
where C could be different
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to also make MAX_DISK_READER_BUFFER_SIZE
configurable?
Also, for the client parameters, I think we need to sync with cache2 team!
Others LGTM!
We can run the storage node as follows:
See
config.rs
for more configurable fields.