Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

YARN-11781. Implement Dynamic Requests Handling in CapacityScheduler#7448

Open
TaoYang526 wants to merge2 commits intoapache:trunk
base:trunk
Choose a base branch
Loading
fromTaoYang526:YARN-11781

Conversation

TaoYang526
Copy link
Contributor

Description of PR

Details:

  • Dynamic Request Handling: The RequestsHandler class has been added to handle and modify resource and scheduling requests at the beginning of the CapacityScheduler#allocate method.
  • Configuration-Driven Updates: The behavior of the request handler can be configured dynamically via capacity-scheduler.xml configuration, allowing for updates to be applied without restarting the ResourceManager.
  • Scriptable Matching: Requests can be matched and modified based on JavaScript expressions, providing flexibility in defining which requests should be updated and how.
  • Support for ResourceRequest to SchedulingRequest Conversion: The handler supports converting ResourceRequest objects to SchedulingRequest objects, enabling more advanced scheduling capabilities.

Usage: To enable and configure the request handler, administrators can set the following properties in capacity-scheduler.xml:
yarn.scheduler.capacity.request-handler.enabled: Enables or disables the request handler.
yarn.scheduler.capacity.request-handler.updates: Specifies the JSON configuration for the request updates.

Configuration example:

<property>  <name>yarn.scheduler.capacity.request-handler.enabled</name>  <value>true</value></property><property>  <name>yarn.scheduler.capacity.request-handler.updates</name>  <value>    {      "items": [        {          "appMatchExpr": "queue == 'default'",          "requestMatchExpr": "priority > 10",          "isRRToSR": true,          "partition": "partitionA",          "executionType": "GUARANTEED",          "allocationTags": ["tag1", "tag2"],          "placementConstraint": "and(in,rack,hbase:notin,node,zk)"        }      ]    }  </value></property>

How was this patch tested?

For code changes:

  • Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
  • Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion underASF 2.0?
  • If applicable, have you updated theLICENSE,LICENSE-binary,NOTICE-binary files?

@hadoop-yetus

This comment was marked as outdated.

@hadoop-yetus
Copy link

💔-1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 48sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 1sNo case conflicting files found.
+0 🆗codespell0m 0scodespell was not available.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+1 💚@author0m 0sThe patch does not contain any@author tags.
+1 💚test4tests0m 0sThe patch appears to include 3 new or modified test files.
_ trunk Compile Tests _
+1 💚mvninstall40m 35strunk passed
+1 💚compile1m 0strunk passed with JDK Ubuntu-11.0.26+4-post-Ubuntu-1ubuntu120.04
+1 💚compile0m 52strunk passed with JDK Private Build-1.8.0_442-8u442-b06us1-0ubuntu120.04-b06
+1 💚checkstyle0m 57strunk passed
+1 💚mvnsite0m 56strunk passed
+1 💚javadoc0m 56strunk passed with JDK Ubuntu-11.0.26+4-post-Ubuntu-1ubuntu120.04
+1 💚javadoc0m 48strunk passed with JDK Private Build-1.8.0_442-8u442-b06us1-0ubuntu120.04-b06
+1 💚spotbugs1m 55strunk passed
+1 💚shadedclient39m 44sbranch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚mvninstall0m 44sthe patch passed
+1 💚compile0m 53sthe patch passed with JDK Ubuntu-11.0.26+4-post-Ubuntu-1ubuntu120.04
+1 💚javac0m 53sthe patch passed
+1 💚compile0m 45sthe patch passed with JDK Private Build-1.8.0_442-8u442-b06us1-0ubuntu120.04-b06
+1 💚javac0m 45sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
-0⚠️checkstyle0m 45s/results-checkstyle-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-resourcemanager.txthadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager: The patch generated 1 new + 117 unchanged - 0 fixed = 118 total (was 117)
+1 💚mvnsite0m 47sthe patch passed
+1 💚javadoc0m 44sthe patch passed with JDK Ubuntu-11.0.26+4-post-Ubuntu-1ubuntu120.04
+1 💚javadoc0m 39sthe patch passed with JDK Private Build-1.8.0_442-8u442-b06us1-0ubuntu120.04-b06
+1 💚spotbugs1m 53sthe patch passed
+1 💚shadedclient40m 20spatch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚unit116m 9shadoop-yarn-server-resourcemanager in the patch passed.
-1 ❌asflicense0m 33s/results-asflicense.txtThe patch generated 2 ASF License warnings.
252m 24s
SubsystemReport/Notes
DockerClientAPI=1.48 ServerAPI=1.48 base:https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7448/2/artifact/out/Dockerfile
GITHUB PR#7448
Optional Testsdupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
unameLinux e9f585671c81 5.15.0-131-generic#141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/bin/hadoop.sh
git revisiontrunk /4a0a769
Default JavaPrivate Build-1.8.0_442-8u442-b06us1-0ubuntu120.04-b06
Multi-JDK versions/usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.26+4-post-Ubuntu-1ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_442-8u442-b06us1-0ubuntu120.04-b06
Test Resultshttps://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7448/2/testReport/
Max. process+thread count918 (vs. ulimit of 5500)
modulesC: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager
Console outputhttps://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7448/2/console
versionsgit=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered byApache Yetus 0.14.0https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

🎊+1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 49sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗codespell0m 0scodespell was not available.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+1 💚@author0m 0sThe patch does not contain any@author tags.
+1 💚test4tests0m 0sThe patch appears to include 3 new or modified test files.
_ trunk Compile Tests _
+1 💚mvninstall41m 44strunk passed
+1 💚compile1m 2strunk passed with JDK Ubuntu-11.0.26+4-post-Ubuntu-1ubuntu120.04
+1 💚compile0m 52strunk passed with JDK Private Build-1.8.0_442-8u442-b06us1-0ubuntu120.04-b06
+1 💚checkstyle0m 57strunk passed
+1 💚mvnsite0m 56strunk passed
+1 💚javadoc0m 59strunk passed with JDK Ubuntu-11.0.26+4-post-Ubuntu-1ubuntu120.04
+1 💚javadoc0m 49strunk passed with JDK Private Build-1.8.0_442-8u442-b06us1-0ubuntu120.04-b06
+1 💚spotbugs1m 57strunk passed
+1 💚shadedclient40m 4sbranch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚mvninstall0m 45sthe patch passed
+1 💚compile0m 53sthe patch passed with JDK Ubuntu-11.0.26+4-post-Ubuntu-1ubuntu120.04
+1 💚javac0m 53sthe patch passed
+1 💚compile0m 43sthe patch passed with JDK Private Build-1.8.0_442-8u442-b06us1-0ubuntu120.04-b06
+1 💚javac0m 43sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle0m 45sthe patch passed
+1 💚mvnsite0m 47sthe patch passed
+1 💚javadoc0m 44sthe patch passed with JDK Ubuntu-11.0.26+4-post-Ubuntu-1ubuntu120.04
+1 💚javadoc0m 39sthe patch passed with JDK Private Build-1.8.0_442-8u442-b06us1-0ubuntu120.04-b06
+1 💚spotbugs1m 52sthe patch passed
+1 💚shadedclient40m 35spatch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚unit114m 53shadoop-yarn-server-resourcemanager in the patch passed.
+1 💚asflicense0m 35sThe patch does not generate ASF License warnings.
253m 3s
SubsystemReport/Notes
DockerClientAPI=1.48 ServerAPI=1.48 base:https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7448/3/artifact/out/Dockerfile
GITHUB PR#7448
Optional Testsdupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
unameLinux eefadf7d94ac 5.15.0-131-generic#141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/bin/hadoop.sh
git revisiontrunk /abdedf1
Default JavaPrivate Build-1.8.0_442-8u442-b06us1-0ubuntu120.04-b06
Multi-JDK versions/usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.26+4-post-Ubuntu-1ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_442-8u442-b06us1-0ubuntu120.04-b06
Test Resultshttps://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7448/3/testReport/
Max. process+thread count873 (vs. ulimit of 5500)
modulesC: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager
Console outputhttps://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7448/3/console
versionsgit=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered byApache Yetus 0.14.0https://yetus.apache.org

This message was automatically generated.

try {
reinitRequestsHandler(this.conf);
} catch (Throwable innerT) {
LOG.error("Failed to re-init requests handler : {}",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Will the basic functions be affected if the initialization fails?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks@zeekling for the review.
oldConf is a configuration that has already been validated and is in effect, the invocation of CapacityScheduler#reinitRequestsHandler here will not throw an exception actually. The purpose of this try/catch block is only included to make sure that the original rollback logic remains unaffected.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

got it

public RequestsHandleResponse handle(FiCaSchedulerApp app,
List<ResourceRequest> resourceRequests,
List<SchedulingRequest> schedulingRequests) {
readLock.lock();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is an update operator, why use readLock?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The readLock and writeLock are used to protect fields in RequestsHandler such as enabled and updateItems, which can be used concurrently, for example, they could be updated while refreshQueues is called in a RPC thread, meanwhile could be read to handle requests in other RPC threads. So that these fields should be modified exclusively in the initialize method (requiring writeLock for mutual exclusion) but only read concurrently in the handle method (where readLock enables multiple threads to access the shared state simultaneously without blocking)‌.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@zeeklingzeeklingzeekling requested changes

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@TaoYang526@hadoop-yetus@zeekling

[8]ページ先頭

©2009-2025 Movatter.jp