| 74 | } |
| 75 | |
| 76 | void StartNameServer(brpc::Server& server) { //NOLINT |
| 77 | NameServerImpl* nameserver = new NameServerImpl(); |
| 78 | bool ok = nameserver->Init(""); |
| 79 | ASSERT_TRUE(ok); |
| 80 | brpc::ServerOptions options; |
| 81 | if (server.AddService(nameserver, brpc::SERVER_OWNS_SERVICE) != 0) { |
| 82 | PDLOG(WARNING, "Fail to add service"); |
| 83 | exit(1); |
| 84 | } |
| 85 | if (server.Start(FLAGS_endpoint.c_str(), &options) != 0) { |
| 86 | PDLOG(WARNING, "Fail to start server"); |
| 87 | exit(1); |
| 88 | } |
| 89 | sleep(2); |
| 90 | } |
| 91 | |
| 92 | void StartTablet(brpc::Server* server, ::fedb::tablet::TabletImpl* tablet) { //NOLINT |
| 93 | bool ok = tablet->Init(""); |