MCPcopy Create free account
hub / github.com/apache/impala / CreateFromThriftHelper

Method CreateFromThriftHelper

be/src/util/runtime-profile.cc:287–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287RuntimeProfileBase* RuntimeProfileBase::CreateFromThriftHelper(
288 ObjectPool* pool, const vector<TRuntimeProfileNode>& nodes, int* idx) {
289 DCHECK_LT(*idx, nodes.size());
290
291 const TRuntimeProfileNode& node = nodes[*idx];
292 RuntimeProfileBase* profile;
293 if (node.__isset.aggregated) {
294 DCHECK(node.aggregated.__isset.num_instances);
295 profile = AggregatedRuntimeProfile::Create(pool, node.name,
296 node.aggregated.num_instances, node.aggregated.__isset.input_profiles);
297 } else {
298 profile = RuntimeProfile::Create(pool, node.name);
299 }
300 profile->metadata_ = node.node_metadata;
301 profile->InitFromThrift(node, pool);
302 profile->child_counter_map_ = node.child_counters_map;
303
304 // TODO: IMPALA-9846: move to RuntimeProfile::InitFromThrift() once 'info_strings_' is
305 // moved.
306 profile->info_strings_ = node.info_strings;
307 profile->info_strings_display_order_ = node.info_strings_display_order;
308
309 ++*idx;
310 {
311 lock_guard<SpinLock> l(profile->children_lock_);
312 for (int i = 0; i < node.num_children; ++i) {
313 bool indent = nodes[*idx].indent;
314 profile->AddChildLocked(
315 RuntimeProfileBase::CreateFromThriftHelper(pool, nodes, idx),
316 indent, profile->children_.end());
317 }
318 }
319 return profile;
320}
321
322void RuntimeProfile::InitFromThrift(const TRuntimeProfileNode& node, ObjectPool* pool) {
323 // Only read 'counters' for non-aggregated profiles. Aggregated profiles will populate

Callers

nothing calls this directly

Calls 5

CreateClass · 0.85
InitFromThriftMethod · 0.80
AddChildLockedMethod · 0.80
sizeMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected