MCPcopy Create free account
hub / github.com/apache/arrow / MakeServer

Function MakeServer

cpp/src/arrow/flight/test_util.h:79–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77// populate options.
78template <typename T, typename... Args>
79Status MakeServer(const Location& location, std::unique_ptr<FlightServerBase>* server,
80 std::unique_ptr<FlightClient>* client,
81 std::function<Status(FlightServerOptions*)> make_server_options,
82 std::function<Status(FlightClientOptions*)> make_client_options,
83 Args&&... server_args) {
84 *server = std::make_unique<T>(std::forward<Args>(server_args)...);
85 FlightServerOptions server_options(location);
86 RETURN_NOT_OK(make_server_options(&server_options));
87 RETURN_NOT_OK((*server)->Init(server_options));
88 std::string uri =
89 location.scheme() + "://127.0.0.1:" + std::to_string((*server)->port());
90 ARROW_ASSIGN_OR_RAISE(auto real_location, Location::Parse(uri));
91 FlightClientOptions client_options = FlightClientOptions::Defaults();
92 RETURN_NOT_OK(make_client_options(&client_options));
93 return FlightClient::Connect(real_location, client_options).Value(client);
94}
95
96// Helper to initialize a server and matching client with callbacks to
97// populate options.

Callers 1

ARROW_ASSIGN_OR_RAISEMethod · 0.85

Calls 6

to_stringFunction · 0.85
DefaultsFunction · 0.50
InitMethod · 0.45
schemeMethod · 0.45
portMethod · 0.45
ValueMethod · 0.45

Tested by

no test coverage detected