afedulov commented on code in PR #19856: URL: https://github.com/apache/flink/pull/19856#discussion_r906708437
########## 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: Hi @PatrickRen, I dropped `FlinkContainerBuilder` and introduced `TestcontainersSettings`, as you proposed. I would prefer to keep the builder patterns for the following reasons: 1) It is one of the most widespread design patterns in general and we also use them everywhere in Flink. I do not think they are confusing for the users. 2) I believe if anything, they reduce the potential confusion for the users. A user might change the settings later and expect the changes for taking effect on the execution, but it won't because we already populated concrete underlying classes with it. Immutability makes things more clear. 3) Inline declaration: FlinkContainers are mostly initialized as class fields and using the setter style would require every test implementation to either use static{} initialization blocks or to provide initialization methods similar to what is done with the [Flink config ](https://github.com/apache/flink/blob/89f782416bf5b600ce35e3e3e0edd4992019f2e6/flink-end-to-end-tests/flink-end-to-end-tests-common-kafka/src/test/java/org/apache/flink/tests/util/kafka/SmokeKafkaITCase.java#L99). I find it pretty convenient to be able to configure those test fields inline. Looking forward to your feedback! -- 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]
