Class PythonService
java.lang.Object
org.apache.beam.sdk.extensions.python.PythonService
Utility to bootstrap and start a Beam Python service.
-
Constructor Summary
ConstructorsConstructorDescriptionPythonService(String module, String... args) PythonService(String module, List<String> args) -
Method Summary
Modifier and TypeMethodDescriptionstatic intstart()static voidwaitForPort(String host, int port, int timeoutMs) withCustomBeamRequirement(String customBeamRequirement) Override the Beam version to be installed in the service environment.withExtraPackages(List<String> extraPackages) Specifies that the given Python packages should be installed for this service environment.
-
Constructor Details
-
PythonService
-
PythonService
-
PythonService
-
-
Method Details
-
withExtraPackages
Specifies that the given Python packages should be installed for this service environment.- Parameters:
extraPackages- a list of pip-installable package specifications, such as would be found in a requirements file.- Returns:
- a Python Service object that will ensure these dependencies are available.
-
withCustomBeamRequirement
Override the Beam version to be installed in the service environment.- Parameters:
customBeamRequirement- the custom Beam requirement, can be a version (e.g. 2.57.0) or a path (e.g. /path/to/apache-beam.whl).- Returns:
- this instance where Beam version overriden in place.
-
start
- Throws:
IOExceptionInterruptedException
-
findAvailablePort
- Throws:
IOException
-
waitForPort
public static void waitForPort(String host, int port, int timeoutMs) throws TimeoutException, InterruptedException - Throws:
TimeoutExceptionInterruptedException
-