apache_beam.utils.subprocess_server module
- class apache_beam.utils.subprocess_server.SubprocessServer(stub_class, cmd, port=None)[source]
Bases:
object
An abstract base class for running GRPC Servers as an external process.
This class acts as a context which will start up a server, provides a stub to connect to it, and then shuts the server down. For example:
with SubprocessServer(GrpcStubClass, [executable, arg, ...]) as stub: stub.CallService(...)
Creates the server object.
- Parameters:
stub_class – the auto-generated GRPC client stub class used for connecting to the GRPC service
cmd – command (including arguments) for starting up the server, suitable for passing to subprocess.POpen.
port – (optional) the port at which the subprocess will serve its service. If not given, one will be randomly chosen and the special string “{{PORT}}” will be substituted in the command line arguments with the chosen port.
- class apache_beam.utils.subprocess_server.JavaJarServer(stub_class, path_to_jar, java_arguments, classpath=None, cache_dir=None)[source]
Bases:
SubprocessServer
- MAVEN_CENTRAL_REPOSITORY = 'https://repo.maven.apache.org/maven2'
- BEAM_GROUP_ID = 'org.apache.beam'
- JAR_CACHE = '/home/runner/.apache_beam/cache/jars'
- classmethod path_to_maven_jar(artifact_id, group_id, version, repository='https://repo.maven.apache.org/maven2', classifier=None, appendix=None)[source]