[ https://issues.apache.org/jira/browse/FLINK-5791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15894460#comment-15894460 ]
ASF GitHub Bot commented on FLINK-5791: --------------------------------------- Github user tillrohrmann commented on a diff in the pull request: https://github.com/apache/flink/pull/3304#discussion_r104159696 --- Diff: flink-yarn/src/test/java/org/apache/flink/yarn/YarnResourceManagerTest.java --- @@ -0,0 +1,94 @@ +/* + * 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.yarn; + +import org.apache.flink.api.common.time.Time; +import org.apache.flink.configuration.Configuration; +import org.apache.flink.runtime.clusterframework.types.ResourceID; +import org.apache.flink.runtime.clusterframework.types.ResourceProfile; +import org.apache.flink.runtime.heartbeat.HeartbeatManagerImpl; +import org.apache.flink.runtime.highavailability.HighAvailabilityServices; +import org.apache.flink.runtime.metrics.MetricRegistry; +import org.apache.flink.runtime.resourcemanager.JobLeaderIdService; +import org.apache.flink.runtime.resourcemanager.ResourceManagerConfiguration; +import org.apache.flink.runtime.resourcemanager.slotmanager.SlotManagerFactory; +import org.apache.flink.runtime.rpc.FatalErrorHandler; +import org.apache.flink.runtime.rpc.TestingSerialRpcService; +import org.apache.flink.util.TestLogger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import java.util.LinkedList; +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; + +public class YarnResourceManagerTest extends TestLogger { + + private YarnResourceManager yarnResourceManager; + + @Before + public void setup() { + Configuration conf = new Configuration(); + ResourceManagerConfiguration rmConfig = + new ResourceManagerConfiguration(Time.seconds(1), Time.seconds(10)); + yarnResourceManager = new YarnResourceManager(conf, null, new TestingSerialRpcService(), rmConfig, + mock(HighAvailabilityServices.class), mock(SlotManagerFactory.class), + mock(MetricRegistry.class), mock(JobLeaderIdService.class), + mock(FatalErrorHandler.class)); + } + + @After + public void teardown() { + } --- End diff -- If this method is empty, then it's better to not define it all. > Resource should be strictly matched when allocating for yarn > ------------------------------------------------------------ > > Key: FLINK-5791 > URL: https://issues.apache.org/jira/browse/FLINK-5791 > Project: Flink > Issue Type: Improvement > Components: YARN > Reporter: shuai.xu > Assignee: shuai.xu > Labels: flip-6 > > In flip6, for yarn mode, resource should be assigned as requested to avoid > resource wasting and OOM. > 1. YarnResourceManager will request container according to ResourceProfile > in slot request form JM. > 2. RM will pass the ResourceProfile to TM for initializing its slots. > 3. RM should match the slots offered by TM with SlotRequest from JM strictly. -- This message was sent by Atlassian JIRA (v6.3.15#6346)