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

Method startup

src/tests/mock_csi_plugin.cpp:323–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321
322
323Try<Connection> MockCSIPlugin::startup(const Option<string>& address)
324{
325 ServerBuilder builder;
326
327 if (address.isSome()) {
328 builder.AddListeningPort(address.get(), InsecureServerCredentials());
329 }
330
331 builder.RegisterService(static_cast<csi::v0::Identity::Service*>(this));
332 builder.RegisterService(static_cast<csi::v0::Controller::Service*>(this));
333 builder.RegisterService(static_cast<csi::v0::Node::Service*>(this));
334 builder.RegisterService(static_cast<csi::v1::Identity::Service*>(this));
335 builder.RegisterService(static_cast<csi::v1::Controller::Service*>(this));
336 builder.RegisterService(static_cast<csi::v1::Node::Service*>(this));
337
338 server = builder.BuildAndStart();
339 if (!server) {
340 return Error("Unable to start a mock CSI plugin.");
341 }
342
343 return address.isSome()
344 ? Connection(address.get())
345 : Connection(server->InProcessChannel(ChannelArguments()));
346}
347
348
349Try<Nothing> MockCSIPlugin::shutdown()

Callers 4

SetUpMethod · 0.45
startNetworkMethod · 0.45
TEST_PFunction · 0.45
startMethod · 0.45

Calls 4

ErrorFunction · 0.50
ConnectionClass · 0.50
isSomeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected