Skip to content

Commit

Permalink
[FLINK-22413][WebUI] Hide Checkpointing page for batch jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
SteNicholas committed May 11, 2021
1 parent f667629 commit dc45656
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ curl localhost:8081/jobs/<jod-id>
"plan": {
"jid": "<job-id>",
"name": "Click Event Count",
"type": "STREAMING",
"nodes": [
{
"id": "<vertex-id>",
Expand Down
1 change: 1 addition & 0 deletions docs/content/docs/try-flink/flink-operations-playground.md
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,7 @@ curl localhost:8081/jobs/<jod-id>
"plan": {
"jid": "<job-id>",
"name": "Click Event Count",
"type": "STREAMING",
"nodes": [
{
"id": "<vertex-id>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export interface JobDetailInterface {
interface Plan {
jid: string;
name: string;
type: string;
nodes: NodesItemInterface[];
}

Expand Down Expand Up @@ -150,6 +151,7 @@ export interface JobDetailCorrectInterface extends JobDetailInterface {
plan: {
jid: string;
name: string;
type: string;
nodes: NodesItemCorrectInterface[];
links: NodesItemLinkInterface[];
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export class JobStatusComponent implements OnInit, OnDestroy {
title: 'Configuration'
}
];
checkpointIndexOfNavigation = this.checkpointIndexOfNav();

webCancelEnabled = this.statusService.configuration.features["web-cancel"];

Expand All @@ -72,6 +73,12 @@ export class JobStatusComponent implements OnInit, OnDestroy {
jobDetail$.subscribe(data => {
this.jobDetail = data;
this.cdr.markForCheck();
var index = this.checkpointIndexOfNav();
if (data.plan.type == 'STREAMING' && index == -1) {
this.listOfNavigation.splice(this.checkpointIndexOfNavigation, 0, {path: 'checkpoints', title: 'Checkpoints'});
} else if (data.plan.type == 'BATCH' && index > -1) {
this.listOfNavigation.splice(index, 1);
}
});
jobDetail$.pipe(distinctUntilKeyChanged('state')).subscribe(() => {
this.statusTips = '';
Expand All @@ -82,4 +89,8 @@ export class JobStatusComponent implements OnInit, OnDestroy {
this.destroy$.next();
this.destroy$.complete();
}

checkpointIndexOfNav() {
return this.listOfNavigation.findIndex(item => item.path === 'checkpoints');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public static String generatePlan(JobGraph jg) {
gen.writeStartObject();
gen.writeStringField("jid", jg.getJobID().toString());
gen.writeStringField("name", jg.getName());
gen.writeStringField("type", jg.getJobType().name());
gen.writeArrayFieldStart("nodes");

// info per vertex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public void testGeneratorWithoutAnyAttachements() {
// core fields
assertEquals(new TextNode(jg.getJobID().toString()), rootNode.get("jid"));
assertEquals(new TextNode(jg.getName()), rootNode.get("name"));
assertEquals(new TextNode(jg.getJobType().name()), rootNode.get("type"));

assertTrue(rootNode.path("nodes").isArray());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,16 @@ public void validateJson(String json) throws Exception {

JsonNode idField = rootNode.get("jid");
JsonNode nameField = rootNode.get("name");
JsonNode typeField = rootNode.get("type");
JsonNode arrayField = rootNode.get("nodes");

assertNotNull(idField);
assertNotNull(nameField);
assertNotNull(typeField);
assertNotNull(arrayField);
assertTrue(idField.isTextual());
assertTrue(nameField.isTextual());
assertTrue(typeField.isTextual());
assertTrue(arrayField.isArray());

ArrayNode array = (ArrayNode) arrayField;
Expand Down

0 comments on commit dc45656

Please sign in to comment.