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

Method waitNestedContainer

src/checks/checker_process.cpp:907–942  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

905
906
907Future<Option<int>> CheckerProcess::waitNestedContainer(
908 const ContainerID& containerId,
909 runtime::Nested nested)
910{
911 agent::Call call;
912 call.set_type(agent::Call::WAIT_NESTED_CONTAINER);
913
914 agent::Call::WaitNestedContainer* containerWait =
915 call.mutable_wait_nested_container();
916
917 containerWait->mutable_container_id()->CopyFrom(containerId);
918
919 http::Request request;
920 request.method = "POST";
921 request.url = nested.agentURL;
922 request.body = serialize(ContentType::PROTOBUF, evolve(call));
923 request.headers = {{"Accept", stringify(ContentType::PROTOBUF)},
924 {"Content-Type", stringify(ContentType::PROTOBUF)}};
925
926 if (nested.authorizationHeader.isSome()) {
927 request.headers["Authorization"] = nested.authorizationHeader.get();
928 }
929
930 // TODO(alexr): Use a lambda named capture for
931 // this cached value once it is available.
932 const string _name = name;
933
934 return http::request(request, false)
935 .repair([containerId, _name](const Future<http::Response>& future) {
936 return Failure(
937 "Connection to wait for " + _name + " container '" +
938 stringify(containerId) + "' failed: " + future.failure());
939 })
940 .then(defer(self(),
941 &Self::_waitNestedContainer, containerId, lambda::_1));
942}
943
944
945Future<Option<int>> CheckerProcess::_waitNestedContainer(

Callers

nothing calls this directly

Calls 12

requestFunction · 0.85
FailureClass · 0.85
deferFunction · 0.85
CopyFromMethod · 0.80
repairMethod · 0.80
failureMethod · 0.80
serializeFunction · 0.50
evolveFunction · 0.50
stringifyFunction · 0.50
isSomeMethod · 0.45
getMethod · 0.45
thenMethod · 0.45

Tested by

no test coverage detected