aboutsummaryrefslogtreecommitdiff
path: root/src/rpc_server.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-11 23:00:26 +0200
committerAlex Auvolat <alex@adnab.me>2020-04-11 23:00:26 +0200
commit5dd59e437d5af84dfa2cf5dcc2c15807b971002d (patch)
tree2debd795082e810e384f765f84217d47cd158ba3 /src/rpc_server.rs
parentdcf58499a4f529e1033de65b4fca8d45458d60d2 (diff)
downloadgarage-5dd59e437d5af84dfa2cf5dcc2c15807b971002d.tar.gz
garage-5dd59e437d5af84dfa2cf5dcc2c15807b971002d.zip
Local refcounting of blocks
Diffstat (limited to 'src/rpc_server.rs')
-rw-r--r--src/rpc_server.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/rpc_server.rs b/src/rpc_server.rs
index 98798614..08fa909d 100644
--- a/src/rpc_server.rs
+++ b/src/rpc_server.rs
@@ -9,7 +9,6 @@ use hyper::service::{make_service_fn, service_fn};
use hyper::{Body, Method, Request, Response, Server, StatusCode};
use serde::Serialize;
-use crate::block::*;
use crate::data::rmp_to_vec_all_named;
use crate::error::Error;
use crate::proto::Message;
@@ -65,8 +64,8 @@ async fn handler(
Message::AdvertiseNodesUp(adv) => sys.handle_advertise_nodes_up(adv).await,
Message::AdvertiseConfig(adv) => sys.handle_advertise_config(adv).await,
- Message::PutBlock(m) => write_block(garage, &m.hash, &m.data).await,
- Message::GetBlock(h) => read_block(garage, &h).await,
+ Message::PutBlock(m) => garage.block_manager.write_block(&m.hash, &m.data).await,
+ Message::GetBlock(h) => garage.block_manager.read_block(&h).await,
Message::TableRPC(table, msg) => {
if let Some(rpc_handler) = garage.table_rpc_handlers.get(table) {