Class FlinkImageBuilder
java.lang.Object
org.apache.flink.connector.testframe.container.FlinkImageBuilder
A builder class for constructing Docker image based on flink-dist.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionUse this image for building a JobManager.Use this image for building a TaskManager.org.testcontainers.images.builder.ImageFromDockerfilebuild()Build the image.Copies file into the image.setBaseImage(String baseImage) Sets base image.setConfiguration(org.apache.flink.configuration.Configuration conf) Sets Flink configuration.setFlinkDistPath(Path flinkDist) Sets the path of flink-dist directory.setFlinkHome(String flinkHome) Sets flink home.setImageNamePrefix(String imageNamePrefix) Sets the prefix name of building image.setJavaVersion(String javaVersion) Sets JDK version in the image.setLogProperties(Properties logProperties) Sets log4j properties.setTempDirectory(Path tempDirectory) Sets temporary path for holding temp files when building the image.setTimeout(Duration timeout) Sets timeout for building the image.useCustomStartupCommand(String command) Use a custom command for starting up the container.
-
Constructor Details
-
FlinkImageBuilder
public FlinkImageBuilder()
-
-
Method Details
-
setTempDirectory
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
Sets flink home.- Parameters:
flinkHome- The flink home.- Returns:
- The flink home.
-
setImageNamePrefix
Sets the prefix name of building image.If the name is not specified,
DEFAULT_IMAGE_NAME_BUILD_PREFIXwill be used. -
setFlinkDistPath
Sets the path of flink-dist directory.If path is not specified, the dist directory under current project will be used.
-
setJavaVersion
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
Sets Flink configuration. This configuration will be used for generating config.yaml for configuring JobManager and TaskManager. -
setLogProperties
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.
-
copyFile
Copies file into the image. -
setTimeout
Sets timeout for building the image. -
asJobManager
Use this image for building a JobManager. -
asTaskManager
Use this image for building a TaskManager. -
useCustomStartupCommand
Use a custom command for starting up the container. -
setBaseImage
Sets base image.- Parameters:
baseImage- The base image.- Returns:
- A reference to this Builder.
-
build
Build the image.- Throws:
ImageBuildException
-