[CodeFormat] Clang-format cpp sources (#4965)
Clang-format all c++ source files.
This commit is contained in:
@ -19,31 +19,28 @@
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
#include "gen_cpp/PlanNodes_types.h"
|
||||
#include "runtime/data_stream_mgr.h"
|
||||
#include "runtime/data_stream_recvr.h"
|
||||
#include "runtime/exec_env.h"
|
||||
#include "runtime/runtime_state.h"
|
||||
#include "runtime/row_batch.h"
|
||||
#include "runtime/runtime_state.h"
|
||||
#include "util/runtime_profile.h"
|
||||
#include "gen_cpp/PlanNodes_types.h"
|
||||
|
||||
namespace doris {
|
||||
|
||||
ExchangeNode::ExchangeNode(
|
||||
ObjectPool* pool,
|
||||
const TPlanNode& tnode,
|
||||
const DescriptorTbl& descs) :
|
||||
ExecNode(pool, tnode, descs),
|
||||
_num_senders(0),
|
||||
_stream_recvr(NULL),
|
||||
_input_row_desc(descs, tnode.exchange_node.input_row_tuples,
|
||||
std::vector<bool>(
|
||||
tnode.nullable_tuples.begin(),
|
||||
tnode.nullable_tuples.begin() + tnode.exchange_node.input_row_tuples.size())),
|
||||
_next_row_idx(0),
|
||||
_is_merging(tnode.exchange_node.__isset.sort_info),
|
||||
_offset(tnode.exchange_node.__isset.offset ? tnode.exchange_node.offset : 0),
|
||||
_num_rows_skipped(0) {
|
||||
ExchangeNode::ExchangeNode(ObjectPool* pool, const TPlanNode& tnode, const DescriptorTbl& descs)
|
||||
: ExecNode(pool, tnode, descs),
|
||||
_num_senders(0),
|
||||
_stream_recvr(NULL),
|
||||
_input_row_desc(descs, tnode.exchange_node.input_row_tuples,
|
||||
std::vector<bool>(tnode.nullable_tuples.begin(),
|
||||
tnode.nullable_tuples.begin() +
|
||||
tnode.exchange_node.input_row_tuples.size())),
|
||||
_next_row_idx(0),
|
||||
_is_merging(tnode.exchange_node.__isset.sort_info),
|
||||
_offset(tnode.exchange_node.__isset.offset ? tnode.exchange_node.offset : 0),
|
||||
_num_rows_skipped(0) {
|
||||
DCHECK_GE(_offset, 0);
|
||||
DCHECK(_is_merging || (_offset == 0));
|
||||
}
|
||||
@ -67,13 +64,12 @@ Status ExchangeNode::prepare(RuntimeState* state) {
|
||||
DCHECK_GT(_num_senders, 0);
|
||||
_sub_plan_query_statistics_recvr.reset(new QueryStatisticsRecvr());
|
||||
_stream_recvr = state->exec_env()->stream_mgr()->create_recvr(
|
||||
state, _input_row_desc,
|
||||
state->fragment_instance_id(), _id,
|
||||
_num_senders, config::exchg_node_buffer_size_bytes,
|
||||
_runtime_profile.get(), _is_merging, _sub_plan_query_statistics_recvr);
|
||||
state, _input_row_desc, state->fragment_instance_id(), _id, _num_senders,
|
||||
config::exchg_node_buffer_size_bytes, _runtime_profile.get(), _is_merging,
|
||||
_sub_plan_query_statistics_recvr);
|
||||
if (_is_merging) {
|
||||
RETURN_IF_ERROR(_sort_exec_exprs.prepare(
|
||||
state, _row_descriptor, _row_descriptor, expr_mem_tracker()));
|
||||
RETURN_IF_ERROR(_sort_exec_exprs.prepare(state, _row_descriptor, _row_descriptor,
|
||||
expr_mem_tracker()));
|
||||
// AddExprCtxsToFree(_sort_exec_exprs);
|
||||
}
|
||||
return Status::OK();
|
||||
@ -122,9 +118,9 @@ Status ExchangeNode::fill_input_row_batch(RuntimeState* state) {
|
||||
ret_status = _stream_recvr->get_batch(&_input_batch);
|
||||
}
|
||||
VLOG_FILE << "exch: has batch=" << (_input_batch == NULL ? "false" : "true")
|
||||
<< " #rows=" << (_input_batch != NULL ? _input_batch->num_rows() : 0)
|
||||
<< " is_cancelled=" << (ret_status.is_cancelled() ? "true" : "false")
|
||||
<< " instance_id=" << state->fragment_instance_id();
|
||||
<< " #rows=" << (_input_batch != NULL ? _input_batch->num_rows() : 0)
|
||||
<< " is_cancelled=" << (ret_status.is_cancelled() ? "true" : "false")
|
||||
<< " instance_id=" << state->fragment_instance_id();
|
||||
return ret_status;
|
||||
}
|
||||
|
||||
@ -152,8 +148,8 @@ Status ExchangeNode::get_next(RuntimeState* state, RowBatch* output_batch, bool*
|
||||
SCOPED_TIMER(_convert_row_batch_timer);
|
||||
RETURN_IF_CANCELLED(state);
|
||||
// copy rows until we hit the limit/capacity or until we exhaust _input_batch
|
||||
while (!reached_limit() && !output_batch->at_capacity()
|
||||
&& _input_batch != NULL && _next_row_idx < _input_batch->capacity()) {
|
||||
while (!reached_limit() && !output_batch->at_capacity() && _input_batch != NULL &&
|
||||
_next_row_idx < _input_batch->capacity()) {
|
||||
TupleRow* src = _input_batch->get_row(_next_row_idx);
|
||||
|
||||
if (ExecNode::eval_conjuncts(ctxs, num_ctxs, src)) {
|
||||
@ -251,4 +247,4 @@ void ExchangeNode::debug_string(int indentation_level, std::stringstream* out) c
|
||||
*out << ")";
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace doris
|
||||
|
||||
Reference in New Issue
Block a user