Skip to content

Commit

Permalink
[FLINK-24928][ui] Rename interfaces CheckPoint to Checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Airblader authored and AHeise committed Nov 22, 2021
1 parent fc82133 commit b08eb6f
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

export interface CheckPoint {
export interface Checkpoint {
counts: {
restored: number;
total: number;
Expand All @@ -25,13 +25,13 @@ export interface CheckPoint {
failed: number;
};
summary: {
state_size: CheckPointMinMaxAvgStatistics;
end_to_end_duration: CheckPointMinMaxAvgStatistics;
alignment_buffered: CheckPointMinMaxAvgStatistics;
state_size: CheckpointMinMaxAvgStatistics;
end_to_end_duration: CheckpointMinMaxAvgStatistics;
alignment_buffered: CheckpointMinMaxAvgStatistics;
};
latest: {
completed: CheckPointCompletedStatistics;
savepoint: CheckPointCompletedStatistics;
completed: CheckpointCompletedStatistics;
savepoint: CheckpointCompletedStatistics;
failed: {
id: number;
status: string;
Expand All @@ -45,19 +45,19 @@ export interface CheckPoint {
num_acknowledged_subtasks: number;
failure_timestamp: number;
failure_message: string;
task: CheckPointTaskStatistics;
task: CheckpointTaskStatistics;
};
restored: {
id: number;
restore_timestamp: number;
is_savepoint: boolean;
external_path: string;
};
history: CheckPointHistory;
history: CheckpointHistory;
};
}

export interface CheckPointHistory {
export interface CheckpointHistory {
id: number;
status: string;
is_savepoint: boolean;
Expand All @@ -68,10 +68,10 @@ export interface CheckPointHistory {
alignment_buffered: number;
num_subtasks: number;
num_acknowledged_subtasks: number;
task: CheckPointTaskStatistics;
task: CheckpointTaskStatistics;
}

export interface CheckPointMinMaxAvgStatistics {
export interface CheckpointMinMaxAvgStatistics {
min: number;
max: number;
avg: number;
Expand All @@ -82,7 +82,7 @@ export interface CheckPointMinMaxAvgStatistics {
p999: number;
}

export interface CheckPointCompletedStatistics {
export interface CheckpointCompletedStatistics {
id: number;
status: string;
is_savepoint: boolean;
Expand All @@ -93,13 +93,13 @@ export interface CheckPointCompletedStatistics {
alignment_buffered: number;
num_subtasks: number;
num_acknowledged_subtasks: number;
tasks: CheckPointTaskStatistics;
tasks: CheckpointTaskStatistics;
external_path: string;
discarded: boolean;
checkpoint_type: string;
}

export interface CheckPointTaskStatistics {
export interface CheckpointTaskStatistics {
id: number;
status: string;
latest_ack_timestamp: number;
Expand All @@ -110,7 +110,7 @@ export interface CheckPointTaskStatistics {
num_acknowledged_subtasks: number;
}

export interface CheckPointConfig {
export interface CheckpointConfig {
mode: 'exactly_once' | string;
interval: number;
timeout: number;
Expand All @@ -128,7 +128,7 @@ export interface CheckPointConfig {
checkpoints_after_tasks_finish: boolean;
}

export interface CheckPointDetail {
export interface CheckpointDetail {
id: number;
status: string;
is_savepoint: boolean;
Expand Down Expand Up @@ -157,7 +157,7 @@ export interface CheckPointDetail {
}>;
}

export interface CompletedSubTaskCheckPointStatistics {
export interface CompletedSubTaskCheckpointStatistics {
ack_timestamp: number;
end_to_end_duration: number;
state_size: number;
Expand All @@ -176,14 +176,14 @@ export interface CompletedSubTaskCheckPointStatistics {
aborted: boolean;
}

export interface PendingSubTaskCheckPointStatistics {}
export interface PendingSubTaskCheckpointStatistics {}

export type SubTaskCheckPointStatisticsItem = {
export type SubTaskCheckpointStatisticsItem = {
index: number;
status: string;
} & (CompletedSubTaskCheckPointStatistics | PendingSubTaskCheckPointStatistics);
} & (CompletedSubTaskCheckpointStatistics | PendingSubTaskCheckpointStatistics);

export interface CheckPointSubTask {
export interface CheckpointSubTask {
id: number;
status: string;
latest_ack_timestamp: number;
Expand All @@ -193,17 +193,17 @@ export interface CheckPointSubTask {
num_subtasks: number;
num_acknowledged_subtasks: number;
summary: {
state_size: CheckPointMinMaxAvgStatistics;
end_to_end_duration: CheckPointMinMaxAvgStatistics;
state_size: CheckpointMinMaxAvgStatistics;
end_to_end_duration: CheckpointMinMaxAvgStatistics;
checkpoint_duration: {
sync: CheckPointMinMaxAvgStatistics;
async: CheckPointMinMaxAvgStatistics;
sync: CheckpointMinMaxAvgStatistics;
async: CheckpointMinMaxAvgStatistics;
};
alignment: {
buffered: CheckPointMinMaxAvgStatistics;
duration: CheckPointMinMaxAvgStatistics;
buffered: CheckpointMinMaxAvgStatistics;
duration: CheckpointMinMaxAvgStatistics;
};
start_delay: CheckPointMinMaxAvgStatistics;
start_delay: CheckpointMinMaxAvgStatistics;
};
subtasks: SubTaskCheckPointStatisticsItem[];
subtasks: SubTaskCheckpointStatisticsItem[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import { forkJoin } from 'rxjs';
import { first } from 'rxjs/operators';

import {
CheckPointCompletedStatistics,
CheckPointDetail,
CheckpointCompletedStatistics,
CheckpointDetail,
JobDetailCorrect,
VerticesItem,
CheckPointConfig
CheckpointConfig
} from 'interfaces';
import { JobService } from 'services';

Expand All @@ -38,12 +38,12 @@ import { JobService } from 'services';
export class JobCheckpointsDetailComponent implements OnInit {
public readonly trackById = (_: number, node: VerticesItem): string => node.id;

public innerCheckPoint: CheckPointCompletedStatistics;
public innerCheckPoint: CheckpointCompletedStatistics;
public jobDetail: JobDetailCorrect;
public checkPointType: string;

public checkPointDetail: CheckPointDetail;
public checkPointConfig: CheckPointConfig;
public checkPointDetail: CheckpointDetail;
public checkPointConfig: CheckpointConfig;
public listOfVertex: VerticesItem[] = [];
public isLoading = true;

Expand All @@ -53,7 +53,7 @@ export class JobCheckpointsDetailComponent implements OnInit {
this.refresh();
}

public get checkPoint(): CheckPointCompletedStatistics {
public get checkPoint(): CheckpointCompletedStatistics {
return this.innerCheckPoint;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { distinctUntilChanged } from 'rxjs/operators';

import { CheckPointConfig, CheckPointHistory, CheckPoint, JobDetailCorrect } from 'interfaces';
import { CheckpointConfig, CheckpointHistory, Checkpoint, JobDetailCorrect } from 'interfaces';
import { JobService } from 'services';

@Component({
Expand All @@ -29,10 +29,10 @@ import { JobService } from 'services';
changeDetection: ChangeDetectionStrategy.OnPush
})
export class JobCheckpointsComponent implements OnInit {
public readonly trackById = (_: number, node: CheckPointHistory): number => node.id;
public readonly trackById = (_: number, node: CheckpointHistory): number => node.id;

public checkPointStats: CheckPoint;
public checkPointConfig: CheckPointConfig;
public checkPointStats: Checkpoint;
public checkPointConfig: CheckpointConfig;
public jobDetail: JobDetailCorrect;

public moreDetailsPanel = { active: false, disabled: false };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ import { first } from 'rxjs/operators';
import { NzTableSortFn } from 'ng-zorro-antd/table/src/table.types';

import {
CheckPointSubTask,
CompletedSubTaskCheckPointStatistics,
CheckpointSubTask,
CompletedSubTaskCheckpointStatistics,
JobDetailCorrect,
SubTaskCheckPointStatisticsItem,
SubTaskCheckpointStatisticsItem,
VerticesItem
} from 'interfaces';
import { JobService } from 'services';

function createSortFn(
selector: (item: CompletedSubTaskCheckPointStatistics) => number | boolean
): NzTableSortFn<SubTaskCheckPointStatisticsItem> {
selector: (item: CompletedSubTaskCheckpointStatistics) => number | boolean
): NzTableSortFn<SubTaskCheckpointStatisticsItem> {
// FIXME This type-asserts that pre / next are a specific subtype.
return (pre, next) =>
selector(pre as CompletedSubTaskCheckPointStatistics) > selector(next as CompletedSubTaskCheckPointStatistics)
selector(pre as CompletedSubTaskCheckpointStatistics) > selector(next as CompletedSubTaskCheckpointStatistics)
? 1
: -1;
}
Expand All @@ -59,8 +59,8 @@ export class JobCheckpointsSubtaskComponent implements OnInit, OnChanges {
@Input() public checkPointId: number;

public jobDetail: JobDetailCorrect;
public subTaskCheckPoint: CheckPointSubTask;
public listOfSubTaskCheckPoint: SubTaskCheckPointStatisticsItem[] = [];
public subTaskCheckPoint: CheckpointSubTask;
public listOfSubTaskCheckPoint: SubTaskCheckpointStatisticsItem[] = [];
public isLoading = true;
public sortName: string;
public sortValue: string;
Expand Down
24 changes: 12 additions & 12 deletions flink-runtime-web/web-dashboard/src/app/services/job.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import { catchError, filter, map, mergeMap, tap } from 'rxjs/operators';

import { BASE_URL } from 'config';
import {
CheckPoint,
CheckPointConfig,
CheckPointDetail,
CheckPointSubTask,
Checkpoint,
CheckpointConfig,
CheckpointDetail,
CheckpointSubTask,
JobBackpressure,
JobConfig,
JobDetail,
Expand Down Expand Up @@ -159,24 +159,24 @@ export class JobService {
return this.httpClient.get<JobVertexTaskManager>(`${BASE_URL}/jobs/${jobId}/vertices/${vertexId}/taskmanagers`);
}

public loadCheckpointStats(jobId: string): Observable<CheckPoint> {
return this.httpClient.get<CheckPoint>(`${BASE_URL}/jobs/${jobId}/checkpoints`);
public loadCheckpointStats(jobId: string): Observable<Checkpoint> {
return this.httpClient.get<Checkpoint>(`${BASE_URL}/jobs/${jobId}/checkpoints`);
}

public loadCheckpointConfig(jobId: string): Observable<CheckPointConfig> {
return this.httpClient.get<CheckPointConfig>(`${BASE_URL}/jobs/${jobId}/checkpoints/config`);
public loadCheckpointConfig(jobId: string): Observable<CheckpointConfig> {
return this.httpClient.get<CheckpointConfig>(`${BASE_URL}/jobs/${jobId}/checkpoints/config`);
}

public loadCheckpointDetails(jobId: string, checkPointId: number): Observable<CheckPointDetail> {
return this.httpClient.get<CheckPointDetail>(`${BASE_URL}/jobs/${jobId}/checkpoints/details/${checkPointId}`);
public loadCheckpointDetails(jobId: string, checkPointId: number): Observable<CheckpointDetail> {
return this.httpClient.get<CheckpointDetail>(`${BASE_URL}/jobs/${jobId}/checkpoints/details/${checkPointId}`);
}

public loadCheckpointSubtaskDetails(
jobId: string,
checkPointId: number,
vertexId: string
): Observable<CheckPointSubTask> {
return this.httpClient.get<CheckPointSubTask>(
): Observable<CheckpointSubTask> {
return this.httpClient.get<CheckpointSubTask>(
`${BASE_URL}/jobs/${jobId}/checkpoints/details/${checkPointId}/subtasks/${vertexId}`
);
}
Expand Down

0 comments on commit b08eb6f

Please sign in to comment.