vagetablechicken commented on a change in pull request #3143:
URL: https://github.com/apache/incubator-doris/pull/3143#discussion_r417745660
##########
File path: be/src/exec/tablet_sink.h
##########
@@ -68,99 +154,126 @@ class NodeChannel {
Status add_row(Tuple* tuple, int64_t tablet_id);
- Status close(RuntimeState* state);
+ // two ways to stop channel:
+ // 1. mark_close()->close_wait() PS. close_wait() will block waiting for
the last AddBatch rpc response.
+ // 2. just cancel()
+ Status mark_close();
Status close_wait(RuntimeState* state);
void cancel();
- int64_t node_id() const { return _node_id; }
+ // return:
+ // 0: stopped, send finished(eos request has been sent), or any internal
error;
+ // 1: running, haven't reach eos.
+ // only allow 1 rpc in flight
+ int try_send_and_fetch_status();
+
+ void time_report(std::unordered_map<int64_t, AddBatchCounter>&
add_batch_counter_map,
+ int64_t* serialize_batch_ns, int64_t*
mem_exceeded_block_ns,
+ int64_t* queue_push_lock_ns, int64_t* actual_consume_ns) {
+ add_batch_counter_map[_node_id] += _add_batch_counter;
+ *serialize_batch_ns += _serialize_batch_ns;
+ *mem_exceeded_block_ns += _mem_exceeded_block_ns;
+ *queue_push_lock_ns += _queue_push_lock_ns;
+ *actual_consume_ns += _actual_consume_ns;
+ }
- void set_failed() { _already_failed = true; }
- bool already_failed() const { return _already_failed; }
+ int64_t node_id() const { return _node_id; }
const NodeInfo* node_info() const { return _node_info; }
+ std::string print_load_info() const { return _load_info; }
+ std::string name() const {
+ return "NodeChannel[" + std::to_string(_index_id) + "-" +
std::to_string(_node_id) + "]";
Review comment:
including gutils/strings/Substitute.h will occur redefinition error
```
In file included from
/root/incubator-doris/be/src/gutil/strings/stringpiece.h:128:0,
from
/root/incubator-doris/be/src/gutil/strings/substitute.h:9,
from /root/incubator-doris/be/src/exec/tablet_sink.cpp:28:
/root/incubator-doris/be/src/gutil/hash/hash.h:251:26: error: redefinition
of 'struct __gnu_cxx::hash<Type*>'
template<class T> struct hash<T*> {
^~~~~~~~
In file included from
/root/incubator-doris/thirdparty/installed/include/butil/containers/flat_map.h:101:0,
from /root/incubator-doris/be/src/service/brpc.h:48,
from
/root/incubator-doris/be/src/util/ref_count_closure.h:24,
from /root/incubator-doris/be/src/exec/tablet_sink.h:36,
from /root/incubator-doris/be/src/exec/tablet_sink.cpp:18:
/root/incubator-doris/thirdparty/installed/include/butil/containers/hash_tables.h:262:8:
note: previous definition of 'struct __gnu_cxx::hash<Type*>'
struct hash<Type*> {
^~~~~~~~~~~
In file included from
/root/incubator-doris/be/src/gutil/strings/stringpiece.h:128:0,
from
/root/incubator-doris/be/src/gutil/strings/substitute.h:9,
from /root/incubator-doris/be/src/exec/tablet_sink.cpp:28:
/root/incubator-doris/be/src/gutil/hash/hash.h:309:8: error: redefinition of
'struct __gnu_cxx::hash<std::pair<_T1, _T2> >'
struct hash<pair<First, Second> > {
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from
/root/incubator-doris/thirdparty/installed/include/butil/containers/flat_map.h:101:0,
from /root/incubator-doris/be/src/service/brpc.h:48,
from
/root/incubator-doris/be/src/util/ref_count_closure.h:24,
from /root/incubator-doris/be/src/exec/tablet_sink.h:36,
from /root/incubator-doris/be/src/exec/tablet_sink.cpp:18:
/root/incubator-doris/thirdparty/installed/include/butil/containers/hash_tables.h:256:8:
note: previous definition of 'struct __gnu_cxx::hash<std::pair<_T1, _T2> >'
struct hash<std::pair<Type1, Type2> > {
```
I will initialize the name_string in init(), to avoid string building in
name()
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]