diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.2.2.sql b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.2.2.sql index e760ce4847..3d8685fd57 100644 --- a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.2.2.sql +++ b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.2.2.sql @@ -24,3 +24,6 @@ alter table `t_flink_app` add column `k8s_name` varchar(63) collate utf8mb4_general_ci default null, -- modify_time change with duration #3188 modify column `modify_time` datetime not null default current_timestamp comment 'modify time'; + +alter table `t_flink_log` + add column `user_id` bigint default null comment 'operator user id'; diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/pgsql/2.2.2.sql b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/pgsql/2.2.2.sql index b535a7832a..c8d023ba09 100644 --- a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/pgsql/2.2.2.sql +++ b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/pgsql/2.2.2.sql @@ -17,3 +17,8 @@ alter table "public"."t_flink_app" add column "k8s_name" varchar(63) collate "pg_catalog"."default"; + +alter table "public"."t_flink_log" + add column "user_id" int8 collate "pg_catalog"."default"; + +comment on column "public"."t_flink_log"."user_id" is 'operator user id'; diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/ApplicationBackUp.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/ApplicationBackUp.java index 873588cfef..3a0de40369 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/ApplicationBackUp.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/ApplicationBackUp.java @@ -47,8 +47,6 @@ public class ApplicationBackUp { private transient boolean backup; - public ApplicationBackUp() {} - public ApplicationBackUp(Application application) { this.appId = application.getId(); this.sqlId = application.getSqlId(); diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/ApplicationLog.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/ApplicationLog.java index ade3195f81..9c4d9db688 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/ApplicationLog.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/ApplicationLog.java @@ -44,7 +44,8 @@ public class ApplicationLog { private Integer optionName; /** option time */ private Date optionTime; - /** exception at the start */ private String exception; + /** The user who operates the application */ + private Long userId; } diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Effective.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Effective.java index 29b2744bd1..3690a85498 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Effective.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Effective.java @@ -46,13 +46,4 @@ public class Effective { private Date createTime; private transient EffectiveTypeEnum effectiveType; - - public Effective() {} - - public Effective(Long appId, EffectiveTypeEnum type, Long targetId) { - this.appId = appId; - this.targetType = type.getType(); - this.targetId = targetId; - this.createTime = new Date(); - } } diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Message.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Message.java index e56b86c8ad..1029f06382 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Message.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Message.java @@ -48,8 +48,6 @@ public class Message { private Date createTime; - public Message() {} - public Message( Long userId, Long appId, String title, String context, NoticeTypeEnum noticeTypeEnum) { this.userId = userId; diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/ApplicationActionServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/ApplicationActionServiceImpl.java index 6bc26585db..784bceb320 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/ApplicationActionServiceImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/ApplicationActionServiceImpl.java @@ -238,6 +238,7 @@ public void cancel(Application appParam) throws Exception { applicationLog.setJobManagerUrl(application.getJobManagerUrl()); applicationLog.setOptionTime(new Date()); applicationLog.setYarnAppId(application.getClusterId()); + applicationLog.setUserId(commonService.getUserId()); if (appParam.getSavePointed()) { FlinkAppHttpWatcher.addSavepoint(application.getId()); @@ -407,6 +408,7 @@ public void start(Application appParam, boolean auto) throws Exception { applicationLog.setOptionName(OperationEnum.START.getValue()); applicationLog.setAppId(application.getId()); applicationLog.setOptionTime(new Date()); + applicationLog.setUserId(commonService.getUserId()); // set the latest to Effective, (it will only become the current effective at this time) applicationManageService.toEffective(application); diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/AppBuildPipeServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/AppBuildPipeServiceImpl.java index 606201714d..539b196d38 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/AppBuildPipeServiceImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/AppBuildPipeServiceImpl.java @@ -184,6 +184,7 @@ public boolean buildApplication(Long appId, boolean forceBuild) { applicationLog.setOptionName(RELEASE.getValue()); applicationLog.setAppId(app.getId()); applicationLog.setOptionTime(new Date()); + applicationLog.setUserId(commonService.getUserId()); // check if you need to go through the build process (if the jar and pom have changed, // you need to go through the build process, if other common parameters are modified, diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SavePointServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SavePointServiceImpl.java index fdfe3a9a66..9092e7bae5 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SavePointServiceImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SavePointServiceImpl.java @@ -103,6 +103,8 @@ public class SavePointServiceImpl extends ServiceImpl