Skip to content

Commit

Permalink
change a little
Browse files Browse the repository at this point in the history
  • Loading branch information
olivertang committed Feb 9, 2022
1 parent 3b3012c commit 205a2c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/server/capacity_unit_calculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void capacity_unit_calculator::add_batch_get_cu(dsn::message_ex *req,
{
int64_t data_size = 0;
for (const auto &data : datas) {
data_size += data.value.size();
data_size += data.hash_key.size() + data.sort_key.size() + data.value.size();
_read_hotkey_collector->capture_hash_key(data.hash_key, 1);
}

Expand Down
6 changes: 3 additions & 3 deletions src/server/pegasus_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ void pegasus_server_impl::on_batch_get(batch_get_rpc rpc)
keys.reserve(request.keys.size());
std::vector<::dsn::blob> keys_holder;
keys_holder.reserve(request.keys.size());
for (auto &key : request.keys) {
for (const auto &key : request.keys) {
::dsn::blob raw_key;
pegasus_generate_key(raw_key, key.hash_key, key.sort_key);
keys.emplace_back(rocksdb::Slice(raw_key.data(), raw_key.length()));
Expand Down Expand Up @@ -857,12 +857,12 @@ void pegasus_server_impl::on_batch_get(batch_get_rpc rpc)
"rocksdb get failed for batch_get from {}: error = {}, key size = {}",
replica_name(),
rpc.remote_address().to_string(),
status.ToString().c_str(),
status.ToString(),
request.keys.size());
} else {
derror_replica("rocksdb get failed for batch_get from {}: error = {}",
rpc.remote_address().to_string(),
status.ToString().c_str());
status.ToString());
}

error_occurred = true;
Expand Down

0 comments on commit 205a2c7

Please sign in to comment.