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

Method doData

src/zookeeper/group.cpp:690–719  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688
689
690Result<Option<string>> GroupProcess::doData(
691 const Group::Membership& membership)
692{
693 CHECK_EQ(state, READY);
694
695 string path = path::join(
696 znode,
697 zkBasename(membership),
698 os::POSIX_PATH_SEPARATOR);
699
700 LOG(INFO) << "Trying to get '" << path << "' in ZooKeeper";
701
702 // Get data associated with ephemeral node.
703 string result;
704
705 int code = zk->get(path, false, &result, nullptr);
706
707 if (code == ZNONODE) {
708 return Option<string>::none();
709 } else if (code == ZINVALIDSTATE || (code != ZOK && zk->retryable(code))) {
710 CHECK_NE(zk->getState(), ZOO_AUTH_FAILED_STATE);
711 return None(); // Try again later.
712 } else if (code != ZOK) {
713 return Error(
714 "Failed to get data for ephemeral node '" + path +
715 "' in ZooKeeper: " + zk->message(code));
716 }
717
718 return Some(result);
719}
720
721
722Try<bool> GroupProcess::cache()

Callers

nothing calls this directly

Calls 8

NoneClass · 0.85
SomeFunction · 0.85
retryableMethod · 0.80
joinFunction · 0.50
ErrorFunction · 0.50
getMethod · 0.45
getStateMethod · 0.45
messageMethod · 0.45

Tested by

no test coverage detected