kangkaisen commented on a change in pull request #3742: URL: https://github.com/apache/incubator-doris/pull/3742#discussion_r433311525
########## File path: be/src/olap/push_handler.cpp ########## @@ -761,6 +915,126 @@ OLAPStatus LzoBinaryReader::_next_block() { return res; } +OLAPStatus PushBrokerReader::init(const Schema* schema, + const TBrokerScanRange& t_scan_range, + const TDescriptorTable& t_desc_tbl) { + // init schema + _schema = schema; + + // init runtime state, runtime profile, counter + TUniqueId dummy_id; + dummy_id.hi = 0; + dummy_id.lo = 0; + TPlanFragmentExecParams params; + params.fragment_instance_id = dummy_id; + params.query_id = dummy_id; + TExecPlanFragmentParams fragment_params; + fragment_params.params = params; + fragment_params.protocol_version = PaloInternalServiceVersion::V1; + TQueryOptions query_options; + TQueryGlobals query_globals; + _runtime_state.reset(new RuntimeState(fragment_params, query_options, query_globals, + ExecEnv::GetInstance())); + DescriptorTbl* desc_tbl = NULL; + Status status = DescriptorTbl::create(_runtime_state->obj_pool(), t_desc_tbl, &desc_tbl); + if (UNLIKELY(!status.ok())) { + LOG(WARNING) << "Failed to create descriptor table, msg: " << status.get_error_msg(); + return OLAP_ERR_PUSH_INIT_ERROR; + } + _runtime_state->set_desc_tbl(desc_tbl); + status = _runtime_state->init_mem_trackers(dummy_id); + if (UNLIKELY(!status.ok())) { + LOG(WARNING) << "Failed to init mem trackers, msg: " << status.get_error_msg(); + return OLAP_ERR_PUSH_INIT_ERROR; + } + _runtime_profile.reset(new RuntimeProfile(_runtime_state->obj_pool(), "PushBrokerReader")); + _mem_tracker.reset(new MemTracker(-1)); Review comment: Why don't set a memory limit? ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org