Class FlinkImageBuilder


  • public class FlinkImageBuilder
    extends Object
    A builder class for constructing Docker image based on flink-dist.
    • Constructor Detail

      • FlinkImageBuilder

        public FlinkImageBuilder()
    • Method Detail

      • setTempDirectory

        public FlinkImageBuilder setTempDirectory​(Path tempDirectory)
        Sets temporary path for holding temp files when building the image.

        Note that this parameter is required, because the builder doesn't have lifecycle management, and it is the caller's responsibility to create and remove the temp directory.

      • setFlinkHome

        public FlinkImageBuilder setFlinkHome​(String flinkHome)
        Sets flink home.
        Parameters:
        flinkHome - The flink home.
        Returns:
        The flink home.
      • setImageNamePrefix

        public FlinkImageBuilder setImageNamePrefix​(String imageNamePrefix)
        Sets the prefix name of building image.

        If the name is not specified, DEFAULT_IMAGE_NAME_BUILD_PREFIX will be used.

      • setFlinkDistPath

        public FlinkImageBuilder setFlinkDistPath​(Path flinkDist)
        Sets the path of flink-dist directory.

        If path is not specified, the dist directory under current project will be used.

      • setJavaVersion

        public FlinkImageBuilder setJavaVersion​(String javaVersion)
        Sets JDK version in the image.

        This version string will be used as the tag of openjdk image. If version is not specified, the JDK version of the current JVM will be used.

        See Also:
        OpenJDK on Docker Hub for all available tags.
      • setConfiguration

        public FlinkImageBuilder setConfiguration​(org.apache.flink.configuration.Configuration conf)
        Sets Flink configuration. This configuration will be used for generating config.yaml for configuring JobManager and TaskManager.
      • setLogProperties

        public FlinkImageBuilder setLogProperties​(Properties logProperties)
        Sets log4j properties.

        Containers will use "log4j-console.properties" under flink-dist as the base configuration of loggers. Properties specified by this method will be appended to the config file, or overwrite the property if already exists in the base config file.

      • setTimeout

        public FlinkImageBuilder setTimeout​(java.time.Duration timeout)
        Sets timeout for building the image.
      • asJobManager

        public FlinkImageBuilder asJobManager()
        Use this image for building a JobManager.
      • asTaskManager

        public FlinkImageBuilder asTaskManager()
        Use this image for building a TaskManager.
      • useCustomStartupCommand

        public FlinkImageBuilder useCustomStartupCommand​(String command)
        Use a custom command for starting up the container.
      • setBaseImage

        public FlinkImageBuilder setBaseImage​(String baseImage)
        Sets base image.
        Parameters:
        baseImage - The base image.
        Returns:
        A reference to this Builder.