Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.9k
[Improvement](meta) support return total statistics of all databases for command show proc '/jobs#17342
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
Uh oh!
There was an error while loading. Please reload this page.
[Improvement](meta) support return total statistics of all databases for command show proc '/jobs #17342
Changes from all commits
348d8d1fbeb38449ec7b9c34f32a17138739934a86120a06ce42f259f54e0d9File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -65,6 +65,7 @@ | ||
| import com.google.common.base.Preconditions; | ||
| import com.google.common.base.Strings; | ||
| import com.google.common.collect.ImmutableList; | ||
| import com.google.common.collect.Lists; | ||
| import com.google.common.collect.Maps; | ||
| import com.google.common.collect.Sets; | ||
| @@ -1146,6 +1147,18 @@ public List<List<Comparable>> getAlterJobInfosByDb(Database db) { | ||
| return rollupJobInfos; | ||
| } | ||
| public List<List<Comparable>> getAllAlterJobInfos() { | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as AlterHandler, no need to check priv ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed | ||
| List<List<Comparable>> rollupJobInfos = new LinkedList<List<Comparable>>(); | ||
| for (AlterJobV2 alterJob : ImmutableList.copyOf(alterJobsV2.values())) { | ||
| // no need to check priv here. This method is only called in show proc stmt, | ||
| // which already check the ADMIN priv. | ||
| alterJob.getInfo(rollupJobInfos); | ||
| } | ||
| return rollupJobInfos; | ||
| } | ||
| private void getAlterJobV2Infos(Database db, List<List<Comparable>> rollupJobInfos) { | ||
| ConnectContext ctx = ConnectContext.get(); | ||
| for (AlterJobV2 alterJob : alterJobsV2.values()) { | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1599,6 +1599,20 @@ private void runAlterJobV2() { | ||
| }); | ||
| } | ||
| public List<List<Comparable>> getAllAlterJobInfos() { | ||
| List<List<Comparable>> schemaChangeJobInfos = new LinkedList<>(); | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as AlterHandler, no need to check priv ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed | ||
| for (AlterJobV2 alterJob : ImmutableList.copyOf(alterJobsV2.values())) { | ||
| // no need to check priv here. This method is only called in show proc stmt, | ||
| // which already check the ADMIN priv. | ||
| alterJob.getInfo(schemaChangeJobInfos); | ||
| } | ||
| // sort by "JobId", "PartitionName", "CreateTime", "FinishTime", "IndexName", "IndexState" | ||
| ListComparator<List<Comparable>> comparator = new ListComparator<List<Comparable>>(0, 1, 2, 3, 4, 5); | ||
| schemaChangeJobInfos.sort(comparator); | ||
| return schemaChangeJobInfos; | ||
| } | ||
| @Override | ||
| public List<List<Comparable>> getAlterJobInfosByDb(Database db) { | ||
| List<List<Comparable>> schemaChangeJobInfos = new LinkedList<>(); | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is only called in
show procstmt, which already check the ADMIN priv.So no need to check priv here again.
You can just leave a comment to here for other developer to notice that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed