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

Function ParsePoolTopicKey

be/src/scheduling/admission-controller.cc:344–355  ·  view source on GitHub ↗

Parses the pool name and backend_id from the topic key if it is valid. Returns true if the topic key is valid and pool_name and backend_id are set.

Source from the content-addressed store, hash-verified

342// Parses the pool name and backend_id from the topic key if it is valid.
343// Returns true if the topic key is valid and pool_name and backend_id are set.
344static inline bool ParsePoolTopicKey(
345 const string& topic_key, string* pool_name, string* backend_id) {
346 // Pool topic keys will look something like: poolname!hostname:22000
347 size_t pos = topic_key.find_last_of(TOPIC_KEY_DELIMITER);
348 if (pos == string::npos || pos >= topic_key.size() - 1) {
349 VLOG_QUERY << "Invalid topic key for pool: " << topic_key;
350 return false;
351 }
352 *pool_name = topic_key.substr(0, pos);
353 *backend_id = topic_key.substr(pos + 1);
354 return true;
355}
356
357// Checks a query will exceed the admission service process memory limit.
358// If the limit is exceeded, returns true and the 'rejection_reason'.

Callers 1

HandleTopicUpdatesMethod · 0.85

Calls 3

substrMethod · 0.80
find_last_ofMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected