acelyc111 commented on code in PR #1091:
URL: https://github.com/apache/incubator-pegasus/pull/1091#discussion_r948637764


##########
src/shell/commands/data_operations.cpp:
##########
@@ -2333,6 +2333,7 @@ bool count_data(command_executor *e, shell_context *sc, 
arguments args)
         tp.output(std::cout, tp_output_format::kTabular);
         return true;
     }
+    options.only_return_count = true;

Review Comment:
   why set it here? only need to set it when `-c` flag is set, right?



##########
src/client_lib/pegasus_scanner_impl.cpp:
##########
@@ -261,6 +277,17 @@ void 
pegasus_client_impl::pegasus_scanner_impl::_on_scan_response(::dsn::error_c
             _kvs = std::move(response.kvs);
             _p = -1;
             _context = response.context_id;
+            // 1. kv_count exist on response means server is newer version 
(added counting size only
+            // implementation)
+            //   1> kv_count == -1 indicates response still have key and value 
data
+            //   2> kv_count > -1 indicates response only have kv size count, 
but not key && value
+            // 2. kv_count is not existed means server is older version
+            if (response.__isset.kv_count) {
+                if (response.kv_count != -1) {
+                    _already_add_count = false;

Review Comment:
   I don't understand what does `_already_add_count` mean, why set it to false 
here



##########
src/client_lib/pegasus_scanner_impl.cpp:
##########
@@ -51,17 +51,20 @@ 
pegasus_client_impl::pegasus_scanner_impl::pegasus_scanner_impl(::dsn::apps::rrd
       _options(options),
       _splits_hash(std::move(hash)),
       _p(-1),
+      _kv_count(-1),
       _context(SCAN_CONTEXT_ID_COMPLETED),
       _rpc_started(false),
       _validate_partition_hash(validate_partition_hash),
-      _full_scan(full_scan)
+      _full_scan(full_scan),
+      _already_add_count(true)

Review Comment:
   why the default value is true?



-- 
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]

Reply via email to