-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[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
[Improvement](meta) support return total statistics of all databases for command show proc '/jobs #17342
Changes from all commits
348d8d1
fbeb384
49ec7b9
c34f32a
1713873
9934a86
120a06c
e42f259
f54e0d9
File filter
Filter by extension
Conversations
Jump to
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
Contributor
Author
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
Contributor
Author
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<>(); | ||
|
|
||
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