-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Feature][RestAPI] Add overview api #6883
Conversation
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.
Thanks @liugddx ! I like this feature.
| } | ||
|
|
||
| @Override | ||
| public int workCount() { |
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.
| public int workCount() { | |
| public int workerCount() { |
| @@ -39,7 +39,7 @@ public static void main(String[] args) | |||
| clientCommandArgs.setJobName(Paths.get(configFile).getFileName().toString()); | |||
| // Change Execution Mode to CLUSTER to use client mode, before do this, you should start | |||
| // SeaTunnelEngineServerExample | |||
| clientCommandArgs.setMasterType(MasterType.LOCAL); | |||
| clientCommandArgs.setMasterType(MasterType.CLUSTER); | |||
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.
| clientCommandArgs.setMasterType(MasterType.CLUSTER); | |
| clientCommandArgs.setMasterType(MasterType.LOCAL); |
| List<SlotProfile> assignedSlots = resourceManager.getAssignedSlots(); | ||
|
|
||
| List<SlotProfile> unassignedSlots = resourceManager.getUnassignedSlots(); | ||
| IMap<Long, JobState> finishedJob = | ||
| getNodeEngine().getHazelcastInstance().getMap(Constant.IMAP_FINISHED_JOB_STATE); | ||
| overviewInfo.setTotalSlot(assignedSlots.size() + unassignedSlots.size()); | ||
| overviewInfo.setUnassignedSlot(unassignedSlots.size()); | ||
| overviewInfo.setRunningJobs( | ||
| getNodeEngine() | ||
| .getHazelcastInstance() | ||
| .getMap(Constant.IMAP_RUNNING_JOB_INFO) | ||
| .size()); | ||
| overviewInfo.setFailedJobs( | ||
| finishedJob.values().stream() | ||
| .filter( | ||
| jobState -> | ||
| jobState.getJobStatus() | ||
| .name() | ||
| .equals(JobStatus.FAILED.toString())) | ||
| .count()); | ||
| overviewInfo.setCancelledJobs( | ||
| finishedJob.values().stream() | ||
| .filter( | ||
| jobState -> | ||
| jobState.getJobStatus() | ||
| .name() | ||
| .equals(JobStatus.CANCELED.toString())) | ||
| .count()); | ||
| overviewInfo.setWorks(resourceManager.workCount()); | ||
| overviewInfo.setFinishedJobs( | ||
| finishedJob.values().stream() |
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.
I find this part show up twice. Please do some refactor.


Purpose of this pull request
{
"projectVersion": "2.3.5",
"gitCommitAbbrev": "DeadD0d0",
"totalSlot": "0",
"unassignedSlot": "0",
"runningJobs": "0",
"finishedJobs": "0",
"failedJobs": "0",
"cancelledJobs": "0",
"works": "1"
}
Does this PR introduce any user-facing change?
How was this patch tested?
Check list
New License Guide
release-note.