This commit is contained in:
parent
163ee977a0
commit
0e05b9bc77
1 changed files with 8 additions and 7 deletions
|
@ -526,15 +526,16 @@ impl BlockManager {
|
||||||
// If compressed data is not less than 7/8 of the size of the original data, i.e. if we
|
// If compressed data is not less than 7/8 of the size of the original data, i.e. if we
|
||||||
// don't gain a significant margin by compressing, then we store the plain data instead
|
// don't gain a significant margin by compressing, then we store the plain data instead
|
||||||
// so that we don't lose time decompressing it on reads.
|
// so that we don't lose time decompressing it on reads.
|
||||||
let block_data = if compressed.is_some() && compressed.as_ref().unwrap().len() < (data.len() * 7) / 8 {
|
let block_data =
|
||||||
BlockData::Compressed(compressed.unwrap())
|
if compressed.is_some() && compressed.as_ref().unwrap().len() < (data.len() * 7) / 8 {
|
||||||
} else {
|
BlockData::Compressed(compressed.unwrap())
|
||||||
BlockData::Plain(data)
|
} else {
|
||||||
};
|
BlockData::Plain(data)
|
||||||
|
};
|
||||||
|
|
||||||
let message = Message::PutBlock {
|
let message = Message::PutBlock {
|
||||||
hash,
|
hash,
|
||||||
data: block_data,
|
data: block_data,
|
||||||
};
|
};
|
||||||
let who = self.replication.write_nodes(&hash);
|
let who = self.replication.write_nodes(&hash);
|
||||||
self.rpc_client
|
self.rpc_client
|
||||||
|
|
Loading…
Reference in a new issue