-
Notifications
You must be signed in to change notification settings - Fork 9.2k
YARN-11511. Improve TestRMWebServices test config and data. #5745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 25 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
b550082
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K 874beee
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K b3fccd5
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K 0e50850
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K 0c8a746
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K e330bb4
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K c8fffa5
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K b5d8d8f
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K 83320ee
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K c93b07d
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K c256b74
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K f8c72b3
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K e532dff
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K e8a213d
Merge branch 'trunk' into YARN-11511
K0K0V0K 7d39cdd
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K 1111835
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K c565c5f
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K 4831389
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K 6eda3f1
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K 9116f53
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K 1fbf9f0
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K 2491d41
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K 5df6603
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K 761975e
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K 2aedd64
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K 362cca5
fix conflict resolution
tomicooler cc69339
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K fbad0a9
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K 3a81d0e
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K e3fa6eb
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K 35b2436
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K bec7ab3
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K d2f3fb8
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K b04ead4
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K 278a117
YARN-11511 Improve TestRMWebServices test config and data
K0K0V0K File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
430 changes: 70 additions & 360 deletions
430
.../org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySched.java
Large diffs are not rendered by default.
Oops, something went wrong.
392 changes: 121 additions & 271 deletions
392
...adoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDynamicConfig.java
Large diffs are not rendered by default.
Oops, something went wrong.
139 changes: 139 additions & 0 deletions
139
...yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedLegacyQueueCreation.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| /** | ||
| * 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.hadoop.yarn.server.resourcemanager.webapp; | ||
|
|
||
| import java.io.IOException; | ||
| import java.util.HashMap; | ||
| import java.util.Map; | ||
| import javax.ws.rs.core.MediaType; | ||
|
|
||
| import com.sun.jersey.api.client.ClientResponse; | ||
| import org.junit.After; | ||
| import org.junit.Test; | ||
|
|
||
| import org.apache.hadoop.conf.Configuration; | ||
| import org.apache.hadoop.yarn.exceptions.YarnException; | ||
| import org.apache.hadoop.yarn.server.resourcemanager.MockRM; | ||
| import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler; | ||
| import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerQueueManager; | ||
| import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueuePath; | ||
| import org.apache.hadoop.yarn.webapp.JerseyTestBase; | ||
|
|
||
| import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfigGeneratorForTest.createConfiguration; | ||
| import static org.apache.hadoop.yarn.server.resourcemanager.webapp.TestWebServiceUtil.assertJsonResponse; | ||
| import static org.apache.hadoop.yarn.server.resourcemanager.webapp.TestWebServiceUtil.createMutableRM; | ||
| import static org.apache.hadoop.yarn.server.resourcemanager.webapp.TestWebServiceUtil.createWebAppDescriptor; | ||
|
|
||
| public class TestRMWebServicesCapacitySchedLegacyQueueCreation extends | ||
K0K0V0K marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| JerseyTestBase { | ||
| private MockRM rm; | ||
K0K0V0K marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| private CapacitySchedulerQueueManager autoQueueHandler; | ||
K0K0V0K marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| public TestRMWebServicesCapacitySchedLegacyQueueCreation() { | ||
| super(createWebAppDescriptor()); | ||
| } | ||
|
|
||
| @After | ||
| public void shutDown(){ | ||
K0K0V0K marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if (rm != null) { | ||
| rm.stop(); | ||
| rm = null; | ||
| } | ||
| } | ||
|
|
||
| @Test | ||
| public void testSchedulerResponsePercentageModeLegacyAutoCreation() | ||
| throws Exception { | ||
| Configuration config = createPercentageConfigLegacyAutoCreation(); | ||
K0K0V0K marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| rm = createMutableRM(config); | ||
K0K0V0K marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| /* | ||
| * mode: percentage | ||
| * managedtest2.autoCreationEligibility: legacy, others.autoCreationEligibility: off | ||
| * weight: -1, normalizedWeight: 0 | ||
| * root.queueType: parent, others.queueType: leaf | ||
| */ | ||
| assertJsonResponse(sendRequest(), | ||
| "webapp/scheduler-response-PercentageModeLegacyAutoCreation.json"); | ||
| } | ||
|
|
||
| @Test | ||
| public void testSchedulerResponseAbsoluteModeLegacyAutoCreation() | ||
| throws Exception { | ||
| Configuration config = createAbsoluteConfigLegacyAutoCreation(); | ||
K0K0V0K marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| rm = createMutableRM(config); | ||
K0K0V0K marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| initAutoQueueHandler(8192); | ||
K0K0V0K marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| createQueue("root.managed.queue1"); | ||
K0K0V0K marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| assertJsonResponse(sendRequest(), | ||
| "webapp/scheduler-response-AbsoluteModeLegacyAutoCreation.json"); | ||
| } | ||
|
|
||
| private void initAutoQueueHandler(int nodeMemory) throws Exception { | ||
| CapacityScheduler cs = (CapacityScheduler) rm.getResourceScheduler(); | ||
| autoQueueHandler = cs.getCapacitySchedulerQueueManager(); | ||
| rm.registerNode("h1:1234", nodeMemory, 32); // label = x | ||
K0K0V0K marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| private void createQueue(String queuePath) throws YarnException, | ||
| IOException { | ||
| autoQueueHandler.createQueue(new QueuePath(queuePath)); | ||
| } | ||
|
|
||
| private ClientResponse sendRequest() { | ||
| return resource().path("ws").path("v1").path("cluster") | ||
| .path("scheduler").accept(MediaType.APPLICATION_JSON) | ||
| .get(ClientResponse.class); | ||
| } | ||
|
|
||
| private Configuration createPercentageConfigLegacyAutoCreation() { | ||
| Map<String, String> conf = new HashMap<>(); | ||
| conf.put("yarn.scheduler.capacity.root.queues", "default, test1, " + | ||
| "managedtest2"); | ||
| conf.put("yarn.scheduler.capacity.root.test1.capacity", "50"); | ||
| conf.put("yarn.scheduler.capacity.root.managedtest2.capacity", "50"); | ||
| conf.put("yarn.scheduler.capacity.root.test1.maximum-capacity", "100"); | ||
| conf.put("yarn.scheduler.capacity.root.test1.state", "RUNNING"); | ||
| conf.put("yarn.scheduler.capacity.root.managedtest2.state", "RUNNING"); | ||
| conf.put("yarn.scheduler.capacity.root.managedtest2." + | ||
| "auto-create-child-queue.enabled", "true"); | ||
| return createConfiguration(conf); | ||
| } | ||
|
|
||
| private Configuration createAbsoluteConfigLegacyAutoCreation() { | ||
| Map<String, String> conf = new HashMap<>(); | ||
| conf.put("yarn.scheduler.capacity.root.queues", "default, managed"); | ||
| conf.put("yarn.scheduler.capacity.root.default.state", "STOPPED"); | ||
| conf.put("yarn.scheduler.capacity.root.default.capacity", "[memory=0,vcores=0]"); | ||
| conf.put("yarn.scheduler.capacity.root.managed.capacity", "[memory=4096,vcores=4]"); | ||
| conf.put("yarn.scheduler.capacity.root.managed.leaf-queue-template.capacity", | ||
| "[memory=2048,vcores=2]"); | ||
| conf.put("yarn.scheduler.capacity.root.managed.state", "RUNNING"); | ||
| conf.put("yarn.scheduler.capacity.root.managed." + | ||
| "auto-create-child-queue.enabled", "true"); | ||
| conf.put("yarn.scheduler.capacity.root.managed.leaf-queue-template.acl_submit_applications", | ||
| "user"); | ||
| conf.put("yarn.scheduler.capacity.root.managed.leaf-queue-template.acl_administer_queue", | ||
| "admin"); | ||
| return createConfiguration(conf); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.