Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,7 @@ public FlinkApplication getApp(Long id) {
setAppDurationIfNeeded(application, now);
}

application.setAppControl(getAppControl(application));
application.setYarnQueueByHotParams();

return application;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,27 +228,30 @@ record -> {
if (pipeStates.containsKey(record.getId())) {
record.setBuildStatus(pipeStates.get(record.getId()).getCode());
}

AppControl appControl = new AppControl()
.setAllowBuild(
record.getBuildStatus() == null
|| !PipelineStatusEnum.running
.getCode()
.equals(record.getBuildStatus()))
.setAllowStart(
!record.shouldTracking()
&& PipelineStatusEnum.success
.getCode()
.equals(record.getBuildStatus()))
.setAllowStop(record.isRunning())
.setAllowView(record.shouldTracking());
AppControl appControl = getAppControl(record);
record.setAppControl(appControl);
})
.collect(Collectors.toList());
page.setRecords(newRecords);
return page;
}

private AppControl getAppControl(SparkApplication record) {
return new AppControl()
.setAllowBuild(
record.getBuildStatus() == null
|| !PipelineStatusEnum.running
.getCode()
.equals(record.getBuildStatus()))
.setAllowStart(
!record.shouldTracking()
&& PipelineStatusEnum.success
.getCode()
.equals(record.getBuildStatus()))
.setAllowStop(record.isRunning())
.setAllowView(record.shouldTracking());
}

@Override
public void changeOwnership(Long userId, Long targetUserId) {
LambdaUpdateWrapper<SparkApplication> updateWrapper = new LambdaUpdateWrapper<SparkApplication>()
Expand Down Expand Up @@ -645,7 +648,7 @@ public SparkApplication getApp(Long id) {
application.setConfPath(path);
}
}

application.setAppControl(getAppControl(application));
application.resolveYarnQueue();

return application;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ interface AppControl {
allowStart: boolean;
allowStop: boolean;
allowBuild: boolean;
allowView: boolean;
}
/* cancel params */
export interface CancelParam {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ interface AppControl {
allowStart: boolean;
allowStop: boolean;
allowBuild: boolean;
allowView: boolean;
}

// create Params
Expand Down