return (ret == 0);
}
+void StoreTool::print_summary(const uint64_t total_keys, const uint64_t total_size,
+ const uint64_t total_txs, const string& store_path,
+ const string& other_path, const int duration) const
+{
+ std::cout << "summary:" << std::endl;
+ std::cout << " copied " << total_keys << " keys" << std::endl;
+ std::cout << " used " << total_txs << " transactions" << std::endl;
+ std::cout << " total size " << byte_u_t(total_size) << std::endl;
+ std::cout << " from '" << store_path << "' to '" << other_path << "'"
+ << std::endl;
+ std::cout << " duration " << duration << " seconds" << std::endl;
+}
+
int StoreTool::copy_store_to(const string& type, const string& other_path,
const int num_keys_per_tx,
const string& other_type)
} while (it->valid());
- std::cout << "summary:" << std::endl;
- std::cout << " copied " << total_keys << " keys" << std::endl;
- std::cout << " used " << total_txs << " transactions" << std::endl;
- std::cout << " total size " << byte_u_t(total_size) << std::endl;
- std::cout << " from '" << store_path << "' to '" << other_path << "'"
- << std::endl;
- std::cout << " duration " << duration() << " seconds" << std::endl;
+ print_summary(total_keys, total_size, total_txs, store_path, other_path,
+ duration());
return 0;
}
ceph::bufferlist& val);
bool rm(const std::string& prefix, const std::string& key);
bool rm_prefix(const std::string& prefix);
+ void print_summary(const uint64_t total_keys, const uint64_t total_size,
+ const uint64_t total_txs, const std::string& store_path,
+ const std::string& other_path, const int duration) const;
int copy_store_to(const std::string& type, const std::string& other_path,
const int num_keys_per_tx, const std::string& other_type);
void compact();