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

Method flight_server

dev/archery/archery/integration/tester_java.py:324–349  ·  view source on GitHub ↗
(self, scenario_name=None)

Source from the content-addressed store, hash-verified

322
323 @contextlib.contextmanager
324 def flight_server(self, scenario_name=None):
325 cmd = (
326 ['java'] +
327 self._java_opts +
328 ['-cp', _ARROW_FLIGHT_JAR, _ARROW_FLIGHT_SERVER, '-port', '0']
329 )
330 if scenario_name:
331 cmd.extend(('-scenario', scenario_name))
332 if self.debug:
333 log(' '.join(cmd))
334 server = subprocess.Popen(
335 cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
336 try:
337 output = server.stdout.readline().decode()
338 if not output.startswith('Server listening on localhost:'):
339 server.kill()
340 out, err = server.communicate()
341 raise RuntimeError(
342 "Flight-Java server did not start properly, "
343 f"stdout:\n{output + out.decode()}\n\nstderr:\n{err.decode()}\n"
344 )
345 port = int(output.split(':')[1])
346 yield port
347 finally:
348 server.kill()
349 server.wait(5)
350
351 def make_c_data_exporter(self):
352 return JavaCDataExporter(self.debug, self.args)

Callers

nothing calls this directly

Calls 3

extendMethod · 0.80
joinMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected