MCPcopy Create free account
hub / github.com/apache/mesos / doNames

Method doNames

src/state/zookeeper.cpp:426–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424
425
426Result<std::set<string>> ZooKeeperStorageProcess::doNames()
427{
428 // Get all children to determine current memberships.
429 vector<string> results;
430
431 int code = zk->getChildren(znode, false, &results);
432
433 if (code == ZINVALIDSTATE || (code != ZOK && zk->retryable(code))) {
434 CHECK(zk->getState() != ZOO_AUTH_FAILED_STATE);
435 return None(); // Try again later.
436 } else if (code != ZOK) {
437 return Error(
438 "Failed to get children of '" + znode +
439 "' in ZooKeeper: " + zk->message(code));
440 }
441
442 // TODO(benh): It might make sense to "mangle" the names so that we
443 // can determine when a znode has incorrectly been added that
444 // actually doesn't store an Entry.
445 return std::set<string>(results.begin(), results.end());
446}
447
448
449Result<Option<Entry>> ZooKeeperStorageProcess::doGet(const string& name)

Callers

nothing calls this directly

Calls 8

NoneClass · 0.85
retryableMethod · 0.80
ErrorFunction · 0.50
getChildrenMethod · 0.45
getStateMethod · 0.45
messageMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected