mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Use parallel write to celldb (#1264)
* Parallel write in celldb * Add TD_PERF_COUNTER to gc_cell and store_cell * More error handling * Tests for prepare_commit_async * Install g++11 for ubuntu 20.04 --------- Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
fd1735f6ec
commit
d04cdfa0dc
10 changed files with 582 additions and 127 deletions
|
@ -184,6 +184,24 @@ td::Result<CellLoader::LoadResult> CellLoader::load(td::Slice hash, td::Slice va
|
|||
return res;
|
||||
}
|
||||
|
||||
td::Result<CellLoader::LoadResult> CellLoader::load_refcnt(td::Slice hash) {
|
||||
LoadResult res;
|
||||
std::string serialized;
|
||||
TRY_RESULT(get_status, reader_->get(hash, serialized));
|
||||
if (get_status != KeyValue::GetStatus::Ok) {
|
||||
DCHECK(get_status == KeyValue::GetStatus::NotFound);
|
||||
return res;
|
||||
}
|
||||
res.status = LoadResult::Ok;
|
||||
td::TlParser parser(serialized);
|
||||
td::parse(res.refcnt_, parser);
|
||||
if (res.refcnt_ == -1) {
|
||||
parse(res.refcnt_, parser);
|
||||
}
|
||||
TRY_STATUS(parser.get_status());
|
||||
return res;
|
||||
}
|
||||
|
||||
CellStorer::CellStorer(KeyValue &kv) : kv_(kv) {
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue