GehaFearless commented on code in PR #1091:
URL: https://github.com/apache/incubator-pegasus/pull/1091#discussion_r942264440
##########
src/client_lib/pegasus_scanner_impl.cpp:
##########
@@ -162,13 +168,16 @@ void
pegasus_client_impl::pegasus_scanner_impl::_async_next_internal()
}
// valid data got
- std::string hash_key, sort_key;
- pegasus_restore_key(_kvs[_p].key, hash_key, sort_key);
- std::string value(_kvs[_p].value.data(), _kvs[_p].value.length());
- uint32_t expire_ts_seconds = _kvs[_p].__isset.expire_ts_seconds
- ?
static_cast<uint32_t>(_kvs[_p].expire_ts_seconds)
- : 0;
-
+ std::string hash_key, sort_key, value;
+ uint32_t expire_ts_seconds = 0;
+ // _kv_count == -1 means req just want to get data counts, not include
data value
+ if (_kv_count == -1) {
Review Comment:
fix comment
##########
src/server/pegasus_server_impl.cpp:
##########
@@ -1221,6 +1222,10 @@ void pegasus_server_impl::on_get_scanner(get_scanner_rpc
rpc)
it->Next();
}
+ if (request.only_return_count) {
+ resp.kvs.emplace_back(::dsn::apps::key_value());
Review Comment:
I need not to refactor
`pegasus_client_impl::pegasus_scanner_impl::_async_next_internal()` if I fill
it.
##########
src/server/pegasus_server_impl.cpp:
##########
@@ -1198,7 +1198,8 @@ void pegasus_server_impl::on_get_scanner(get_scanner_rpc
rpc)
epoch_now,
request.no_value,
request.__isset.validate_partition_hash ?
request.validate_partition_hash : true,
- return_expire_ts);
+ return_expire_ts,
+ !request.only_return_count);
Review Comment:
Every kv need to be processd by a filter from `append_key_value_for_scan`.
##########
src/server/pegasus_server_impl.cpp:
##########
@@ -1389,6 +1401,11 @@ void pegasus_server_impl::on_scan(scan_rpc rpc)
it->Next();
}
+ if (!only_return_count) {
Review Comment:
`only_return_count ` is true means response `kvs` is empty, false means
response `kvs` will be filled by data.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]