Implement vitastor-kv rescue command
This commit is contained in:
@@ -97,6 +97,7 @@ void kv_cli_t::parse_args(int narg, const char *args[])
|
||||
" dump [<start> [end]]\n"
|
||||
" dumpjson [<start> [end]]\n"
|
||||
" loadjson\n"
|
||||
" rescue\n"
|
||||
"\n"
|
||||
"<IMAGE> should be the name of Vitastor image with the DB.\n"
|
||||
"Without <COMMAND>, you get an interactive DB shell.\n"
|
||||
@@ -672,6 +673,17 @@ void kv_cli_t::handle_cmd(const std::vector<std::string> & cmd, std::function<vo
|
||||
lst->handle_key(res, key, value);
|
||||
});
|
||||
}
|
||||
else if (opname == "rescue")
|
||||
{
|
||||
kv_cli_list_t *lst = new kv_cli_list_t;
|
||||
lst->db = db;
|
||||
lst->format = 2;
|
||||
lst->cb = std::move(cb);
|
||||
db->rescue([lst](int res, const std::string & key, const std::string & value)
|
||||
{
|
||||
lst->handle_key(res, key, value);
|
||||
});
|
||||
}
|
||||
else if (opname == "loadjson")
|
||||
{
|
||||
loading_json = true;
|
||||
|
||||
Reference in New Issue
Block a user