PatrickRen commented on code in PR #19856:
URL: https://github.com/apache/flink/pull/19856#discussion_r899218732


##########
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/flink/container/FlinkContainersConfig.java:
##########
@@ -0,0 +1,599 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.tests.util.flink.container;
+
+import org.apache.flink.configuration.CheckpointingOptions;
+import org.apache.flink.configuration.ConfigOption;
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.configuration.HighAvailabilityOptions;
+import org.apache.flink.configuration.JobManagerOptions;
+import org.apache.flink.configuration.MemorySize;
+import org.apache.flink.configuration.RestOptions;
+import org.apache.flink.configuration.TaskManagerOptions;
+
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Properties;
+import java.util.UUID;
+
+import static 
org.apache.flink.configuration.HeartbeatManagerOptions.HEARTBEAT_INTERVAL;
+import static 
org.apache.flink.configuration.HeartbeatManagerOptions.HEARTBEAT_TIMEOUT;
+import static 
org.apache.flink.configuration.JobManagerOptions.SLOT_REQUEST_TIMEOUT;
+import static 
org.apache.flink.configuration.MetricOptions.METRIC_FETCHER_UPDATE_INTERVAL;
+
+/** The central configuration holder for Flink container-based test 
environments. */
+public class FlinkContainersConfig {

Review Comment:
   Thanks for the detailed explanation @afedulov ! I get your point.
   
   One solution in my mind is that we remove `FlinkContainersBuilder`, and move 
Testcontainers-specific setters to another class such as 
`TestcontainersSettings`. Also I think we can rename the 
`FlinkContainersConfig` to `FlinkContainersSettings` to avoid confusion with 
the config used for `flink-conf.yaml`. Then the constructor of 
`FlinkContainers` would be something like:
   
   ```java
   FlinkContainers flink = new FlinkContainers()
       .withFlinkContainerSettings(FlinkContainerSettings)
       .withTestContainerSettings(TestContainerSettings);
   
   flink.start();
   ```
   
   As of the preparation steps in the original builder I think we can hide them 
in a non-public class like `FlinkContainersComposer`, in order to avoid making 
`FlinkContainers` more sizable.
   
   Also about `FlinkContainersConfig / Settings` I think getter / setter 
pattern would be good enough. It's just a holder of settings and introducing a 
builder layer might be confusing and redundant to users. 
   
   WDYT? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to