Class PythonService

java.lang.Object
org.apache.beam.sdk.extensions.python.PythonService

public class PythonService extends Object
Utility to bootstrap and start a Beam Python service.
  • Constructor Details

  • Method Details

    • withExtraPackages

      public PythonService withExtraPackages(List<String> extraPackages)
      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

      public PythonService withCustomBeamRequirement(String customBeamRequirement)
      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:
      IOException
      InterruptedException
    • findAvailablePort

      public static int findAvailablePort() throws IOException
      Throws:
      IOException
    • waitForPort

      public static void waitForPort(String host, int port, int timeoutMs) throws TimeoutException, InterruptedException
      Throws:
      TimeoutException
      InterruptedException