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

Function checkInfoToCheck

src/checks/checker_process.cpp:204–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202
203
204static Variant<check::Command, check::Http, check::Tcp> checkInfoToCheck(
205 const CheckInfo& checkInfo,
206 const string& launcherDir,
207 const Option<string>& scheme,
208 bool ipv6)
209{
210 // Use the `CheckInfo` struct to create the right
211 // `check::{Command, Http, Tcp}` struct.
212 switch (checkInfo.type()) {
213 case CheckInfo::COMMAND: {
214 return check::Command(checkInfo.command().command());
215 }
216 case CheckInfo::HTTP: {
217 const CheckInfo::Http& http = checkInfo.http();
218 return check::Http(
219 http.port(),
220 http.has_path() ? http.path() : "",
221 scheme.getOrElse(check::DEFAULT_HTTP_SCHEME),
222 ipv6);
223 }
224 case CheckInfo::TCP: {
225 return check::Tcp(checkInfo.tcp().port(), launcherDir);
226 }
227 case CheckInfo::UNKNOWN: {
228 // TODO(josephw): Add validation at the agent or master level.
229 // Without validation, this is considered a mis-configuration of the
230 // task (user error).
231 LOG(FATAL) << "Received UNKNOWN check type";
232 }
233 }
234
235 UNREACHABLE();
236}
237
238
239CheckerProcess::CheckerProcess(

Callers 1

CheckerProcessMethod · 0.85

Calls 7

CommandClass · 0.85
TcpClass · 0.85
typeMethod · 0.80
commandMethod · 0.80
getOrElseMethod · 0.80
HttpClass · 0.70
pathMethod · 0.45

Tested by

no test coverage detected