[ https://issues.apache.org/jira/browse/YARN-11290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17602056#comment-17602056 ]
ASF GitHub Bot commented on YARN-11290: --------------------------------------- slfan1989 commented on code in PR #4846: URL: https://github.com/apache/hadoop/pull/4846#discussion_r966545040 ########## hadoop-yarn-project/hadoop-yarn/bin/FederationStateStore/MySQL/FederationStateStoreStoredProcs.sql: ########## @@ -122,10 +122,29 @@ BEGIN WHERE applicationId = applicationID_IN; END // -CREATE PROCEDURE sp_getApplicationsHomeSubCluster() -BEGIN - SELECT applicationId, homeSubCluster - FROM applicationsHomeSubCluster; +CREATE PROCEDURE sp_getApplicationsHomeSubCluster(IN limit_IN int, IN homeSubCluster_IN varchar(256)) +BEGIN + SELECT + t4.applicationId, + t4.createTime, + t4.homeSubCluster, + t4.row_num + FROM ( + SELECT + t2.applicationId, + t2.createTime, + t2.homeSubCluster, + @row_num := @row_num + 1 AS row_num + FROM ( + SELECT + t.applicationId, + t.homeSubCluster, + t.createTime + FROM applicationshomesubcluster AS t + WHERE ( CASE WHEN t.homeSubCluster_IN IS NULL THEN 1 = 1 WHEN t.homeSubCluster_IN IS NOT NULL THEN homeSubCluster = homeSubCluster_IN END ) Review Comment: I will continue to optimize the code and find an easy way. > Improve Query Condition of FederationStateStore#getApplicationsHomeSubCluster > ----------------------------------------------------------------------------- > > Key: YARN-11290 > URL: https://issues.apache.org/jira/browse/YARN-11290 > Project: Hadoop YARN > Issue Type: Improvement > Components: federation > Affects Versions: 3.4.0 > Reporter: fanshilun > Assignee: fanshilun > Priority: Minor > Labels: pull-request-available > Attachments: SqlServer-StoredProc.png > > > 1. Currently this interface returns the number of apps in all sub-clusters, > increasing the limit on the number of query apps, limited to 1000 apps. > 2. Allows to query the App based on the specified HomeSubCluster. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org