Class FlinkContainersSettings.Builder
- java.lang.Object
-
- org.apache.flink.connector.testframe.container.FlinkContainersSettings.Builder
-
- Enclosing class:
- FlinkContainersSettings
public static final class FlinkContainersSettings.Builder extends Object
FlinkContainersConfig
builder static inner class.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> FlinkContainersSettings.Builder
basedOn(Configuration config)
Merges the providedconfig
with the default config, potentially overwriting the defaults in case of collisions.FlinkContainersSettings.Builder
baseImage(String baseImage)
Sets thebaseImage
and returns a reference to this Builder enabling method chaining.FlinkContainersSettings
build()
Returns aFlinkContainersConfig
built from the parameters previously set.FlinkContainersSettings.Builder
checkpointPath(String checkpointPath)
Sets thecheckpointPath
and returns a reference to this Builder enabling method chaining.FlinkContainersSettings.Builder
enableZookeeperHA()
Enables Zookeeper HA.FlinkContainersSettings.Builder
flinkDistLocation(String flinkDistLocation)
Sets theflinkDistLocation
and returns a reference to this Builder enabling method chaining.FlinkContainersSettings.Builder
flinkHome(String flinkHome)
Sets the path of the Flink distribution inside the container.<T> FlinkContainersSettings.Builder
fullConfiguration(Configuration config)
Sets theflinkConfiguration
value toconfig
and returns a reference to this Builder enabling method chaining.FlinkContainersSettings.Builder
haStoragePath(String haStoragePath)
Sets thehaStoragePath
and returns a reference to this Builder enabling method chaining.FlinkContainersSettings.Builder
jarPaths(String... jarPaths)
Sets thejarPaths
and returns a reference to this Builder enabling method chaining.FlinkContainersSettings.Builder
jarPaths(Collection<String> jarPaths)
Sets thejarPaths
and returns a reference to this Builder enabling method chaining.FlinkContainersSettings.Builder
jobManagerHostname(String jobManagerHostname)
Sets the job manager hostname and returns a reference to this Builder enabling method chaining.FlinkContainersSettings.Builder
numSlotsPerTaskManager(int numSlotsPerTaskManager)
Sets thenumSlotsPerTaskManager
and returns a reference to this Builder enabling method chaining.FlinkContainersSettings.Builder
numTaskManagers(int numTaskManagers)
Sets thenumTaskManagers
and returns a reference to this Builder enabling method chaining.<T> FlinkContainersSettings.Builder
setConfigOption(ConfigOption<T> option, T value)
Sets a single Flink configuration parameter (the options for config.yaml) and returns a reference to this Builder enabling method chaining.FlinkContainersSettings.Builder
setLogProperty(String key, String value)
Sets a single Flink logging configuration property in the log4j format and returns a reference to this Builder enabling method chaining.FlinkContainersSettings.Builder
taskManagerHostnamePrefix(String taskManagerHostnamePrefix)
Sets thetaskManagerHostnamePrefix
and returns a reference to this Builder enabling method chaining.FlinkContainersSettings.Builder
zookeeperHostname(String zookeeperHostname)
Sets thezookeeperHostname
and returns a reference to this Builder enabling method chaining.
-
-
-
Method Detail
-
baseImage
public FlinkContainersSettings.Builder baseImage(String baseImage)
Sets thebaseImage
and returns a reference to this Builder enabling method chaining.- Parameters:
baseImage
- ThebaseImage
to set.- Returns:
- A reference to this Builder.
-
flinkDistLocation
public FlinkContainersSettings.Builder flinkDistLocation(String flinkDistLocation)
Sets theflinkDistLocation
and returns a reference to this Builder enabling method chaining.- Parameters:
flinkDistLocation
- TheflinkDistLocation
to set.- Returns:
- A reference to this Builder.
-
flinkHome
public FlinkContainersSettings.Builder flinkHome(String flinkHome)
Sets the path of the Flink distribution inside the container. Returns a reference to this Builder enabling method chaining.- Parameters:
flinkHome
- TheflinkHome
to set.- Returns:
- A reference to this Builder.
-
checkpointPath
public FlinkContainersSettings.Builder checkpointPath(String checkpointPath)
Sets thecheckpointPath
and returns a reference to this Builder enabling method chaining.- Parameters:
checkpointPath
- The checkpoint path to set.- Returns:
- A reference to this Builder.
-
haStoragePath
public FlinkContainersSettings.Builder haStoragePath(String haStoragePath)
Sets thehaStoragePath
and returns a reference to this Builder enabling method chaining.- Parameters:
haStoragePath
- The path for storing HA data.- Returns:
- A reference to this Builder.
-
zookeeperHostname
public FlinkContainersSettings.Builder zookeeperHostname(String zookeeperHostname)
Sets thezookeeperHostname
and returns a reference to this Builder enabling method chaining.- Parameters:
zookeeperHostname
- The Zookeeper hostname.- Returns:
- A reference to this Builder.
-
enableZookeeperHA
public FlinkContainersSettings.Builder enableZookeeperHA()
Enables Zookeeper HA. NOTE: this option uses default HA configuration. If you want to use non-default configuration, you should provide all settings, including the HA_MODE directly via thebasedOn()
method instead.- Returns:
- A reference to this Builder.
-
numTaskManagers
public FlinkContainersSettings.Builder numTaskManagers(int numTaskManagers)
Sets thenumTaskManagers
and returns a reference to this Builder enabling method chaining.- Parameters:
numTaskManagers
- ThenumTaskManagers
to set.- Returns:
- A reference to this Builder.
-
numSlotsPerTaskManager
public FlinkContainersSettings.Builder numSlotsPerTaskManager(int numSlotsPerTaskManager)
Sets thenumSlotsPerTaskManager
and returns a reference to this Builder enabling method chaining. It also adds this property into theflinkConfiguration
field.- Parameters:
numSlotsPerTaskManager
- ThenumSlotsPerTaskManager
to set.- Returns:
- A reference to this Builder.
-
jarPaths
public FlinkContainersSettings.Builder jarPaths(String... jarPaths)
Sets thejarPaths
and returns a reference to this Builder enabling method chaining.- Parameters:
jarPaths
- ThejarPaths
to set.- Returns:
- A reference to this Builder.
-
jarPaths
public FlinkContainersSettings.Builder jarPaths(Collection<String> jarPaths)
Sets thejarPaths
and returns a reference to this Builder enabling method chaining.- Parameters:
jarPaths
- ThejarPaths
to set.- Returns:
- A reference to this Builder.
-
setConfigOption
public <T> FlinkContainersSettings.Builder setConfigOption(ConfigOption<T> option, T value)
Sets a single Flink configuration parameter (the options for config.yaml) and returns a reference to this Builder enabling method chaining.- Type Parameters:
T
- The type parameter.- Parameters:
option
- The option.value
- The value.- Returns:
- A reference to this Builder.
-
setLogProperty
public FlinkContainersSettings.Builder setLogProperty(String key, String value)
Sets a single Flink logging configuration property in the log4j format and returns a reference to this Builder enabling method chaining.- Parameters:
key
- The property key.value
- The property value.- Returns:
- A reference to this Builder.
-
basedOn
public <T> FlinkContainersSettings.Builder basedOn(Configuration config)
Merges the providedconfig
with the default config, potentially overwriting the defaults in case of collisions. Returns a reference to this Builder enabling method chaining.- Type Parameters:
T
- the type parameter- Parameters:
config
- Theconfig
to add.- Returns:
- A reference to this Builder.
-
fullConfiguration
public <T> FlinkContainersSettings.Builder fullConfiguration(Configuration config)
Sets theflinkConfiguration
value toconfig
and returns a reference to this Builder enabling method chaining.- Type Parameters:
T
- the type parameter- Parameters:
config
- Theconfig
to set.- Returns:
- A reference to this Builder.
-
taskManagerHostnamePrefix
public FlinkContainersSettings.Builder taskManagerHostnamePrefix(String taskManagerHostnamePrefix)
Sets thetaskManagerHostnamePrefix
and returns a reference to this Builder enabling method chaining.- Parameters:
taskManagerHostnamePrefix
- ThetaskManagerHostnamePrefix
to set.- Returns:
- A reference to this Builder.
-
jobManagerHostname
public FlinkContainersSettings.Builder jobManagerHostname(String jobManagerHostname)
Sets the job manager hostname and returns a reference to this Builder enabling method chaining.- Parameters:
jobManagerHostname
- The job manager hostname to set.- Returns:
- A reference to this Builder.
-
build
public FlinkContainersSettings build()
Returns aFlinkContainersConfig
built from the parameters previously set.- Returns:
- A
FlinkContainersConfig
built with parameters of thisFlinkContainersConfig.Builder
.
-
-