Skip to content

Commit

Permalink
define name format for pir cache db
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix20162016 committed Dec 4, 2023
1 parent 1d8c69b commit 05b5fb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions example/keyword_pir_db_build_task_conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"value": 1
},
"DbInfo": {
"description": "create sender db offline",
"description": "create sender db offline, format of file_name: concat datasetid with key columns, seperated by _",
"type": "STRING",
"value": "data/cache/keyword_pir_server_data"
"value": "data/cache/keyword_pir_server_data_0_1"
},
"QueryConfig": {
"type": "OBJECT",
Expand Down
6 changes: 5 additions & 1 deletion src/primihub/task/semantic/pir_task.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,16 @@ retcode PirTask::BuildOptions(const rpc::Task& task, pir::Options* options) {
auto it = param_map.find(party_name());
if (it != param_map.end()) {
options->db_path.append(it->second.value_string());

} else {
LOG(ERROR) << "dateset id is not set";
return retcode::FAIL;
}
} else {
options->db_path.append(this->dataset_id_);
options->db_path.append(this->dataset_id_);
}
for (const auto key_index : this->server_key_columns_) {
options->db_path.append("_").append(std::to_string(key_index));
}

if (DbCacheAvailable(options->db_path)) {
Expand Down

0 comments on commit 05b5fb2

Please sign in to comment.