Samrat002 commented on code in PR #28867: URL: https://github.com/apache/flink/pull/28867#discussion_r3882947057
########## flink-filesystems/flink-s3-fs-native/src/test/java/org/apache/flink/fs/s3native/SeaweedFsNativeS3HAClusterExtension.java: ########## @@ -0,0 +1,82 @@ +/* + * 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.fs.s3native; + +import org.apache.flink.configuration.Configuration; +import org.apache.flink.core.fs.FileSystem; +import org.apache.flink.core.testutils.AllCallbackWrapper; +import org.apache.flink.core.testutils.TestContainerExtension; +import org.apache.flink.runtime.testutils.MiniClusterResourceConfiguration; +import org.apache.flink.test.junit5.MiniClusterExtension; + +import org.junit.jupiter.api.extension.AfterAllCallback; +import org.junit.jupiter.api.extension.BeforeAllCallback; +import org.junit.jupiter.api.extension.ExtensionContext; + +import java.util.function.Function; + +/** + * Bundles a {@link SeaweedFsNativeS3TestContainer} and a {@link MiniClusterExtension} configured + * to use it, so that HA IT cases backed by the native S3 FS don't each have to wire up and order + * the two extensions themselves. + */ +final class SeaweedFsNativeS3HAClusterExtension implements BeforeAllCallback, AfterAllCallback { + + private final AllCallbackWrapper<TestContainerExtension<SeaweedFsNativeS3TestContainer>> + seaweedFsExtension = + new AllCallbackWrapper<>( + new TestContainerExtension<>(SeaweedFsNativeS3TestContainer::new)); + + private final Function<SeaweedFsNativeS3TestContainer, Configuration> configurationFactory; + + private MiniClusterExtension miniClusterExtension; + + SeaweedFsNativeS3HAClusterExtension( + Function<SeaweedFsNativeS3TestContainer, Configuration> configurationFactory) { + this.configurationFactory = configurationFactory; + } + + SeaweedFsNativeS3TestContainer getContainer() { Review Comment: Currently, there is no need to change the visibility to public. Outside this package, there is no call to this method -- 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]
