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

Function createEmptyCheckStatusInfo

src/checks/checker.cpp:61–85  ·  view source on GitHub ↗

Creates a valid instance of `CheckStatusInfo` with the `type` set in accordance to the associated `CheckInfo`.

Source from the content-addressed store, hash-verified

59// Creates a valid instance of `CheckStatusInfo` with the `type` set in
60// accordance to the associated `CheckInfo`.
61static CheckStatusInfo createEmptyCheckStatusInfo(const CheckInfo& checkInfo) {
62 CheckStatusInfo checkStatusInfo;
63 checkStatusInfo.set_type(checkInfo.type());
64
65 switch (checkInfo.type()) {
66 case CheckInfo::COMMAND: {
67 checkStatusInfo.mutable_command();
68 break;
69 }
70 case CheckInfo::HTTP: {
71 checkStatusInfo.mutable_http();
72 break;
73 }
74 case CheckInfo::TCP: {
75 checkStatusInfo.mutable_tcp();
76 break;
77 }
78 case CheckInfo::UNKNOWN: {
79 LOG(FATAL) << "Received UNKNOWN check type";
80 break;
81 }
82 }
83
84 return checkStatusInfo;
85}
86
87
88Try<Owned<Checker>> Checker::create(

Callers 2

CheckerMethod · 0.85
processCheckResultMethod · 0.85

Calls 1

typeMethod · 0.80

Tested by

no test coverage detected