aboutsummaryrefslogtreecommitdiff
path: root/src/block.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-18 19:30:05 +0200
committerAlex Auvolat <alex@adnab.me>2020-04-18 19:30:05 +0200
commitbd1618e78e4c4305a73bdd40004de2abe46c3ceb (patch)
tree8d84b73808a3a968941a59672aae398a61f8d5ff /src/block.rs
parentf41583e1b731574b4bb13a20d4b3fd9fe3a899f5 (diff)
downloadgarage-bd1618e78e4c4305a73bdd40004de2abe46c3ceb.tar.gz
garage-bd1618e78e4c4305a73bdd40004de2abe46c3ceb.zip
Remove proto.rs & move some definitions out of data.rs
Diffstat (limited to 'src/block.rs')
-rw-r--r--src/block.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/block.rs b/src/block.rs
index 879cff2c..60121ac5 100644
--- a/src/block.rs
+++ b/src/block.rs
@@ -14,11 +14,13 @@ use crate::data;
use crate::data::*;
use crate::error::Error;
use crate::membership::System;
-use crate::proto::*;
use crate::rpc_client::*;
use crate::rpc_server::*;
use crate::server::Garage;
+pub const INLINE_THRESHOLD: usize = 3072;
+
+const BLOCK_RW_TIMEOUT: Duration = Duration::from_secs(42);
const NEED_BLOCK_QUERY_TIMEOUT: Duration = Duration::from_secs(5);
const RESYNC_RETRY_TIMEOUT: Duration = Duration::from_secs(10);
@@ -31,6 +33,14 @@ pub enum Message {
NeedBlockReply(bool),
}
+#[derive(Debug, Serialize, Deserialize)]
+pub struct PutBlockMessage {
+ pub hash: Hash,
+
+ #[serde(with = "serde_bytes")]
+ pub data: Vec<u8>,
+}
+
impl RpcMessage for Message {}
pub struct BlockManager {