wangyang0918 commented on a change in pull request #18119: URL: https://github.com/apache/flink/pull/18119#discussion_r785921351
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManagerUtils.java ########## @@ -0,0 +1,45 @@ +/* + * 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.runtime.resourcemanager; Review comment: Moving this class to `org.apache.flink.runtime.util` will be better. ########## File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/KubernetesResourceManagerDriver.java ########## @@ -42,6 +42,7 @@ import org.apache.flink.runtime.clusterframework.types.ResourceID; Review comment: Please move the `hotfix` commit before the concrete changes. ########## File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/KubernetesClusterDescriptor.java ########## @@ -240,20 +238,11 @@ private String getWebMonitorAddress(Configuration configuration) throws Exceptio flinkConfig.setString(KubernetesConfigOptionsInternal.ENTRY_POINT_CLASS, entryPoint); - // Rpc, blob, rest, taskManagerRpc ports need to be exposed, so update them to fixed values. - KubernetesUtils.checkAndUpdatePortConfigOption( - flinkConfig, BlobServerOptions.PORT, Constants.BLOB_SERVER_PORT); - KubernetesUtils.checkAndUpdatePortConfigOption( - flinkConfig, TaskManagerOptions.RPC_PORT, Constants.TASK_MANAGER_RPC_PORT); - KubernetesUtils.checkAndUpdatePortConfigOption( - flinkConfig, RestOptions.BIND_PORT, Constants.REST_PORT); + KubernetesUtils.updatePorts(flinkConfig); Review comment: It seems that the old changes have been brought back again. ########## File path: flink-runtime/src/test/java/org/apache/flink/runtime/resourcemanager/ResourceManagerUtilsTest.java ########## @@ -0,0 +1,41 @@ +/* + * 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.runtime.resourcemanager; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class ResourceManagerUtilsTest { + + @Test Review comment: I believe each test has a dedicate verification is better. If the test failed, we will easily know how it breaks. ``` @Test public void testParseRestBindPortFromWebInterfaceUrlWithEmptyUrl() { assertThat(ResourceManagerUtils.parseRestBindPortFromWebInterfaceUrl(""), is(-1)); } @Test public void testParseRestBindPortFromWebInterfaceUrlWithNullUrl() { assertThat(ResourceManagerUtils.parseRestBindPortFromWebInterfaceUrl(null), is(-1)); } @Test public void testParseRestBindPortFromWebInterfaceUrlWithInvalidSchema() { assertThat( ResourceManagerUtils.parseRestBindPortFromWebInterfaceUrl("localhost:8080//"), is(-1)); } @Test public void testParseRestBindPortFromWebInterfaceUrlWithInvalidPort() { assertThat( ResourceManagerUtils.parseRestBindPortFromWebInterfaceUrl("localhost:port1"), is(-1)); } @Test public void testParseRestBindPortFromWebInterfaceUrlWithValidPort() { assertThat( ResourceManagerUtils.parseRestBindPortFromWebInterfaceUrl("localhost:8080"), is(8080)); } ``` -- 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]
