From 43ca05883a7889fbd5839626c937adc320fe49d1 Mon Sep 17 00:00:00 2001 From: tjq Date: Sun, 3 Jan 2021 22:32:18 +0800 Subject: [PATCH 01/19] refactor: change repo url to PowerJob/PowerJob --- README.md | 8 ++++---- README_zhCN.md | 8 ++++---- pom.xml | 4 ++-- .../powerjob/server/common/config/SwaggerConfig.java | 2 +- powerjob-server/src/main/resources/banner.txt | 2 +- .../powerjob/samples/tester/StopInstanceTester.java | 2 +- .../powerjob/worker/common/PowerBannerPrinter.java | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index f0115858..ab6314d5 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,10 @@ English | [简体中文](./README_zhCN.md)

-actions +actions Maven Central -GitHub release (latest SemVer) -LICENSE +GitHub release (latest SemVer) +LICENSE

- Have you ever wondered how cron jobs could be organized orderly? @@ -69,7 +69,7 @@ Application password: 123 **[中文文档](https://www.yuque.com/powerjob/product)** # User Registration -[Click to register as PowerJob user and contribute to PowerJob!](https://github.com/KFCFans/PowerJob/issues/6) +[Click to register as PowerJob user and contribute to PowerJob!](https://github.com/PowerJob/PowerJob/issues/6) ღ( ´・ᴗ・\` )ღ Many thanks to the following registered users. ღ( ´・ᴗ・\` )ღ

PowerJob User diff --git a/README_zhCN.md b/README_zhCN.md index 1482418b..ed6fa4e9 100644 --- a/README_zhCN.md +++ b/README_zhCN.md @@ -5,10 +5,10 @@

-actions +actions Maven Central -GitHub release (latest SemVer) -LICENSE +GitHub release (latest SemVer) +LICENSE

PowerJob(原OhMyScheduler)是全新一代分布式调度与计算框架,能让您轻松完成作业的调度与繁杂任务的分布式计算。 @@ -62,7 +62,7 @@ PowerJob 的设计目标为企业级的分布式任务调度平台,即成为 PS:感谢文档翻译平台[breword](https://www.breword.com/)对本项目英文文档翻译做出的巨大贡献! # 接入登记 -[点击进行接入登记,为 PowerJob 的发展贡献自己的力量!](https://github.com/KFCFans/PowerJob/issues/6) +[点击进行接入登记,为 PowerJob 的发展贡献自己的力量!](https://github.com/PowerJob/PowerJob/issues/6) ღ( ´・ᴗ・\` )ღ 感谢以下接入用户的大力支持 ღ( ´・ᴗ・\` )ღ diff --git a/pom.xml b/pom.xml index 2a3fc49d..66364f71 100644 --- a/pom.xml +++ b/pom.xml @@ -19,8 +19,8 @@ - https://github.com/KFCFans/PowerJob - https://github.com/KFCFans/PowerJob.git + https://github.com/PowerJob/PowerJob + https://github.com/PowerJob/PowerJob.git diff --git a/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/common/config/SwaggerConfig.java b/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/common/config/SwaggerConfig.java index 68878f1e..a2a34028 100644 --- a/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/common/config/SwaggerConfig.java +++ b/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/common/config/SwaggerConfig.java @@ -44,7 +44,7 @@ public class SwaggerConfig { .title("PowerJob") .description("Distributed scheduling and computing framework.") .license("Apache Licence 2") - .termsOfServiceUrl("https://github.com/KFCFans/PowerJob") + .termsOfServiceUrl("https://github.com/PowerJob/PowerJob") .version(version) .build(); diff --git a/powerjob-server/src/main/resources/banner.txt b/powerjob-server/src/main/resources/banner.txt index 0d73c6d3..6e896f51 100644 --- a/powerjob-server/src/main/resources/banner.txt +++ b/powerjob-server/src/main/resources/banner.txt @@ -10,5 +10,5 @@ ${AnsiColor.GREEN} ${AnsiColor.BRIGHT_RED} * Maintainer: tengjiqi@gmail.com & PowerJob-Team * OfficialWebsite: http://www.powerjob.tech/ -* SourceCode: https://github.com/KFCFans/PowerJob +* SourceCode: https://github.com/PowerJob/PowerJob * PoweredBy: SpringBoot${spring-boot.formatted-version} & Akka (v2.6.4) diff --git a/powerjob-worker-samples/src/main/java/com/github/kfcfans/powerjob/samples/tester/StopInstanceTester.java b/powerjob-worker-samples/src/main/java/com/github/kfcfans/powerjob/samples/tester/StopInstanceTester.java index 4a70523c..fcdf4a05 100644 --- a/powerjob-worker-samples/src/main/java/com/github/kfcfans/powerjob/samples/tester/StopInstanceTester.java +++ b/powerjob-worker-samples/src/main/java/com/github/kfcfans/powerjob/samples/tester/StopInstanceTester.java @@ -7,7 +7,7 @@ import org.springframework.stereotype.Component; /** * 测试用户反馈的无法停止实例的问题 - * https://github.com/KFCFans/PowerJob/issues/37 + * https://github.com/PowerJob/PowerJob/issues/37 * * @author tjq * @since 2020/7/30 diff --git a/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/common/PowerBannerPrinter.java b/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/common/PowerBannerPrinter.java index eea991d7..97aac438 100644 --- a/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/common/PowerBannerPrinter.java +++ b/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/common/PowerBannerPrinter.java @@ -24,7 +24,7 @@ public final class PowerBannerPrinter { "\n" + "* Maintainer: tengjiqi@gmail.com & PowerJob-Team\n" + "* OfficialWebsite: http://www.powerjob.tech/\n" + - "* SourceCode: https://github.com/KFCFans/PowerJob\n" + + "* SourceCode: https://github.com/PowerJob/PowerJob\n" + "\n"; public static void print() { From b248f76d327783a2e26d4ad54dd061d9af3c1fa3 Mon Sep 17 00:00:00 2001 From: jiangjining Date: Wed, 6 Jan 2021 15:33:49 +0800 Subject: [PATCH 02/19] Add translation for PowerJobProperties. --- .../autoconfigure/PowerJobProperties.java | 35 +++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobProperties.java b/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobProperties.java index 480e9e8d..28a32c32 100644 --- a/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobProperties.java +++ b/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobProperties.java @@ -9,7 +9,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; /** - * PowerJob 配置项 + * PowerJob properties configuration class. * * @author songyinyin * @since 2020/7/26 16:37 @@ -90,37 +90,50 @@ public class PowerJobProperties { } - /** - * 客户端 配置项 + * Powerjob worker configuration properties. */ @Setter @Getter public static class Worker { /** - * 应用名称,需要提前在控制台注册,否则启动报错 + * Name of application, String type. Total length of this property should be no more than 255 + * characters. This is one of the required properties when registering a new application. This + * property should be assigned with the same value as what you entered for the appName. */ private String appName; /** - * 启动 akka 端口 + * Akka port of Powerjob-worker, optional value. Default value of this property is 27777. + * If multiple PowerJob-worker nodes were deployed, different, unique ports should be assigned. */ private int akkaPort = RemoteConstant.DEFAULT_WORKER_PORT; /** - * 调度服务器地址,ip:port 或 域名,多个用英文逗号分隔 + * Address(es) of Powerjob-server node(s). Ip:port or domain. + * Example of single Powerjob-server node: + *

+ * 127.0.0.1:7700 + *

+ * Example of Powerjob-server cluster: + *

+ * 192.168.0.10:7700,192.168.0.11:7700,192.168.0.12:7700 + *

*/ private String serverAddress; /** - * 本地持久化方式,默认使用磁盘 + * Local store strategy for H2. */ private StoreStrategy storeStrategy = StoreStrategy.DISK; /** - * 最大返回值长度,超过会被截断 - * {@link ProcessResult}#msg 的最大长度 + * Max length of response result. Result that is longer than the value will be truncated. + * {@link ProcessResult} max length for #msg */ private int maxResultLength = 8096; /** - * 启动测试模式,true情况下,不再尝试连接 server 并验证appName。 - * true -> 用于本地写单元测试调试; false -> 默认值,标准模式 + * If test mode is set as true, Powerjob-worker no longer connects to the server or validates appName. + * Test mode is used for conditions that your worker does not need to run the codes, i.e. when you + * write junit tests in local environment. + * true ---> Test mode enabled. + * false ---> Normal mode. */ private boolean enableTestMode = false; } From 1384e1a88600ceb0787f3430823437c660206c54 Mon Sep 17 00:00:00 2001 From: jiangjining Date: Wed, 6 Jan 2021 20:32:13 +0800 Subject: [PATCH 03/19] Optimize comments in starter. --- .../worker/autoconfigure/PowerJobProperties.java | 7 +++---- .../META-INF/spring-configuration-metadata.json | 12 ++++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobProperties.java b/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobProperties.java index 28a32c32..e8dd2d07 100644 --- a/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobProperties.java +++ b/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobProperties.java @@ -120,7 +120,7 @@ public class PowerJobProperties { */ private String serverAddress; /** - * Local store strategy for H2. + * Local store strategy for H2 database. {@code disk} or {@code memory}. */ private StoreStrategy storeStrategy = StoreStrategy.DISK; /** @@ -131,9 +131,8 @@ public class PowerJobProperties { /** * If test mode is set as true, Powerjob-worker no longer connects to the server or validates appName. * Test mode is used for conditions that your worker does not need to run the codes, i.e. when you - * write junit tests in local environment. - * true ---> Test mode enabled. - * false ---> Normal mode. + * write junit tests in local environment. {@code true} means test mode is enabled. {@code false} means + * normal mode is applied. */ private boolean enableTestMode = false; } diff --git a/powerjob-worker-spring-boot-starter/src/main/resources/META-INF/spring-configuration-metadata.json b/powerjob-worker-spring-boot-starter/src/main/resources/META-INF/spring-configuration-metadata.json index a67473e2..50a617fb 100644 --- a/powerjob-worker-spring-boot-starter/src/main/resources/META-INF/spring-configuration-metadata.json +++ b/powerjob-worker-spring-boot-starter/src/main/resources/META-INF/spring-configuration-metadata.json @@ -16,39 +16,39 @@ { "name": "powerjob.worker.akka-port", "type": "java.lang.Integer", - "description": "启动 akka 端口", + "description": "Akka port of PowerJob-worker", "sourceType": "com.github.kfcfans.powerjob.worker.autoconfigure.PowerJobProperties$Worker" }, { "name": "powerjob.worker.app-name", "type": "java.lang.String", - "description": "应用名称,需要提前在控制台注册,否则启动报错", + "description": "name of application. Register in PowerJob-console to prevent error.", "sourceType": "com.github.kfcfans.powerjob.worker.autoconfigure.PowerJobProperties$Worker" }, { "name": "powerjob.worker.enable-test-mode", "type": "java.lang.Boolean", - "description": "启动测试模式,true情况下,不再尝试连接 server 并验证appName。 true -> 用于本地写单元测试调试; false -> 默认值,标准模式", + "description": "Whether to enable test mode. In test mode, worker will not connect to server.", "sourceType": "com.github.kfcfans.powerjob.worker.autoconfigure.PowerJobProperties$Worker", "defaultValue": false }, { "name": "powerjob.worker.max-result-length", "type": "java.lang.Integer", - "description": "最大返回值长度,超过会被截断 {@link ProcessResult}#msg 的最大长度", + "description": "Max length for {@link ProcessResult}#msg, result longer than this property will be truncated.", "sourceType": "com.github.kfcfans.powerjob.worker.autoconfigure.PowerJobProperties$Worker", "defaultValue": 8096 }, { "name": "powerjob.worker.server-address", "type": "java.lang.String", - "description": "调度服务器地址,ip:port 或 域名,多个用英文逗号分隔", + "description": "PowerJob-server node address(es), ip:port or domain, multiple addresses should be separated with comma", "sourceType": "com.github.kfcfans.powerjob.worker.autoconfigure.PowerJobProperties$Worker" }, { "name": "powerjob.worker.store-strategy", "type": "com.github.kfcfans.powerjob.worker.common.constants.StoreStrategy", - "description": "本地持久化方式,默认使用磁盘", + "description": "Local store strategy, disk or memory", "sourceType": "com.github.kfcfans.powerjob.worker.autoconfigure.PowerJobProperties$Worker" } ], From d69171afa5c8448cbf5a9e6f4ff677dc25e3ec1c Mon Sep 17 00:00:00 2001 From: jiangjining Date: Thu, 7 Jan 2021 09:36:55 +0800 Subject: [PATCH 04/19] Add translations for PowerJobAutoConfiguration. --- .../PowerJobAutoConfiguration.java | 40 +++++++++++++------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobAutoConfiguration.java b/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobAutoConfiguration.java index f562d391..d47654f2 100644 --- a/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobAutoConfiguration.java +++ b/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobAutoConfiguration.java @@ -16,7 +16,7 @@ import java.util.Arrays; import java.util.List; /** - * PowerJob 自动装配 + * Auto configuration class for PowerJob-worker. * * @author songyinyin * @since 2020/7/26 16:37 @@ -32,30 +32,46 @@ public class PowerJobAutoConfiguration { PowerJobProperties.Worker worker = properties.getWorker(); - // 服务器HTTP地址(端口号为 server.port,而不是 ActorSystem port),请勿添加任何前缀(http://) + /* + * Address(es) of PowerJob-server node(s). Do not mistake for ActorSystem port. Do not add + * any prefix, i.e. http://. + */ CommonUtils.requireNonNull(worker.getServerAddress(), "serverAddress can't be empty!"); List serverAddress = Arrays.asList(worker.getServerAddress().split(",")); - // 1. 创建配置文件 + /* + * Create OhMyConfig object for setting properties. + */ OhMyConfig config = new OhMyConfig(); - - // 端口配置,支持随机端口 + /* + * Configuration of worker port. Random port is enabled when port is set with non-positive number. + */ int port = worker.getAkkaPort(); if (port <= 0) { port = NetUtils.getRandomPort(); } config.setPort(port); - - // appName,需要提前在控制台注册,否则启动报错 + /* + * appName, name of the application. Applications should be registered in advance to prevent + * reporting error. This property should be the same with what you entered for appName when + * getting registered. + */ config.setAppName(worker.getAppName()); config.setServerAddress(serverAddress); - // 如果没有大型 Map/MapReduce 的需求,建议使用内存来加速计算 - // 有大型 Map/MapReduce 需求,可能产生大量子任务(Task)的场景,请使用 DISK,否则妥妥的 OutOfMemory + /* + * For non-Map/MapReduce tasks, {@code memory} is recommended for speeding up calculation. + * Map/MapReduce tasks may produce batches of subtasks, which could lead to OutOfMemory + * exception or error, {@code disk} should be applied. + */ config.setStoreStrategy(worker.getStoreStrategy()); - // 启动测试模式,true情况下,不再尝试连接 server 并验证appName + /* + * When enabledTestMode is set as true, PowerJob-worker no longer connects to PowerJob-server + * or validate appName. + */ config.setEnableTestMode(worker.isEnableTestMode()); - - // 2. 创建 Worker 对象,设置配置文件 + /* + * Create OhMyWorker object and set properties. + */ OhMyWorker ohMyWorker = new OhMyWorker(); ohMyWorker.setConfig(config); return ohMyWorker; From d4a7aa68b1f9d4b0d4aa52f301257c87d0bf54fc Mon Sep 17 00:00:00 2001 From: jiangjining Date: Thu, 7 Jan 2021 10:09:29 +0800 Subject: [PATCH 05/19] Optimize translation in starter. --- .../autoconfigure/PowerJobAutoConfiguration.java | 10 +++++----- .../META-INF/spring-configuration-metadata.json | 4 ++-- .../autoconfigure/PowerJobAutoConfigurationTest.java | 4 ++-- .../src/test/resources/application.properties | 1 - 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobAutoConfiguration.java b/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobAutoConfiguration.java index d47654f2..577d7db6 100644 --- a/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobAutoConfiguration.java +++ b/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobAutoConfiguration.java @@ -33,7 +33,7 @@ public class PowerJobAutoConfiguration { PowerJobProperties.Worker worker = properties.getWorker(); /* - * Address(es) of PowerJob-server node(s). Do not mistake for ActorSystem port. Do not add + * Address of PowerJob-server node(s). Do not mistake for ActorSystem port. Do not add * any prefix, i.e. http://. */ CommonUtils.requireNonNull(worker.getServerAddress(), "serverAddress can't be empty!"); @@ -44,8 +44,8 @@ public class PowerJobAutoConfiguration { */ OhMyConfig config = new OhMyConfig(); /* - * Configuration of worker port. Random port is enabled when port is set with non-positive number. - */ + * Configuration of worker port. Random port is enabled when port is set with non-positive number. + */ int port = worker.getAkkaPort(); if (port <= 0) { port = NetUtils.getRandomPort(); @@ -53,8 +53,8 @@ public class PowerJobAutoConfiguration { config.setPort(port); /* * appName, name of the application. Applications should be registered in advance to prevent - * reporting error. This property should be the same with what you entered for appName when - * getting registered. + * error. This property should be the same with what you entered for appName when getting + * registered. */ config.setAppName(worker.getAppName()); config.setServerAddress(serverAddress); diff --git a/powerjob-worker-spring-boot-starter/src/main/resources/META-INF/spring-configuration-metadata.json b/powerjob-worker-spring-boot-starter/src/main/resources/META-INF/spring-configuration-metadata.json index 50a617fb..01a0eb3d 100644 --- a/powerjob-worker-spring-boot-starter/src/main/resources/META-INF/spring-configuration-metadata.json +++ b/powerjob-worker-spring-boot-starter/src/main/resources/META-INF/spring-configuration-metadata.json @@ -22,7 +22,7 @@ { "name": "powerjob.worker.app-name", "type": "java.lang.String", - "description": "name of application. Register in PowerJob-console to prevent error.", + "description": "Name of application. Register in PowerJob-console to prevent error.", "sourceType": "com.github.kfcfans.powerjob.worker.autoconfigure.PowerJobProperties$Worker" }, { @@ -42,7 +42,7 @@ { "name": "powerjob.worker.server-address", "type": "java.lang.String", - "description": "PowerJob-server node address(es), ip:port or domain, multiple addresses should be separated with comma", + "description": "PowerJob-server node(s) address. Ip:port or domain, multiple addresses should be separated with comma", "sourceType": "com.github.kfcfans.powerjob.worker.autoconfigure.PowerJobProperties$Worker" }, { diff --git a/powerjob-worker-spring-boot-starter/src/test/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobAutoConfigurationTest.java b/powerjob-worker-spring-boot-starter/src/test/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobAutoConfigurationTest.java index dd90d395..62dfa4a2 100644 --- a/powerjob-worker-spring-boot-starter/src/test/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobAutoConfigurationTest.java +++ b/powerjob-worker-spring-boot-starter/src/test/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobAutoConfigurationTest.java @@ -1,7 +1,7 @@ package com.github.kfcfans.powerjob.worker.autoconfigure; import com.github.kfcfans.powerjob.worker.OhMyWorker; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -16,7 +16,7 @@ class PowerJobAutoConfigurationTest { void testAutoConfiguration() { ConfigurableApplicationContext run = SpringApplication.run(PowerJobAutoConfigurationTest.class); OhMyWorker worker = run.getBean(OhMyWorker.class); - Assert.assertNotNull(worker); + Assertions.assertNotNull(worker); } } diff --git a/powerjob-worker-spring-boot-starter/src/test/resources/application.properties b/powerjob-worker-spring-boot-starter/src/test/resources/application.properties index fbcb42fa..46f6cdd3 100644 --- a/powerjob-worker-spring-boot-starter/src/test/resources/application.properties +++ b/powerjob-worker-spring-boot-starter/src/test/resources/application.properties @@ -1,2 +1 @@ - powerjob.enable-test-mode=true \ No newline at end of file From 281c53ad6331e1471592a2c643d52c62155a9078 Mon Sep 17 00:00:00 2001 From: jiangjining Date: Thu, 7 Jan 2021 18:56:56 +0800 Subject: [PATCH 06/19] docs: Add translations for pom and property files. --- pom.xml | 12 ++++----- powerjob-client/pom.xml | 2 +- powerjob-common/pom.xml | 2 +- .../common/model/DeployedContainerInfo.java | 18 +++++++++---- .../powerjob/common/model/GitRepoInfo.java | 18 +++++++++---- powerjob-server/pom.xml | 21 +++++++-------- .../powerjob/server/OhMyApplication.java | 10 +++---- .../resources/application-daily.properties | 16 +++++++----- .../main/resources/application-pre.properties | 16 +++++++----- .../resources/application-product.properties | 16 +++++++----- .../src/main/resources/application.properties | 10 +++---- .../src/main/resources/logback-dev.xml | 16 ++++++------ .../src/main/resources/logback-product.xml | 26 +++++++++---------- powerjob-worker-agent/pom.xml | 3 +-- .../src/main/resources/application.properties | 14 +++++----- 15 files changed, 109 insertions(+), 91 deletions(-) diff --git a/pom.xml b/pom.xml index 2a3fc49d..4ab9057c 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ ${java.version} - + org.apache.maven.plugins maven-source-plugin @@ -121,9 +121,9 @@ maven-javadoc-plugin ${maven-javadoc-plugin.version} - + false - + -Xdoclint:none @@ -164,7 +164,7 @@ - + dev @@ -173,7 +173,7 @@ - + org.apache.maven.plugins maven-compiler-plugin @@ -185,7 +185,7 @@ ${java.version} - + org.apache.maven.plugins maven-jar-plugin diff --git a/powerjob-client/pom.xml b/powerjob-client/pom.xml index 8a8a6621..71f1c2ba 100644 --- a/powerjob-client/pom.xml +++ b/powerjob-client/pom.xml @@ -37,7 +37,7 @@ ${powerjob.common.version} - + org.junit.jupiter junit-jupiter-api diff --git a/powerjob-common/pom.xml b/powerjob-common/pom.xml index b1e2d8e3..22125af3 100644 --- a/powerjob-common/pom.xml +++ b/powerjob-common/pom.xml @@ -76,7 +76,7 @@ ${commons.io.version} - + org.junit.jupiter junit-jupiter-api diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/DeployedContainerInfo.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/DeployedContainerInfo.java index 56a0c7f0..67e8deda 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/DeployedContainerInfo.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/DeployedContainerInfo.java @@ -6,7 +6,7 @@ import lombok.Data; import lombok.NoArgsConstructor; /** - * 已部署的容器信息 + * The class for deployed container. * * @author tjq * @since 2020/5/18 @@ -16,12 +16,20 @@ import lombok.NoArgsConstructor; @AllArgsConstructor public class DeployedContainerInfo implements OmsSerializable { - // 容器ID + /** + * Id of the container. + */ private Long containerId; - // 版本 + /** + * Version of the container. + */ private String version; - // 部署时间 + /** + * Deploy timestamp. + */ private long deployedTime; - // 机器地址(无需上报) + /** + * Address of the server. Report is not required. + */ private String workerAddress; } diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/GitRepoInfo.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/GitRepoInfo.java index 2ef2fa69..75a8c964 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/GitRepoInfo.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/GitRepoInfo.java @@ -3,19 +3,27 @@ package com.github.kfcfans.powerjob.common.model; import lombok.Data; /** - * Git代码库信息 + * The class for Git Repository. * * @author tjq * @since 2020/5/17 */ @Data public class GitRepoInfo { - // 仓库地址 + /** + * Address of Git repository. + */ private String repo; - // 分支名称 + /** + * Name of the branch. + */ private String branch; - // 用户名 + /** + * username of Git. + */ private String username; - // 密码 + /** + * Password of Git. + */ private String password; } diff --git a/powerjob-server/pom.xml b/powerjob-server/pom.xml index 83885a05..46956b5a 100644 --- a/powerjob-server/pom.xml +++ b/powerjob-server/pom.xml @@ -17,7 +17,7 @@ 2.9.2 2.3.4.RELEASE 3.4.2 - + 8.0.19 19.7.0.0 7.4.1.jre8 @@ -32,7 +32,7 @@ 1.2.68 1.0.1 - + true @@ -136,42 +136,42 @@ test - + net.lingala.zip4j zip4j ${zip4j.version} - + org.eclipse.jgit org.eclipse.jgit ${jgit.version} - + commons-net commons-net ${commons.net.version} - + org.apache.maven.shared maven-invoker ${mvn.invoker.version} - + com.alibaba fastjson ${fastjson.version} - + com.aliyun alibaba-dingtalk-service-sdk @@ -185,7 +185,6 @@ - io.springfox @@ -201,7 +200,7 @@ - + @@ -215,7 +214,7 @@ build-info - repackage + repackage diff --git a/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/OhMyApplication.java b/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/OhMyApplication.java index ddb10420..bbcc5c64 100644 --- a/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/OhMyApplication.java +++ b/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/OhMyApplication.java @@ -7,7 +7,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.scheduling.annotation.EnableScheduling; /** - * SpringBoot 启动入口 + * SpringBoot entry. * * @author tjq * @since 2020/3/29 @@ -26,16 +26,16 @@ public class OhMyApplication { public static void main(String[] args) { - // 完成前置工作 + // Print tips before starting. pre(); - // 先启动 ActorSystem + // Init ActorSystem OhMyServer.init(); - // 再启动SpringBoot + // Start SpringBoot application. try { SpringApplication.run(OhMyApplication.class, args); - }catch (Throwable t) { + } catch (Throwable t) { log.error(TIPS); throw t; } diff --git a/powerjob-server/src/main/resources/application-daily.properties b/powerjob-server/src/main/resources/application-daily.properties index 18bb67ef..a0b1c299 100644 --- a/powerjob-server/src/main/resources/application-daily.properties +++ b/powerjob-server/src/main/resources/application-daily.properties @@ -1,7 +1,7 @@ oms.env=DAILY logging.config=classpath:logback-dev.xml -####### 外部数据库配置(需要用户更改为自己的数据库配置) ####### +####### Database properties(Configure according to the the environment) ####### spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/powerjob-daily?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai spring.datasource.core.username=root @@ -9,11 +9,12 @@ spring.datasource.core.password=No1Bug2Please3! spring.datasource.core.hikari.maximum-pool-size=20 spring.datasource.core.hikari.minimum-idle=5 -####### mongoDB配置,非核心依赖,通过配置 oms.mongodb.enable=false 来关闭 ####### +####### MongoDB properties(Non-core configuration properties) ####### +####### configure oms.mongodb.enable=false to disable mongodb ####### oms.mongodb.enable=true spring.data.mongodb.uri=mongodb+srv://zqq:No1Bug2Please3!@cluster0.wie54.gcp.mongodb.net/powerjob_daily?retryWrites=true&w=majority -####### 邮件配置(不需要邮件报警可以删除以下配置来避免报错) ####### +####### Email properties(Comment out the mail properties if you do not have needs) ####### spring.mail.host=smtp.163.com spring.mail.username=zqq@163.com spring.mail.password=GOFZPNARMVKCGONV @@ -21,18 +22,19 @@ spring.mail.properties.mail.smtp.auth=true spring.mail.properties.mail.smtp.starttls.enable=true spring.mail.properties.mail.smtp.starttls.required=true -####### 钉钉报警配置(不需要钉钉报警可以删除以下配置来避免报错) ####### +####### DingTalk properties(Comment out the DingTalk properties if you do not have needs) ####### oms.alarm.ding.app-key=dingauqwkvxxnqskknfv oms.alarm.ding.app-secret=XWrEPdAZMPgJeFtHuL0LH73LRj-74umF2_0BFcoXMfvnX0pCQvt0rpb1JOJU_HLl oms.alarm.ding.agent-id=847044348 -####### 资源清理配置 ####### +####### Resource cleaning properties ####### oms.instanceinfo.retention=1 oms.container.retention.local=1 oms.container.retention.remote=-1 -####### 缓存配置 ####### +####### Cache properties ####### oms.instance.metadata.cache.size=1024 -####### 精确获取 server 的百分比,0~100,100代表每次 worker 获取 server 都会进行完整的探活流程,不存在脑裂问题,但有性能开销 ####### +####### Threshold in fetching server(0~100). 100 means full detection of server, in which ####### +####### split-brain could be avoided while performance overhead would increase. ####### oms.accurate.select.server.percentage = 50 \ No newline at end of file diff --git a/powerjob-server/src/main/resources/application-pre.properties b/powerjob-server/src/main/resources/application-pre.properties index 496d84ab..f0f27100 100644 --- a/powerjob-server/src/main/resources/application-pre.properties +++ b/powerjob-server/src/main/resources/application-pre.properties @@ -1,7 +1,7 @@ oms.env=PRE logging.config=classpath:logback-product.xml -####### 数据库配置 ####### +####### Database properties(Configure according to the the environment) ####### spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.core.jdbc-url=jdbc:mysql://remotehost:3306/powerjob-pre?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai spring.datasource.core.username=root @@ -9,11 +9,12 @@ spring.datasource.core.password=No1Bug2Please3! spring.datasource.core.hikari.maximum-pool-size=20 spring.datasource.core.hikari.minimum-idle=5 -####### mongoDB配置,非核心依赖,通过配置 oms.mongodb.enable=false 来关闭 ####### +####### MongoDB properties(Non-core configuration properties) ####### +####### configure oms.mongodb.enable=false to disable mongodb ####### oms.mongodb.enable=true spring.data.mongodb.uri=mongodb://remotehost:27017/powerjob-pre -####### 邮件配置(不需要邮件报警可以删除以下配置来避免报错) ####### +####### Email properties(Comment out the mail properties if you do not have needs) ####### spring.mail.host=smtp.qq.com spring.mail.username=zqq spring.mail.password=qqz @@ -21,18 +22,19 @@ spring.mail.properties.mail.smtp.auth=true spring.mail.properties.mail.smtp.starttls.enable=true spring.mail.properties.mail.smtp.starttls.required=true -####### 钉钉报警配置(不需要钉钉报警可以删除以下配置来避免报错) ####### +####### DingTalk properties(Comment out the DingTalk properties if you do not have needs) ####### oms.alarm.ding.app-key=dingauqwkvxxnqskknfv oms.alarm.ding.app-secret=XWrEPdAZMPgJeFtHuL0LH73LRj-74umF2_0BFcoXMfvnX0pCQvt0rpb1JOJU_HLl oms.alarm.ding.agent-id=847044348 -####### 资源清理配置 ####### +####### Resource cleaning properties ####### oms.instanceinfo.retention=3 oms.container.retention.local=3 oms.container.retention.remote=-1 -####### 缓存配置 ####### +####### Cache properties ####### oms.instance.metadata.cache.size=1024 -####### 精确获取 server 的百分比,0~100,100代表每次 worker 获取 server 都会进行完整的探活流程,不存在脑裂问题,但有性能开销 ####### +####### Threshold in fetching server(0~100). 100 means full detection of server, in which ####### +####### split-brain could be avoided while performance overhead would increase. ####### oms.accurate.select.server.percentage = 50 \ No newline at end of file diff --git a/powerjob-server/src/main/resources/application-product.properties b/powerjob-server/src/main/resources/application-product.properties index 15ee98e4..8b6baad6 100644 --- a/powerjob-server/src/main/resources/application-product.properties +++ b/powerjob-server/src/main/resources/application-product.properties @@ -1,7 +1,7 @@ oms.env=PRODUCT logging.config=classpath:logback-product.xml -####### 数据库配置 ####### +####### Database properties(Configure according to the the environment) ####### spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/powerjob-product?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai spring.datasource.core.username=root @@ -9,11 +9,12 @@ spring.datasource.core.password=No1Bug2Please3! spring.datasource.core.hikari.maximum-pool-size=20 spring.datasource.core.hikari.minimum-idle=5 -####### mongoDB配置,非核心依赖,通过配置 oms.mongodb.enable=false 来关闭 ####### +####### MongoDB properties(Non-core configuration properties) ####### +####### configure oms.mongodb.enable=false to disable mongodb ####### oms.mongodb.enable=true spring.data.mongodb.uri=mongodb://localhost:27017/powerjob-product -####### 邮件配置(不需要邮件报警可以删除以下配置来避免报错) ####### +####### Email properties(Comment out the mail properties if you do not have needs) ####### spring.mail.host=smtp.qq.com spring.mail.username=zqq spring.mail.password=qqz @@ -21,18 +22,19 @@ spring.mail.properties.mail.smtp.auth=true spring.mail.properties.mail.smtp.starttls.enable=true spring.mail.properties.mail.smtp.starttls.required=true -####### 钉钉报警配置(不需要钉钉报警可以删除以下配置来避免报错) ####### +####### DingTalk properties(Comment out the DingTalk properties if you do not have needs) ####### oms.alarm.ding.app-key= oms.alarm.ding.app-secret= oms.alarm.ding.agent-id= -####### 资源清理配置 ####### +####### Resource cleaning properties ####### oms.instanceinfo.retention=7 oms.container.retention.local=7 oms.container.retention.remote=-1 -####### 缓存配置 ####### +####### Cache properties ####### oms.instance.metadata.cache.size=2048 -####### 精确获取 server 的百分比,0~100,100代表每次 worker 获取 server 都会进行完整的探活流程,不存在脑裂问题,但有性能开销 ####### +####### Threshold in fetching server(0~100). 100 means full detection of server, in which ####### +####### split-brain could be avoided while performance overhead would increase. ####### oms.accurate.select.server.percentage = 50 \ No newline at end of file diff --git a/powerjob-server/src/main/resources/application.properties b/powerjob-server/src/main/resources/application.properties index d91d0684..002de73c 100644 --- a/powerjob-server/src/main/resources/application.properties +++ b/powerjob-server/src/main/resources/application.properties @@ -1,4 +1,4 @@ -# http 服务端口 +# Http server port server.port=7700 spring.profiles.active=daily @@ -7,14 +7,14 @@ spring.jpa.open-in-view=false spring.data.mongodb.repositories.type=none logging.level.org.mongodb=warn -# 文件上传配置 +# Configuration for uploading files. spring.servlet.multipart.enabled=true spring.servlet.multipart.file-size-threshold=0 spring.servlet.multipart.max-file-size=209715200 spring.servlet.multipart.max-request-size=209715200 -###### PowerJob 自身配置(该配置只允许存在于 application.properties 文件中) ###### -# akka ActorSystem 服务端口 +###### PowerJob self-owned configuration (The following properties should exist in application.properties only). ###### +# Akka ActorSystem port. oms.akka.port=10086 -# 表前缀(默认无表前缀,有需求直接填入表前缀即可,比如 pj_ ) +# Prefix for all tables. Default empty string. Config if you have needs, i.e. pj_ oms.table-prefix= \ No newline at end of file diff --git a/powerjob-server/src/main/resources/logback-dev.xml b/powerjob-server/src/main/resources/logback-dev.xml index ec9b4011..3fdd2c66 100644 --- a/powerjob-server/src/main/resources/logback-dev.xml +++ b/powerjob-server/src/main/resources/logback-dev.xml @@ -1,18 +1,18 @@ - + - - + + - + - + ${CONSOLE_LOG_PATTERN} @@ -20,13 +20,13 @@ - + - + - + diff --git a/powerjob-server/src/main/resources/logback-product.xml b/powerjob-server/src/main/resources/logback-product.xml index 2be6e263..9ccddcd9 100644 --- a/powerjob-server/src/main/resources/logback-product.xml +++ b/powerjob-server/src/main/resources/logback-product.xml @@ -1,20 +1,20 @@ - + - + - + + Log path, pay attention to permission, logs may be unable to generate. + Bug recording: Setting `~/logs`, is unable to create folder in user home directory, + a folder with the name ~ is created in project folder. + --> - - + ${LOG_PATH}/powerjob-server-error.log @@ -31,9 +31,9 @@ DENY - + - + ${LOG_PATH}/powerjob-server-web.log @@ -49,9 +49,9 @@ - + - + ${LOG_PATH}/powerjob-server-application.log @@ -64,7 +64,7 @@ true - + diff --git a/powerjob-worker-agent/pom.xml b/powerjob-worker-agent/pom.xml index 94ea9386..4761e8b2 100644 --- a/powerjob-worker-agent/pom.xml +++ b/powerjob-worker-agent/pom.xml @@ -50,7 +50,6 @@ - @@ -63,7 +62,7 @@ - repackage + repackage diff --git a/powerjob-worker-samples/src/main/resources/application.properties b/powerjob-worker-samples/src/main/resources/application.properties index 17bfa59f..79e356e3 100644 --- a/powerjob-worker-samples/src/main/resources/application.properties +++ b/powerjob-worker-samples/src/main/resources/application.properties @@ -1,15 +1,13 @@ server.port=8081 - spring.jpa.open-in-view=false - -########### powerjob-worker 配置(老配置 powerjob.xxx 即将废弃,请使用 powerjob.worker.xxx) ########### -# akka 工作端口,可选,默认 27777 +########### PowerJob-worker properties. ########### +# Akka port, default is 27777 powerjob.worker.akka-port=27777 -# 接入应用名称,用于分组隔离,推荐填写 本 Java 项目名称 +# Application name, used for grouping applications. Recommend to set the same value as project name. powerjob.worker.app-name=powerjob-agent-test -# 调度服务器地址,IP:Port 或 域名,多值逗号分隔 +# Address of PowerJob-server node(s). Ip:port or domain. Multiple addresses should be separated with comma. powerjob.worker.server-address=127.0.0.1:7700,127.0.0.1:7701 -# 持久化方式,可选,默认 disk +# Store strategy of H2 database. disk or memory. Default value is disk. powerjob.worker.store-strategy=disk -# 返回值最大长度,默认 8096 +# Max length of result. Results that are longer than the value will be truncated. powerjob.worker.max-result-length=4096 \ No newline at end of file From 36e258012efa069576ed2c962ddb73e9938794cf Mon Sep 17 00:00:00 2001 From: jiangjining Date: Thu, 7 Jan 2021 19:44:25 +0800 Subject: [PATCH 07/19] docs: Add translations PowerJob-client. --- .../kfcfans/powerjob/client/OhMyClient.java | 18 +++++++++--------- .../kfcfans/powerjob/client/TypeStore.java | 2 +- powerjob-client/src/test/java/TestClient.java | 4 ++-- .../src/test/java/TestWorkflow.java | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/OhMyClient.java b/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/OhMyClient.java index d7c3bfb4..72d0a788 100644 --- a/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/OhMyClient.java +++ b/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/OhMyClient.java @@ -25,7 +25,7 @@ import java.util.Objects; import static com.github.kfcfans.powerjob.client.TypeStore.*; /** - * OpenAPI 客户端 + * OpenAPI Client. * * @author tjq * @since 2020/4/15 @@ -40,9 +40,9 @@ public class OhMyClient { private static final String URL_PATTERN = "http://%s%s%s"; /** - * 初始化 OhMyClient 客户端 + * Init OhMyClient with domain, appName and password. * @param domain 比如 www.powerjob-server.com(内网域名,自行完成 DNS & Proxy) - * @param appName 负责的应用名称 + * @param appName name of the application */ public OhMyClient(String domain, String appName, String password) { this(Lists.newArrayList(domain), appName, password); @@ -50,9 +50,9 @@ public class OhMyClient { /** - * 初始化 OhMyClient 客户端 - * @param addressList IP:Port 列表 - * @param appName 负责的应用名称 + * nit OhMyClient with server address, appName and password. + * @param addressList IP:Port address list + * @param appName name of the application */ public OhMyClient(List addressList, String appName, String password) { @@ -199,7 +199,7 @@ public class OhMyClient { return runJob(jobId, null, 0); } - /* ************* Instance 区 ************* */ + /* ************* Instance API list ************* */ /** * 停止应用实例 * @param instanceId 应用实例ID @@ -275,7 +275,7 @@ public class OhMyClient { return JSONObject.parseObject(post, INSTANCE_RESULT_TYPE); } - /* ************* Workflow 区 ************* */ + /* ************* Workflow API list ************* */ /** * 保存工作流(包括创建和修改) * @param request 创建/修改 Workflow 请求 @@ -374,7 +374,7 @@ public class OhMyClient { return runWorkflow(workflowId, null, 0); } - /* ************* Workflow Instance 区 ************* */ + /* ************* Workflow Instance API list ************* */ /** * 停止应用实例 * @param wfInstanceId 工作流实例ID diff --git a/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/TypeStore.java b/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/TypeStore.java index 754e35ed..0c680e79 100644 --- a/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/TypeStore.java +++ b/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/TypeStore.java @@ -4,7 +4,7 @@ import com.alibaba.fastjson.TypeReference; import com.github.kfcfans.powerjob.common.response.*; /** - * 类型工厂 + * TypeReference store. * * @author tjq * @since 11/7/20 diff --git a/powerjob-client/src/test/java/TestClient.java b/powerjob-client/src/test/java/TestClient.java index f50aed98..61fae077 100644 --- a/powerjob-client/src/test/java/TestClient.java +++ b/powerjob-client/src/test/java/TestClient.java @@ -12,7 +12,7 @@ import org.junit.jupiter.api.Test; import java.util.concurrent.TimeUnit; /** - * 测试 Client + * Test cases for {@link OhMyClient} * * @author tjq * @since 2020/4/15 @@ -110,7 +110,7 @@ public class TestClient { ResultDTO startRes = ohMyClient.runJob(15L, "start by OhMyClient", 2000000); System.out.println("runJob result: " + JSONObject.toJSONString(startRes)); - // 手动重启 server,干掉时间轮中的调度数据 + // Restart server manually and clear all the data in time wheeler. TimeUnit.MINUTES.sleep(1); ResultDTO cancelRes = ohMyClient.cancelInstance(startRes.getData()); diff --git a/powerjob-client/src/test/java/TestWorkflow.java b/powerjob-client/src/test/java/TestWorkflow.java index 6feaf266..71630e7e 100644 --- a/powerjob-client/src/test/java/TestWorkflow.java +++ b/powerjob-client/src/test/java/TestWorkflow.java @@ -13,7 +13,7 @@ import org.junit.jupiter.api.Test; import java.util.List; /** - * 测试 Client(workflow部分) + * Test cases for {@link OhMyClient} workflow. * * @author tjq * @since 2020/6/2 From d5ab77ddbd9ba43602643b856ba69f820c6610b5 Mon Sep 17 00:00:00 2001 From: jiangjining Date: Thu, 7 Jan 2021 20:35:55 +0800 Subject: [PATCH 08/19] docs: Add translations for some entities in PowerJob-common. --- .../kfcfans/powerjob/client/OhMyClient.java | 2 +- .../powerjob/common/ContainerConstant.java | 9 ++++++--- .../github/kfcfans/powerjob/common/Env.java | 11 ++++++++++- .../kfcfans/powerjob/common/ExecuteType.java | 11 ++++++++++- .../kfcfans/powerjob/common/OmsConstant.java | 2 +- .../powerjob/common/OmsSerializable.java | 2 +- .../common/model/InstanceLogContent.java | 18 +++++++++++++----- 7 files changed, 42 insertions(+), 13 deletions(-) diff --git a/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/OhMyClient.java b/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/OhMyClient.java index 72d0a788..9a8a980e 100644 --- a/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/OhMyClient.java +++ b/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/OhMyClient.java @@ -25,7 +25,7 @@ import java.util.Objects; import static com.github.kfcfans.powerjob.client.TypeStore.*; /** - * OpenAPI Client. + * OhMyClient, the client for OpenAPI. * * @author tjq * @since 2020/4/15 diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/ContainerConstant.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/ContainerConstant.java index ab8cc275..06b00697 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/ContainerConstant.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/ContainerConstant.java @@ -1,7 +1,7 @@ package com.github.kfcfans.powerjob.common; /** - * 容器常量 + * Container constants. * * @author tjq * @since 2020/5/15 @@ -9,13 +9,16 @@ package com.github.kfcfans.powerjob.common; public class ContainerConstant { /** - * spring-context 配置文件名称 + * Spring-context configuration file name of the container. */ public static final String SPRING_CONTEXT_FILE_NAME = "oms-worker-container-spring-context.xml"; /** - * container 属性文件名称 + * Property file name of the container. */ public static final String CONTAINER_PROPERTIES_FILE_NAME = "oms-worker-container.properties"; + /** + * Package name of the container. + */ public static final String CONTAINER_PACKAGE_NAME_KEY = "PACKAGE_NAME"; } diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/Env.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/Env.java index e5344061..25906112 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/Env.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/Env.java @@ -1,13 +1,22 @@ package com.github.kfcfans.powerjob.common; /** - * 部署环境 + * Environment Enum class. * * @author tjq * @since 2020/5/3 */ public enum Env { + /** + * Development or test environment. + */ DAILY, + /** + * Pre-release environment. + */ PRE, + /** + * Production environment. + */ PRODUCT } diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/ExecuteType.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/ExecuteType.java index 5f46d9ec..7ee38b53 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/ExecuteType.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/ExecuteType.java @@ -4,7 +4,7 @@ import lombok.AllArgsConstructor; import lombok.Getter; /** - * 任务执行类型 + * Execution type. * * @author tjq * @since 2020/3/17 @@ -12,8 +12,17 @@ import lombok.Getter; @Getter @AllArgsConstructor public enum ExecuteType { + /** + * Standalone type of task. + */ STANDALONE(1, "单机执行"), + /** + * Broadcast type of task. + */ BROADCAST(2, "广播执行"), + /** + * MapReduce type of task. + */ MAP_REDUCE(3, "MapReduce"), MAP(4, "Map"); diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/OmsConstant.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/OmsConstant.java index 3cb99e5e..a2a79fd4 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/OmsConstant.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/OmsConstant.java @@ -1,7 +1,7 @@ package com.github.kfcfans.powerjob.common; /** - * 公共常量 + * Common constants. * * @author tjq * @since 2020/5/31 diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/OmsSerializable.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/OmsSerializable.java index 36243db5..aa132dad 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/OmsSerializable.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/OmsSerializable.java @@ -3,7 +3,7 @@ package com.github.kfcfans.powerjob.common; import java.io.Serializable; /** - * PowerJob 序列化标记接口 + * PowerJob serializable interface. * * @author tjq * @since 2020/4/16 diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/InstanceLogContent.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/InstanceLogContent.java index 0be65e93..ce588945 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/InstanceLogContent.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/InstanceLogContent.java @@ -6,7 +6,7 @@ import lombok.Data; import lombok.NoArgsConstructor; /** - * 任务实例日志对象 + * Log instance model. * * @author tjq * @since 2020/4/21 @@ -16,13 +16,21 @@ import lombok.NoArgsConstructor; @AllArgsConstructor public class InstanceLogContent implements OmsSerializable { - // 实例ID + /** + * Id of instance. + */ private long instanceId; - // 日志提交时间 + /** + * Submitted time of the log. + */ private long logTime; - // 级别 + /** + * Level of the log. + */ private int logLevel; - // 日志内容 + /** + * Content of the log. + */ private String logContent; } From b1b8e1de95c274285291b1853dda9f81e142cb51 Mon Sep 17 00:00:00 2001 From: jjn Date: Fri, 8 Jan 2021 22:20:35 +0800 Subject: [PATCH 09/19] docs: Add translations for models in PowerJob-common. --- README.md | 2 +- .../powerjob/common/model/GitRepoInfo.java | 2 +- .../powerjob/common/model/InstanceDetail.java | 36 +++++- .../powerjob/common/model/PEWorkflowDAG.java | 22 +++- .../powerjob/common/model/SystemMetrics.java | 82 ++++++++----- .../request/http/SaveJobInfoRequest.java | 110 +++++++++++++----- 6 files changed, 189 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index f0115858..7b8a13ee 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Application password: 123 | Distributed strategy | Unsupported | Static sharding | MapReduce dynamic sharding | **MapReduce dynamic sharding** | | Online task management | Unsupported | Supported | Supported | **Supported** | | Online logging | Unsupported | Supported | Unsupported | **Supported** | -| Scheduling methods and performance | Based on database lock, there is a performance bottleneck | Based on database lock, there is a performance bottleneck | Unknown | **Lock-free design, powerful performance without upper limit** | +| Scheduling methods and performance | Based on database lock, there is a performance bottleneck | Based on database lock, there is a performance bottleneck | Unknown | **Lock-free design, high performance without upper limit** | | Alarm monitoring | Unsupported | Email | SMS | **Email, WebHook, DingTalk. An interface is provided for customization.** | | System dependence | Any relational database (MySQL, Oracle ...) supported by JDBC | MySQL | RMB (Public Beta version for free, hey, helping to promote) | **Any relational database (MySQL, Oracle ...) supported by Spring Data Jpa** | | workflow | Unsupported | Unsupported | Supported | **Supported** | diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/GitRepoInfo.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/GitRepoInfo.java index 75a8c964..0aaa5013 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/GitRepoInfo.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/GitRepoInfo.java @@ -3,7 +3,7 @@ package com.github.kfcfans.powerjob.common.model; import lombok.Data; /** - * The class for Git Repository. + * The class for Git Repository info. * * @author tjq * @since 2020/5/17 diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/InstanceDetail.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/InstanceDetail.java index e690c3ab..90f12886 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/InstanceDetail.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/InstanceDetail.java @@ -16,30 +16,60 @@ import java.util.List; @NoArgsConstructor public class InstanceDetail implements OmsSerializable { - // 任务预计执行时间 + /** + * Expected trigger time. + */ private Long expectedTriggerTime; - // 任务整体开始时间 + /** + * Actual trigger time of an instance. + */ private Long actualTriggerTime; // 任务整体结束时间(可能不存在) + /** + * Finish time of an instance, which may be null. + */ private Long finishedTime; - // 任务状态 + /** + * Status of the task instance. + */ private Integer status; // 任务执行结果(可能不存在) + /** + * Execution result, which may be null. + */ private String result; // TaskTracker地址 + /** + * Task tracker address. + */ private String taskTrackerAddress; // 启动参数 + /** + * Param string that is passed to an instance when it is initialized. + */ private String instanceParams; // MR或BD任务专用 + /** + * Task detail, used by MapReduce or Broadcast tasks. + */ private TaskDetail taskDetail; // 秒级任务专用 + /** + * + */ private List subInstanceDetails; // 重试次数 + /** + * + */ private Long runningTimes; // 扩展字段,中间件升级不易,最好不要再改 common 包了...否则 server worker 版本不兼容 + /** + * Extend + */ private String extra; // 秒级任务的 extra -> List diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/PEWorkflowDAG.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/PEWorkflowDAG.java index 3fe258ca..f49bcacc 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/PEWorkflowDAG.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/PEWorkflowDAG.java @@ -13,8 +13,7 @@ import java.io.Serializable; import java.util.List; /** - * Point & Edge DAG 表示法 - * 点 + 线,易于表达和传播 + * Points & edges for DAG, making it easier to describe or transfer. * * @author tjq * @since 2020/5/26 @@ -23,11 +22,18 @@ import java.util.List; @NoArgsConstructor public class PEWorkflowDAG implements Serializable { - // DAG 图(点线表示法) + /** + * Nodes of DAG diagram. + */ private List nodes; + /** + * Edges of DAG diagram. + */ private List edges; - // 点 + /** + * Point. + */ @Data @NoArgsConstructor @AllArgsConstructor @@ -35,7 +41,9 @@ public class PEWorkflowDAG implements Serializable { private Long jobId; private String jobName; - // 运行时参数,图定义不需要 + /** + * Instance running param, which is not required by DAG. + */ @JsonSerialize(using= ToStringSerializer.class) private Long instanceId; private Integer status; @@ -47,7 +55,9 @@ public class PEWorkflowDAG implements Serializable { } } - // 边 jobId -> jobId + /** + * Edge formed by two job ids. + */ @Data @NoArgsConstructor @AllArgsConstructor diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/SystemMetrics.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/SystemMetrics.java index 1d5945ec..7d053bbe 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/SystemMetrics.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/SystemMetrics.java @@ -4,7 +4,7 @@ import com.github.kfcfans.powerjob.common.OmsSerializable; import lombok.Data; /** - * 系统指标 + * Class for system metrics . * * @author tjq * @since 2020/3/25 @@ -12,49 +12,77 @@ import lombok.Data; @Data public class SystemMetrics implements OmsSerializable, Comparable { - // CPU核心数量 + /** + * CPU processor num. + */ private int cpuProcessors; - // CPU负载(负载 和 使用率 是两个完全不同的概念,Java 无法获取 CPU 使用率,只能获取负载) + /** + * Percent of CPU load. + */ private double cpuLoad; - // 内存(单位 GB) + /** + * Memory that is used by JVM, in GB. + */ private double jvmUsedMemory; + /** + * Max memory that JVM can use, in GB. + */ private double jvmMaxMemory; - // 内存占用(0.X,非百分比) + /** + * Ratio of memory that JVM uses to total memory, 0.X, + * the value is between 0 and 1. + */ private double jvmMemoryUsage; - // 磁盘(单位 GB) + /** + * Total used disk space, in GB. + */ private double diskUsed; + /** + * Total disk space, in GB. + */ private double diskTotal; - // 磁盘占用(0.X,非百分比) + /** + * Used disk ratio. + */ private double diskUsage; - // 缓存分数 + /** + * Score of cache. + */ private int score; + /** + * Override compareTo. + * + * @param that the metrics that is to be compared with current. + * @return {@code int} + */ @Override public int compareTo(SystemMetrics that) { - // 降序排列 + // Sort by metrics in descending order. return that.calculateScore() - this.calculateScore(); } /** - * 计算得分情况,内存 & CPU (磁盘不参与计算) - * @return 得分情况 + * Calculate score, based on CPU and memory info. + * + * @return score */ public int calculateScore() { - if (score > 0) { - return score; - } + if (score > 0) { + return score; + } - // 对于 TaskTracker 来说,内存是任务顺利完成的关键,因此内存 2 块钱 1GB - double memScore = (jvmMaxMemory - jvmUsedMemory) * 2; - // CPU 剩余负载,1 块钱 1 斤 - double cpuScore = cpuProcessors - cpuLoad; - // Indian Windows 无法获取 CpuLoad,为 -1,固定为 1 - if (cpuScore > cpuProcessors) { - cpuScore = 1; + // Memory is vital to TaskTracker, so we set the multiplier factor as 2. + double memScore = (jvmMaxMemory - jvmUsedMemory) * 2; + // Calculate the remaining load of CPU. Multiplier is set as 1. + double cpuScore = cpuProcessors - cpuLoad; + // Windows can not fetch CPU load, set cpuScore as 1. + if (cpuScore > cpuProcessors) { + cpuScore = 1; } score = (int) (memScore + cpuScore); @@ -62,11 +90,12 @@ public class SystemMetrics implements OmsSerializable, Comparable } /** - * 该机器是否可用 - * @param minCPUCores 判断标准之最低可用CPU核心数量 + * Judge if the machine is available. + * + * @param minCPUCores Minimum available CPU cores. * @param minMemorySpace 判断标准之最低可用内存 - * @param minDiskSpace 判断标准之最低可用磁盘空间 - * @return 是否可用 + * @param minDiskSpace Minimum disk space 判断标准之最低可用磁盘空间 + * @return {@code boolean} whether the machine is available. */ public boolean available(double minCPUCores, double minMemorySpace, double minDiskSpace) { @@ -77,7 +106,8 @@ public class SystemMetrics implements OmsSerializable, Comparable return false; } - // cpuLoad 为负数代表无法获取,不判断。等于 0 为最理想情况,CPU 空载,不需要判断 + // Negative number means being unable to fetch CPU info, return true. + // 0 indicates the CPU is free, which is the optimal condition. if (cpuLoad <= 0 || minCPUCores <= 0) { return true; } diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/request/http/SaveJobInfoRequest.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/request/http/SaveJobInfoRequest.java index ae7a24e2..2bc8435f 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/request/http/SaveJobInfoRequest.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/request/http/SaveJobInfoRequest.java @@ -9,7 +9,7 @@ import lombok.Data; import java.util.List; /** - * 创建/修改 JobInfo 请求 + * Save or modify {@link com.github.kfcfans.powerjob.common.response.JobInfoDTO} * * @author tjq * @since 2020/3/30 @@ -17,68 +17,122 @@ import java.util.List; @Data public class SaveJobInfoRequest { - // 任务ID(jobId),null -> 插入,否则为更新 + /** + * id of the job. set null to save or non-null to update the job. + */ private Long id; - /* ************************** 任务基本信息 ************************** */ - // 任务名称 + /* ************************** Base info of related job. ************************** */ + + /** + * Name of the job. + */ private String jobName; - // 任务描述 + /** + * Description of the job. + */ private String jobDescription; - // 任务所属的应用ID(Client无需填写该参数,自动填充) + /** + * Related id of the application. There is not need to set this property + * in PowerJob-client, as it would be set automatically. + */ private Long appId; - // 任务自带的参数 + /** + * Params that these jobs carry with when they are created. + */ private String jobParams; - /* ************************** 定时参数 ************************** */ - // 时间表达式类型(CRON/API/FIX_RATE/FIX_DELAY) + /* ************************** Timing param. ************************** */ + /** + * Time expression type. + */ private TimeExpressionType timeExpressionType; - // 时间表达式,CRON/NULL/LONG/LONG + /** + * Time expression. + */ private String timeExpression; - /* ************************** 执行方式 ************************** */ - // 执行类型,单机/广播/MR + /* ************************** Execution type. ************************** */ + /** + * Execution type, {@code standalone}, {@code broadcast} or {@code Map/MapReduce} + */ private ExecuteType executeType; - // 执行器类型,Java/Shell + /** + * Processor type, {@code Java}, {@code Python} or {@code Shell}. + */ private ProcessorType processorType; - // 执行器信息 + /** + * Processor info. + */ private String processorInfo; - /* ************************** 运行时配置 ************************** */ - // 最大同时运行任务数,0 代表不限 + /* ************************** Running instance setting. ************************** */ + /** + * Maximum instance setting num. {@code 0} means there is no restriction. + */ private Integer maxInstanceNum = 0; - // 并发度,同时执行的线程数量 + /** + * Concurrency setting. Number of threads that run simultaneously. + */ private Integer concurrency = 5; - // 任务整体超时时间 + /** + * Max instance running time setting. {@code 0L} means there is no restriction. + */ private Long instanceTimeLimit = 0L; - /* ************************** 重试配置 ************************** */ + /* ************************** Retrial setting. ************************** */ + /** + * Instance retry number setting. + */ private Integer instanceRetryNum = 0; + /** + * Task retry number setting. + */ private Integer taskRetryNum = 0; - /* ************************** 繁忙机器配置 ************************** */ - // 最低CPU核心数量,0代表不限 + /* ************************** Busy Machine setting. ************************** */ + /** + * Minimum CPU required. {@code 0} means there is no restriction. + */ private double minCpuCores = 0; - // 最低内存空间,单位 GB,0代表不限 + /** + * Minimum memory required, in GB. + */ private double minMemorySpace = 0; - // 最低磁盘空间,单位 GB,0代表不限 + /** + * Minimum disk space, in GB. {@code 0} means there is no restriction. + */ private double minDiskSpace = 0; - // 1 正常运行,2 停止(不再调度) + /** + * {@code 1} indicates that the worker node is running well, + * {@code 2} indicates that the worker node has been inactive + * and future tasks will not be assigned to the node. + */ private boolean enable = true; - /* ************************** 集群配置 ************************** */ - // 指定机器运行,空代表不限,非空则只会使用其中的机器运行(多值逗号分割) + /* ************************** PowerJob-worker cluster property ************************** */ + /** + * Designated PowerJob-worker nodes. Blank value indicates that there is + * no limit. Non-blank value means to run the corresponding machine(s) only. + */ private String designatedWorkers; - // 最大机器数量 + /** + * Max count of PowerJob-worker nodes. + */ private Integer maxWorkerCount = 0; - // 报警用户ID列表 + /** + * The id list of the users that need to be notified. + */ private List notifyUserIds; + /** + * Check non-null properties. + */ public void valid() { CommonUtils.requireNonNull(jobName, "jobName can't be empty"); CommonUtils.requireNonNull(appId, "appId can't be empty"); From 2da5fc624b41d2a21240d7e573990ad51acebc44 Mon Sep 17 00:00:00 2001 From: jiangjining Date: Fri, 8 Jan 2021 22:49:36 +0800 Subject: [PATCH 10/19] docs: Modify instance detail model. --- .../powerjob/common/model/InstanceDetail.java | 23 ++++++++++--------- .../powerjob/common/model/SystemMetrics.java | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/InstanceDetail.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/InstanceDetail.java index 90f12886..b14ab3dc 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/InstanceDetail.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/InstanceDetail.java @@ -7,7 +7,7 @@ import lombok.NoArgsConstructor; import java.util.List; /** - * 任务实例的运行详细信息 + * Detailed info of task instances. * * @author tjq * @since 2020/4/11 @@ -24,7 +24,6 @@ public class InstanceDetail implements OmsSerializable { * Actual trigger time of an instance. */ private Long actualTriggerTime; - // 任务整体结束时间(可能不存在) /** * Finish time of an instance, which may be null. */ @@ -49,30 +48,30 @@ public class InstanceDetail implements OmsSerializable { */ private String instanceParams; - // MR或BD任务专用 /** * Task detail, used by MapReduce or Broadcast tasks. */ private TaskDetail taskDetail; - // 秒级任务专用 /** - * + * Sub instance details, used by frequent tasks. */ private List subInstanceDetails; - // 重试次数 /** - * + * Running times. */ private Long runningTimes; - // 扩展字段,中间件升级不易,最好不要再改 common 包了...否则 server worker 版本不兼容 /** - * Extend + * Extended fields. Middlewares are not supposed to update frequently. + * Changes in PowerJob-common may lead to incompatible versions. + * PowerJob-common packages should not be modified if not necessary. */ private String extra; - // 秒级任务的 extra -> List + /** + * Extra info for frequent tasks, return List. + */ @Data @NoArgsConstructor public static class SubInstanceDetail implements OmsSerializable { @@ -83,7 +82,9 @@ public class InstanceDetail implements OmsSerializable { private int status; } - // MapReduce 和 Broadcast 任务的 extra -> + /** + * Extra info of {@code MapReduce} or {@code Broadcast} type of tasks. + */ @Data @NoArgsConstructor public static class TaskDetail implements OmsSerializable { diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/SystemMetrics.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/SystemMetrics.java index 7d053bbe..c90534f4 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/SystemMetrics.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/SystemMetrics.java @@ -4,7 +4,7 @@ import com.github.kfcfans.powerjob.common.OmsSerializable; import lombok.Data; /** - * Class for system metrics . + * Class for system metrics. * * @author tjq * @since 2020/3/25 From b97c26c78b306bddc7efb767604e520e55d08bea Mon Sep 17 00:00:00 2001 From: tjq Date: Sun, 10 Jan 2021 11:20:13 +0800 Subject: [PATCH 11/19] docs: translate for OhMyClient --- .../kfcfans/powerjob/client/OhMyClient.java | 187 ++++++++---------- .../powerjob/common/InstanceStatus.java | 2 +- .../common/response/InstanceInfoDTO.java | 2 +- .../powerjob/common/response/ResultDTO.java | 4 +- 4 files changed, 89 insertions(+), 106 deletions(-) diff --git a/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/OhMyClient.java b/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/OhMyClient.java index 9a8a980e..aac051cf 100644 --- a/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/OhMyClient.java +++ b/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/OhMyClient.java @@ -41,8 +41,9 @@ public class OhMyClient { /** * Init OhMyClient with domain, appName and password. - * @param domain 比如 www.powerjob-server.com(内网域名,自行完成 DNS & Proxy) + * @param domain like powerjob-server.apple-inc.com (Intranet Domain) * @param appName name of the application + * @param password password of the application */ public OhMyClient(String domain, String appName, String password) { this(Lists.newArrayList(domain), appName, password); @@ -50,9 +51,10 @@ public class OhMyClient { /** - * nit OhMyClient with server address, appName and password. - * @param addressList IP:Port address list + * Init OhMyClient with server address, appName and password. + * @param addressList IP:Port address list, like 192.168.1.1:7700 * @param appName name of the application + * @param password password of the application */ public OhMyClient(List addressList, String appName, String password) { @@ -79,7 +81,7 @@ public class OhMyClient { } if (StringUtils.isEmpty(currentAddress)) { - throw new PowerJobException("no server available"); + throw new PowerJobException("no server available for OhMyClient"); } log.info("[OhMyClient] {}'s OhMyClient bootstrap successfully, using server: {}", appName, currentAddress); } @@ -101,12 +103,12 @@ public class OhMyClient { /* ************* Job 区 ************* */ /** - * 保存任务(包括创建与修改) - * @param request 任务详细参数 - * @return 创建的任务ID - * @throws PowerJobException 异常 + * Save one Job + * When an ID exists in SaveJobInfoRequest, it is an update operation. Otherwise, it is a crate operation. + * @param request Job meta info + * @return jobId */ - public ResultDTO saveJob(SaveJobInfoRequest request) throws PowerJobException { + public ResultDTO saveJob(SaveJobInfoRequest request) { request.setAppId(appId); MediaType jsonType = MediaType.parse("application/json; charset=utf-8"); @@ -116,12 +118,11 @@ public class OhMyClient { } /** - * 根据 jobId 查询任务信息 - * @param jobId 任务ID - * @return 任务详细信息 - * @throws PowerJobException 异常 + * Query JobInfo by jobId + * @param jobId jobId + * @return Job meta info */ - public ResultDTO fetchJob(Long jobId) throws PowerJobException { + public ResultDTO fetchJob(Long jobId) { RequestBody body = new FormBody.Builder() .add("jobId", jobId.toString()) .add("appId", appId.toString()) @@ -131,12 +132,11 @@ public class OhMyClient { } /** - * 禁用某个任务 - * @param jobId 任务ID - * @return 标准返回对象 - * @throws PowerJobException 异常 + * Disable one Job by jobId + * @param jobId jobId + * @return Standard return object */ - public ResultDTO disableJob(Long jobId) throws PowerJobException { + public ResultDTO disableJob(Long jobId) { RequestBody body = new FormBody.Builder() .add("jobId", jobId.toString()) .add("appId", appId.toString()) @@ -146,12 +146,11 @@ public class OhMyClient { } /** - * 启用某个任务 - * @param jobId 任务ID - * @return 标准返回对象 - * @throws PowerJobException 异常 + * Enable one job by jobId + * @param jobId jobId + * @return Standard return object */ - public ResultDTO enableJob(Long jobId) throws PowerJobException { + public ResultDTO enableJob(Long jobId) { RequestBody body = new FormBody.Builder() .add("jobId", jobId.toString()) .add("appId", appId.toString()) @@ -161,12 +160,11 @@ public class OhMyClient { } /** - * 删除某个任务 - * @param jobId 任务ID - * @return 标准返回对象 - * @throws PowerJobException 异常 + * Delete one job by jobId + * @param jobId jobId + * @return Standard return object */ - public ResultDTO deleteJob(Long jobId) throws PowerJobException { + public ResultDTO deleteJob(Long jobId) { RequestBody body = new FormBody.Builder() .add("jobId", jobId.toString()) .add("appId", appId.toString()) @@ -176,14 +174,13 @@ public class OhMyClient { } /** - * 运行某个任务 - * @param jobId 任务ID - * @param instanceParams 任务实例的参数 - * @param delayMS 延迟时间,单位毫秒 - * @return 任务实例ID(instanceId) - * @throws PowerJobException 异常 + * Run a job once + * @param jobId ID of the job to be run + * @param instanceParams Runtime parameters of the job (TaskContext#instanceParams) + * @param delayMS Delay time(Milliseconds) + * @return instanceId */ - public ResultDTO runJob(Long jobId, String instanceParams, long delayMS) throws PowerJobException { + public ResultDTO runJob(Long jobId, String instanceParams, long delayMS) { FormBody.Builder builder = new FormBody.Builder() .add("jobId", jobId.toString()) .add("appId", appId.toString()) @@ -201,12 +198,11 @@ public class OhMyClient { /* ************* Instance API list ************* */ /** - * 停止应用实例 - * @param instanceId 应用实例ID - * @return true 停止成功,false 停止失败 - * @throws PowerJobException 异常 + * Stop one job instance + * @param instanceId instanceId + * @return Standard return object */ - public ResultDTO stopInstance(Long instanceId) throws PowerJobException { + public ResultDTO stopInstance(Long instanceId) { RequestBody body = new FormBody.Builder() .add("instanceId", instanceId.toString()) .add("appId", appId.toString()) @@ -216,13 +212,12 @@ public class OhMyClient { } /** - * 取消任务实例 - * 接口使用条件:调用接口时间与待取消任务的预计执行时间有一定时间间隔,否则不保证可靠性! - * @param instanceId 任务实例ID - * @return true 代表取消成功,false 取消失败 - * @throws PowerJobException 异常 + * Cancel a job instance that is not yet running + * Notice:There is a time interval between the call interface time and the expected execution time of the job instance to be cancelled, otherwise reliability is not guaranteed + * @param instanceId instanceId + * @return Standard return object */ - public ResultDTO cancelInstance(Long instanceId) throws PowerJobException { + public ResultDTO cancelInstance(Long instanceId) { RequestBody body = new FormBody.Builder() .add("instanceId", instanceId.toString()) .add("appId", appId.toString()) @@ -232,13 +227,12 @@ public class OhMyClient { } /** - * 重试任务实例 - * 只有完成状态(成功、失败、手动停止、被取消)的任务才能被重试,且暂不支持工作流内任务实例的重试 - * @param instanceId 任务实例ID - * @return true 代表取消成功,false 取消失败 - * @throws PowerJobException 异常 + * Retry failed job instance + * Notice: Only job instance with completion status (success, failure, manually stopped, cancelled) can be retried, and retries of job instances within workflows are not supported yet. + * @param instanceId instanceId + * @return Standard return object */ - public ResultDTO retryInstance(Long instanceId) throws PowerJobException { + public ResultDTO retryInstance(Long instanceId) { RequestBody body = new FormBody.Builder() .add("instanceId", instanceId.toString()) .add("appId", appId.toString()) @@ -248,12 +242,11 @@ public class OhMyClient { } /** - * 查询任务实例状态 - * @param instanceId 应用实例ID - * @return {@link InstanceStatus} 的枚举值 - * @throws PowerJobException 异常 + * Query status about a job instance + * @param instanceId instanceId + * @return {@link InstanceStatus} */ - public ResultDTO fetchInstanceStatus(Long instanceId) throws PowerJobException { + public ResultDTO fetchInstanceStatus(Long instanceId) { RequestBody body = new FormBody.Builder() .add("instanceId", instanceId.toString()) .build(); @@ -262,12 +255,11 @@ public class OhMyClient { } /** - * 查询任务实例的信息 - * @param instanceId 任务实例ID - * @return 任务实例信息 - * @throws PowerJobException 潜在的异常 + * Query detail about a job instance + * @param instanceId instanceId + * @return instance detail */ - public ResultDTO fetchInstanceInfo(Long instanceId) throws PowerJobException { + public ResultDTO fetchInstanceInfo(Long instanceId) { RequestBody body = new FormBody.Builder() .add("instanceId", instanceId.toString()) .build(); @@ -277,12 +269,12 @@ public class OhMyClient { /* ************* Workflow API list ************* */ /** - * 保存工作流(包括创建和修改) - * @param request 创建/修改 Workflow 请求 - * @return 工作流ID - * @throws PowerJobException 异常 + * Save one workflow + * When an ID exists in SaveWorkflowRequest, it is an update operation. Otherwise, it is a crate operation. + * @param request Workflow meta info + * @return workflowId */ - public ResultDTO saveWorkflow(SaveWorkflowRequest request) throws PowerJobException { + public ResultDTO saveWorkflow(SaveWorkflowRequest request) { request.setAppId(appId); MediaType jsonType = MediaType.parse(OmsConstant.JSON_MEDIA_TYPE); // 中坑记录:用 FastJSON 序列化会导致 Server 接收时 pEWorkflowDAG 为 null,无语.jpg @@ -292,12 +284,11 @@ public class OhMyClient { } /** - * 根据 workflowId 查询工作流信息 + * Query Workflow by workflowId * @param workflowId workflowId - * @return 工作流信息 - * @throws PowerJobException 异常 + * @return Workflow meta info */ - public ResultDTO fetchWorkflow(Long workflowId) throws PowerJobException { + public ResultDTO fetchWorkflow(Long workflowId) { RequestBody body = new FormBody.Builder() .add("workflowId", workflowId.toString()) .add("appId", appId.toString()) @@ -307,12 +298,11 @@ public class OhMyClient { } /** - * 禁用某个工作流 - * @param workflowId 工作流ID - * @return 标准返回对象 - * @throws PowerJobException 异常 + * Disable Workflow by workflowId + * @param workflowId workflowId + * @return Standard return object */ - public ResultDTO disableWorkflow(Long workflowId) throws PowerJobException { + public ResultDTO disableWorkflow(Long workflowId) { RequestBody body = new FormBody.Builder() .add("workflowId", workflowId.toString()) .add("appId", appId.toString()) @@ -322,12 +312,11 @@ public class OhMyClient { } /** - * 启用某个工作流 + * Enable Workflow by workflowId * @param workflowId workflowId - * @return 标准返回对象 - * @throws PowerJobException 异常 + * @return Standard return object */ - public ResultDTO enableWorkflow(Long workflowId) throws PowerJobException { + public ResultDTO enableWorkflow(Long workflowId) { RequestBody body = new FormBody.Builder() .add("workflowId", workflowId.toString()) .add("appId", appId.toString()) @@ -337,12 +326,11 @@ public class OhMyClient { } /** - * 删除某个工作流 + * Delete Workflow by workflowId * @param workflowId workflowId - * @return 标准返回对象 - * @throws PowerJobException 异常 + * @return Standard return object */ - public ResultDTO deleteWorkflow(Long workflowId) throws PowerJobException { + public ResultDTO deleteWorkflow(Long workflowId) { RequestBody body = new FormBody.Builder() .add("workflowId", workflowId.toString()) .add("appId", appId.toString()) @@ -352,14 +340,13 @@ public class OhMyClient { } /** - * 运行工作流 - * @param workflowId 工作流ID - * @param initParams 启动参数 - * @param delayMS 延迟时间,单位毫秒 ms - * @return 工作流实例ID - * @throws PowerJobException 异常信息 + * Run a workflow once + * @param workflowId workflowId + * @param initParams workflow startup parameters + * @param delayMS Delay time(Milliseconds) + * @return workflow instanceId */ - public ResultDTO runWorkflow(Long workflowId, String initParams, long delayMS) throws PowerJobException { + public ResultDTO runWorkflow(Long workflowId, String initParams, long delayMS) { FormBody.Builder builder = new FormBody.Builder() .add("workflowId", workflowId.toString()) .add("appId", appId.toString()) @@ -376,10 +363,9 @@ public class OhMyClient { /* ************* Workflow Instance API list ************* */ /** - * 停止应用实例 - * @param wfInstanceId 工作流实例ID - * @return true 停止成功 ; false 停止失败 - * @throws PowerJobException 异常 + * Stop one workflow instance + * @param wfInstanceId workflow instanceId + * @return Standard return object */ public ResultDTO stopWorkflowInstance(Long wfInstanceId) throws PowerJobException { RequestBody body = new FormBody.Builder() @@ -391,12 +377,11 @@ public class OhMyClient { } /** - * 查询任务实例的信息 - * @param wfInstanceId 任务实例ID - * @return 任务实例信息 - * @throws PowerJobException 潜在的异常 + * Query detail about a workflow instance + * @param wfInstanceId workflow instanceId + * @return detail about a workflow */ - public ResultDTO fetchWorkflowInstanceInfo(Long wfInstanceId) throws PowerJobException { + public ResultDTO fetchWorkflowInstanceInfo(Long wfInstanceId) { RequestBody body = new FormBody.Builder() .add("wfInstanceId", wfInstanceId.toString()) .add("appId", appId.toString()) diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/InstanceStatus.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/InstanceStatus.java index 996ce997..c1d3da7b 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/InstanceStatus.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/InstanceStatus.java @@ -7,7 +7,7 @@ import lombok.Getter; import java.util.List; /** - * 任务运行状态 + * Status of the job instance * * @author tjq * @since 2020/3/17 diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/response/InstanceInfoDTO.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/response/InstanceInfoDTO.java index c95f25df..4d52b223 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/response/InstanceInfoDTO.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/response/InstanceInfoDTO.java @@ -6,7 +6,7 @@ import lombok.Data; import java.util.Date; /** - * instanceInfo 对外输出对象 + * instanceInfo Network transmission object * * @author tjq * @since 2020/5/14 diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/response/ResultDTO.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/response/ResultDTO.java index 9c7a2ec3..bfbcde87 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/response/ResultDTO.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/response/ResultDTO.java @@ -7,7 +7,7 @@ import lombok.ToString; import org.apache.commons.lang3.exception.ExceptionUtils; /** - * 请求返回的结果对象 + * The result object returned by the request * * @author tjq * @since 2020/3/30 @@ -18,9 +18,7 @@ import org.apache.commons.lang3.exception.ExceptionUtils; public class ResultDTO implements OmsSerializable { private boolean success; - // 数据(success为 true 时存在) private T data; - // 错误信息(success为 false 时存在) private String message; public static ResultDTO success(T data) { From 5feaf6106e8c0285e5b4fe59b4114330bf2cfef8 Mon Sep 17 00:00:00 2001 From: tjq Date: Sun, 10 Jan 2021 11:54:16 +0800 Subject: [PATCH 12/19] docs: review translation --- .../powerjob/common/ProcessorType.java | 6 ++-- .../powerjob/common/TimeExpressionType.java | 4 ++- .../common/model/DeployedContainerInfo.java | 4 +-- .../powerjob/common/model/InstanceDetail.java | 5 +--- .../powerjob/common/model/SystemMetrics.java | 29 +++++++++---------- .../request/http/SaveJobInfoRequest.java | 8 ++--- .../powerjob/server/OhMyApplication.java | 5 ++-- .../resources/application-daily.properties | 8 +++-- .../main/resources/application-pre.properties | 8 +++-- .../resources/application-product.properties | 8 +++-- powerjob-worker-agent/pom.xml | 1 + .../powerjob/worker/MainApplication.java | 4 +-- 12 files changed, 44 insertions(+), 46 deletions(-) diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/ProcessorType.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/ProcessorType.java index bb6d7ed9..63a0455a 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/ProcessorType.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/ProcessorType.java @@ -4,7 +4,7 @@ import lombok.AllArgsConstructor; import lombok.Getter; /** - * 处理器类型 + * Task Processor Type * * @author tjq * @since 2020/3/23 @@ -18,8 +18,8 @@ public enum ProcessorType { PYTHON(3, "Python脚本"), JAVA_CONTAINER(4, "Java容器"); - private int v; - private String des; + private final int v; + private final String des; public static ProcessorType of(int v) { for (ProcessorType type : values()) { diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/TimeExpressionType.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/TimeExpressionType.java index 0a8b7634..0d1f2378 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/TimeExpressionType.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/TimeExpressionType.java @@ -7,7 +7,7 @@ import lombok.Getter; import java.util.List; /** - * 时间表达式类型 + * Scheduling time strategies * * @author tjq * @since 2020/3/30 @@ -18,7 +18,9 @@ public enum TimeExpressionType { API(1), CRON(2), + // FIXED_RATE FIX_RATE(3), + // FIXED_DELAY FIX_DELAY(4), WORKFLOW(5); diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/DeployedContainerInfo.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/DeployedContainerInfo.java index 67e8deda..01cae3b4 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/DeployedContainerInfo.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/DeployedContainerInfo.java @@ -6,7 +6,7 @@ import lombok.Data; import lombok.NoArgsConstructor; /** - * The class for deployed container. + * Deployed Container Information * * @author tjq * @since 2020/5/18 @@ -29,7 +29,7 @@ public class DeployedContainerInfo implements OmsSerializable { */ private long deployedTime; /** - * Address of the server. Report is not required. + * No need to report to the server */ private String workerAddress; } diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/InstanceDetail.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/InstanceDetail.java index b14ab3dc..55fd57df 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/InstanceDetail.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/InstanceDetail.java @@ -7,7 +7,7 @@ import lombok.NoArgsConstructor; import java.util.List; /** - * Detailed info of task instances. + * Detailed info of job instances. * * @author tjq * @since 2020/4/11 @@ -32,17 +32,14 @@ public class InstanceDetail implements OmsSerializable { * Status of the task instance. */ private Integer status; - // 任务执行结果(可能不存在) /** * Execution result, which may be null. */ private String result; - // TaskTracker地址 /** * Task tracker address. */ private String taskTrackerAddress; - // 启动参数 /** * Param string that is passed to an instance when it is initialized. */ diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/SystemMetrics.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/SystemMetrics.java index c90534f4..6a065789 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/SystemMetrics.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/SystemMetrics.java @@ -71,20 +71,17 @@ public class SystemMetrics implements OmsSerializable, Comparable * @return score */ public int calculateScore() { - - if (score > 0) { - return score; - } - - // Memory is vital to TaskTracker, so we set the multiplier factor as 2. - double memScore = (jvmMaxMemory - jvmUsedMemory) * 2; - // Calculate the remaining load of CPU. Multiplier is set as 1. - double cpuScore = cpuProcessors - cpuLoad; - // Windows can not fetch CPU load, set cpuScore as 1. - if (cpuScore > cpuProcessors) { - cpuScore = 1; + if (score > 0) { + return score; + } + // Memory is vital to TaskTracker, so we set the multiplier factor as 2. + double memScore = (jvmMaxMemory - jvmUsedMemory) * 2; + // Calculate the remaining load of CPU. Multiplier is set as 1. + double cpuScore = cpuProcessors - cpuLoad; + // Windows can not fetch CPU load, set cpuScore as 1. + if (cpuScore > cpuProcessors) { + cpuScore = 1; } - score = (int) (memScore + cpuScore); return score; } @@ -93,8 +90,8 @@ public class SystemMetrics implements OmsSerializable, Comparable * Judge if the machine is available. * * @param minCPUCores Minimum available CPU cores. - * @param minMemorySpace 判断标准之最低可用内存 - * @param minDiskSpace Minimum disk space 判断标准之最低可用磁盘空间 + * @param minMemorySpace Minimum available memory size + * @param minDiskSpace Minimum disk space * @return {@code boolean} whether the machine is available. */ public boolean available(double minCPUCores, double minMemorySpace, double minDiskSpace) { @@ -106,8 +103,8 @@ public class SystemMetrics implements OmsSerializable, Comparable return false; } - // Negative number means being unable to fetch CPU info, return true. // 0 indicates the CPU is free, which is the optimal condition. + // Negative number means being unable to fetch CPU info, return true. if (cpuLoad <= 0 || minCPUCores <= 0) { return true; } diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/request/http/SaveJobInfoRequest.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/request/http/SaveJobInfoRequest.java index 2bc8435f..2f2e25a0 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/request/http/SaveJobInfoRequest.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/request/http/SaveJobInfoRequest.java @@ -18,7 +18,7 @@ import java.util.List; public class SaveJobInfoRequest { /** - * id of the job. set null to save or non-null to update the job. + * id of the job. set null to create or non-null to update the job. */ private Long id; /* ************************** Base info of related job. ************************** */ @@ -105,11 +105,6 @@ public class SaveJobInfoRequest { */ private double minDiskSpace = 0; - /** - * {@code 1} indicates that the worker node is running well, - * {@code 2} indicates that the worker node has been inactive - * and future tasks will not be assigned to the node. - */ private boolean enable = true; @@ -117,6 +112,7 @@ public class SaveJobInfoRequest { /** * Designated PowerJob-worker nodes. Blank value indicates that there is * no limit. Non-blank value means to run the corresponding machine(s) only. + * example: 192.168.1.1:27777,192.168.1.2:27777 */ private String designatedWorkers; /** diff --git a/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/OhMyApplication.java b/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/OhMyApplication.java index bbcc5c64..b73bf65a 100644 --- a/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/OhMyApplication.java +++ b/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/OhMyApplication.java @@ -7,7 +7,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.scheduling.annotation.EnableScheduling; /** - * SpringBoot entry. + * powerjob-server entry * * @author tjq * @since 2020/3/29 @@ -26,10 +26,9 @@ public class OhMyApplication { public static void main(String[] args) { - // Print tips before starting. pre(); - // Init ActorSystem + // Init ActorSystem first OhMyServer.init(); // Start SpringBoot application. diff --git a/powerjob-server/src/main/resources/application-daily.properties b/powerjob-server/src/main/resources/application-daily.properties index a0b1c299..bb286003 100644 --- a/powerjob-server/src/main/resources/application-daily.properties +++ b/powerjob-server/src/main/resources/application-daily.properties @@ -14,7 +14,8 @@ spring.datasource.core.hikari.minimum-idle=5 oms.mongodb.enable=true spring.data.mongodb.uri=mongodb+srv://zqq:No1Bug2Please3!@cluster0.wie54.gcp.mongodb.net/powerjob_daily?retryWrites=true&w=majority -####### Email properties(Comment out the mail properties if you do not have needs) ####### +####### Email properties(Non-core configuration properties) ####### +####### Delete the following code to disable the mail ####### spring.mail.host=smtp.163.com spring.mail.username=zqq@163.com spring.mail.password=GOFZPNARMVKCGONV @@ -22,7 +23,8 @@ spring.mail.properties.mail.smtp.auth=true spring.mail.properties.mail.smtp.starttls.enable=true spring.mail.properties.mail.smtp.starttls.required=true -####### DingTalk properties(Comment out the DingTalk properties if you do not have needs) ####### +####### DingTalk properties(Non-core configuration properties) ####### +####### Delete the following code to disable the DingTalk ####### oms.alarm.ding.app-key=dingauqwkvxxnqskknfv oms.alarm.ding.app-secret=XWrEPdAZMPgJeFtHuL0LH73LRj-74umF2_0BFcoXMfvnX0pCQvt0rpb1JOJU_HLl oms.alarm.ding.agent-id=847044348 @@ -35,6 +37,6 @@ oms.container.retention.remote=-1 ####### Cache properties ####### oms.instance.metadata.cache.size=1024 -####### Threshold in fetching server(0~100). 100 means full detection of server, in which ####### +####### Threshold in precise fetching server(0~100). 100 means full detection of server, in which ####### ####### split-brain could be avoided while performance overhead would increase. ####### oms.accurate.select.server.percentage = 50 \ No newline at end of file diff --git a/powerjob-server/src/main/resources/application-pre.properties b/powerjob-server/src/main/resources/application-pre.properties index f0f27100..c3ed2054 100644 --- a/powerjob-server/src/main/resources/application-pre.properties +++ b/powerjob-server/src/main/resources/application-pre.properties @@ -14,7 +14,8 @@ spring.datasource.core.hikari.minimum-idle=5 oms.mongodb.enable=true spring.data.mongodb.uri=mongodb://remotehost:27017/powerjob-pre -####### Email properties(Comment out the mail properties if you do not have needs) ####### +####### Email properties(Non-core configuration properties) ####### +####### Delete the following code to disable the mail ####### spring.mail.host=smtp.qq.com spring.mail.username=zqq spring.mail.password=qqz @@ -22,7 +23,8 @@ spring.mail.properties.mail.smtp.auth=true spring.mail.properties.mail.smtp.starttls.enable=true spring.mail.properties.mail.smtp.starttls.required=true -####### DingTalk properties(Comment out the DingTalk properties if you do not have needs) ####### +####### DingTalk properties(Non-core configuration properties) ####### +####### Delete the following code to disable the DingTalk ####### oms.alarm.ding.app-key=dingauqwkvxxnqskknfv oms.alarm.ding.app-secret=XWrEPdAZMPgJeFtHuL0LH73LRj-74umF2_0BFcoXMfvnX0pCQvt0rpb1JOJU_HLl oms.alarm.ding.agent-id=847044348 @@ -35,6 +37,6 @@ oms.container.retention.remote=-1 ####### Cache properties ####### oms.instance.metadata.cache.size=1024 -####### Threshold in fetching server(0~100). 100 means full detection of server, in which ####### +####### Threshold in precise fetching server(0~100). 100 means full detection of server, in which ####### ####### split-brain could be avoided while performance overhead would increase. ####### oms.accurate.select.server.percentage = 50 \ No newline at end of file diff --git a/powerjob-server/src/main/resources/application-product.properties b/powerjob-server/src/main/resources/application-product.properties index 8b6baad6..493a6abb 100644 --- a/powerjob-server/src/main/resources/application-product.properties +++ b/powerjob-server/src/main/resources/application-product.properties @@ -14,7 +14,8 @@ spring.datasource.core.hikari.minimum-idle=5 oms.mongodb.enable=true spring.data.mongodb.uri=mongodb://localhost:27017/powerjob-product -####### Email properties(Comment out the mail properties if you do not have needs) ####### +####### Email properties(Non-core configuration properties) ####### +####### Delete the following code to disable the mail ####### spring.mail.host=smtp.qq.com spring.mail.username=zqq spring.mail.password=qqz @@ -22,7 +23,8 @@ spring.mail.properties.mail.smtp.auth=true spring.mail.properties.mail.smtp.starttls.enable=true spring.mail.properties.mail.smtp.starttls.required=true -####### DingTalk properties(Comment out the DingTalk properties if you do not have needs) ####### +####### DingTalk properties(Non-core configuration properties) ####### +####### Delete the following code to disable the DingTalk ####### oms.alarm.ding.app-key= oms.alarm.ding.app-secret= oms.alarm.ding.agent-id= @@ -35,6 +37,6 @@ oms.container.retention.remote=-1 ####### Cache properties ####### oms.instance.metadata.cache.size=2048 -####### Threshold in fetching server(0~100). 100 means full detection of server, in which ####### +####### Threshold in precise fetching server(0~100). 100 means full detection of server, in which ####### ####### split-brain could be avoided while performance overhead would increase. ####### oms.accurate.select.server.percentage = 50 \ No newline at end of file diff --git a/powerjob-worker-agent/pom.xml b/powerjob-worker-agent/pom.xml index 4761e8b2..49575f6a 100644 --- a/powerjob-worker-agent/pom.xml +++ b/powerjob-worker-agent/pom.xml @@ -50,6 +50,7 @@ + diff --git a/powerjob-worker-agent/src/main/java/com/github/kfcfans/powerjob/worker/MainApplication.java b/powerjob-worker-agent/src/main/java/com/github/kfcfans/powerjob/worker/MainApplication.java index ec5d3054..caebd148 100644 --- a/powerjob-worker-agent/src/main/java/com/github/kfcfans/powerjob/worker/MainApplication.java +++ b/powerjob-worker-agent/src/main/java/com/github/kfcfans/powerjob/worker/MainApplication.java @@ -11,13 +11,13 @@ import picocli.CommandLine.Command; import picocli.CommandLine.Option; /** - * 启动类 + * powerjob-worker-agent entry * * @author tjq * @since 2020/5/20 */ @Slf4j -@Command(name = "OhMyAgent", mixinStandardHelpOptions = true, version = "1.2.0", description = "OhMyScheduler-Worker agent") +@Command(name = "OhMyAgent", mixinStandardHelpOptions = true, version = "3.4.3", description = "powerjob-worker agent") public class MainApplication implements Runnable { @Option(names = {"-a", "--app"}, description = "worker-agent's name", required = true) From f34f9039471a1850d55613e26e90f383fec52d96 Mon Sep 17 00:00:00 2001 From: tjq Date: Sun, 10 Jan 2021 12:04:23 +0800 Subject: [PATCH 13/19] docs: translate OhMyConfig --- .../autoconfigure/PowerJobProperties.java | 4 +-- .../powerjob/worker/common/OhMyConfig.java | 32 +++++++++++-------- .../common/constants/StoreStrategy.java | 4 ++- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobProperties.java b/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobProperties.java index e8dd2d07..358dc55e 100644 --- a/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobProperties.java +++ b/powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobProperties.java @@ -130,9 +130,7 @@ public class PowerJobProperties { private int maxResultLength = 8096; /** * If test mode is set as true, Powerjob-worker no longer connects to the server or validates appName. - * Test mode is used for conditions that your worker does not need to run the codes, i.e. when you - * write junit tests in local environment. {@code true} means test mode is enabled. {@code false} means - * normal mode is applied. + * Test mode is used for conditions that your have no powerjob-server in your develop env so you can't startup the application */ private boolean enableTestMode = false; } diff --git a/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/common/OhMyConfig.java b/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/common/OhMyConfig.java index 16c83f25..b1007279 100644 --- a/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/common/OhMyConfig.java +++ b/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/common/OhMyConfig.java @@ -10,7 +10,7 @@ import lombok.Setter; import java.util.List; /** - * Worker 配置文件 + * The powerjob-worker's configuration * * @author tjq * @since 2020/3/16 @@ -19,34 +19,38 @@ import java.util.List; @Setter public class OhMyConfig { /** - * 应用名称 + * AppName, recommend to use the name of this project + * Applications should be registered by powerjob-console in advance to prevent error. */ private String appName; /** - * 启动端口 + * Worker port + * Random port is enabled when port is set with non-positive number. */ private int port = RemoteConstant.DEFAULT_WORKER_PORT; /** - * 调度服务器地址,ip:port 或 域名 + * Address of powerjob-server node(s) + * Do not mistake for ActorSystem port. Do not add any prefix, i.e. http://. */ private List serverAddress = Lists.newArrayList(); /** - * 本地持久化方式,默认使用磁盘 - */ - private StoreStrategy storeStrategy = StoreStrategy.DISK; - /** - * 最大返回值长度,超过会被截断 - * {@link ProcessResult}#msg 的最大长度 + * Max length of response result. Result that is longer than the value will be truncated. + * {@link ProcessResult} max length for #msg */ private int maxResultLength = 8096; /** - * 用户自定义上下文对象,该值会被透传到 TaskContext#userContext 属性 - * 使用场景:容器脚本Java处理器需要使用oms-worker宿主应用的Spring Bean,可在此处传入 ApplicationContext,在Processor中获取 bean + * User-defined context object, which is passed through to the TaskContext#userContext property + * Usage Scenarios: The container Java processor needs to use the Spring bean of the host application, where you can pass in the ApplicationContext and get the bean in the Processor */ private Object userContext; /** - * 启动测试模式,true情况下,不再尝试连接 server 并验证appName - * true -> 用于本地写单元测试调试; false -> 默认值,标准模式 + * Internal persistence method, DISK or MEMORY + * Normally you don't need to care about this configuration + */ + private StoreStrategy storeStrategy = StoreStrategy.DISK; + /** + * If test mode is set as true, Powerjob-worker no longer connects to the server or validates appName. + * Test mode is used for conditions that your have no powerjob-server in your develop env so you can't startup the application */ private boolean enableTestMode = false; } diff --git a/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/common/constants/StoreStrategy.java b/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/common/constants/StoreStrategy.java index aaaa669f..08d30fe3 100644 --- a/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/common/constants/StoreStrategy.java +++ b/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/common/constants/StoreStrategy.java @@ -1,6 +1,7 @@ package com.github.kfcfans.powerjob.worker.common.constants; import lombok.AllArgsConstructor; +import lombok.Getter; /** * 持久化策略 @@ -8,11 +9,12 @@ import lombok.AllArgsConstructor; * @author tjq * @since 2020/4/14 */ +@Getter @AllArgsConstructor public enum StoreStrategy { DISK("磁盘"), MEMORY("内存"); - private String des; + private final String des; } From 5f3827b8e7fb9606e9a33871d2e2fd696cd55199 Mon Sep 17 00:00:00 2001 From: tjq Date: Sun, 10 Jan 2021 16:32:03 +0800 Subject: [PATCH 14/19] docs: optimize readme --- README.md | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 5c25514f..461b58b4 100644 --- a/README.md +++ b/README.md @@ -12,31 +12,30 @@ English | [简体中文](./README_zhCN.md)

- Have you ever wondered how cron jobs could be organized orderly? -- Have you ever felt upset when scheduling tasks suddenly terminated without any warning? -- Have you ever felt helpless when batches of business tasks require handling? -- Have you ever felt depressed about tasks that carry with complex dependencies? +- Have you ever felt upset about tasks that carry with complex dependencies? +- Have you ever felt helpless when scheduling tasks suddenly terminated without any warning? +- Have you ever felt depressed when batches of business tasks need to be processed in a distributed manner? Well, PowerJob is there for you, it is the choice of a new generation. It is a powerful, business-oriented scheduling framework that provides distributed computing ability. Based on Akka architecture, it makes everything with scheduling easier. Just with several steps, PowerJob could be deployed and work for you! # Introduction ### Features -- Simple to use: PowerJob provides a friendly front-end Web that allows developers to visually manage tasks (Create, Read, Update and Delete), monitor tasks, and view logs online. +- Simple to use: PowerJob provides a friendly front-end Web that allows developers to visually manage tasks, monitor tasks, and view logs online. - Complete timing strategy: PowerJob supports four different scheduling strategies, including CRON expression, fixed frequency timing, fixed delay timing as well as the Open API. -- Various execution modes: PowerJob supports four execution modes: stand-alone, broadcast, Map, and MapReduce. It's worth mentioning the Map and MapReduce modes. With several lines of codes, developers could take full advantage of PowerJob's distributed computing ability. -- Complete workflow support. PowerJob supports DAG(Directed acyclic graph) based online task configuration. Developers could arrange tasks on the console, while data could be transferred among tasks on the flow. +- Various execution modes: PowerJob supports four execution modes: stand-alone, broadcast, Map, and MapReduce. **It's worth mentioning the Map and MapReduce modes. With several lines of codes, developers could take full advantage of PowerJob's distributed computing ability**. +- Complete workflow support: PowerJob supports DAG(Directed acyclic graph) based online task configuration. Developers could arrange tasks on the console, while data could be transferred among tasks on the flow. - Extensive executor support: PowerJob supports multiple processors, including Spring Beans, ordinary Java objects, Shell, Python and so on. -- Simple in dependency: PowerJob aims to be simple in dependency. The only dependency is merely database (MySQL / Oracle / MS SQLServer ...), with MongoDB being the extra dependency for storing large log files online. +- Simple in dependency: PowerJob aims to be simple in dependency. The only dependency is merely database (MySQL / Oracle / MS SQLServer ...), with MongoDB being the extra dependency for storing large log files. - High availability and performance: Unlike traditional job-scheduling frameworks that rely on database locks, PowerJob server is lock-free. PowerJob supports unlimited horizontal expansion. It's easy to achieve high availability and performance by deploying as many PowerJob server instances as you need. - Quick failover and recovery support: Whenever any task failed, PowerJob server would retry according to the configured strategy. As long as there were enough nodes in the cluster, the failed tasks could execute successfully finally. -- Convenient to run and maintain: PowerJob supports online logging. Logs generated by the worker would be transferred and displayed on the console instantly, therefore reducing the cost of debugging and improving the efficiency significantly. ### Applicable scenes - Scenarios with timed tasks: such as full synchronization of data at midnight, generating business reports at desired time. - Scenarios that require all machines to run tasks simultaneously: such as log cleanup. - Scenarios that require distributed processing: For example, a large amount of data requires updating, while the stand-alone execution takes quite a lot of time. The Map/MapReduce mode could be applied in which the workers would join the cluster for PowerJob server to dispatch, to speed up the time-consuming process, therefore improving the computing ability of the whole cluster. -- Scenarios with delayed tasks: For instance, disposal of overdue orders. +- **Scenarios with delayed tasks**: For instance, disposal of overdue orders. ### Design goals @@ -51,17 +50,17 @@ Application password: 123 ### Comparison with similar products -| | QuartZ | xxl-job | SchedulerX 2.0 | PowerJob | -| ---------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| Timing type | CRON | CRON | CRON, fixed frequency, fixed delay, OpenAPI | **CRON, fixed frequency, fixed delay, OpenAPI** | -| Task type | Built-in Java | Built-in Java, GLUE Java, Shell, Python and other scripts | Built-in Java, external Java (FatJar), Shell, Python and other scripts | **Built-in Java, external Java (container), Shell, Python and other scripts** | -| Distributed strategy | Unsupported | Static sharding | MapReduce dynamic sharding | **MapReduce dynamic sharding** | -| Online task management | Unsupported | Supported | Supported | **Supported** | -| Online logging | Unsupported | Supported | Unsupported | **Supported** | -| Scheduling methods and performance | Based on database lock, there is a performance bottleneck | Based on database lock, there is a performance bottleneck | Unknown | **Lock-free design, high performance without upper limit** | -| Alarm monitoring | Unsupported | Email | SMS | **Email, WebHook, DingTalk. An interface is provided for customization.** | -| System dependence | Any relational database (MySQL, Oracle ...) supported by JDBC | MySQL | RMB (Public Beta version for free, hey, helping to promote) | **Any relational database (MySQL, Oracle ...) supported by Spring Data Jpa** | -| workflow | Unsupported | Unsupported | Supported | **Supported** | +| | QuartZ | PowerJob | +| ---------------------------------- | --------------------------------------------------------- | ------------------------------------------------------------ | +| Timing type | CRON | **CRON, fixed frequency, fixed delay, OpenAPI** | +| Task type | Built-in Java | **Built-in Java, external Java (JVM Container), Shell, Python and other scripts** | +| Distributed strategy | Unsupported | **MapReduce dynamic sharding** | +| Online task management | Unsupported | **Supported** | +| Online logging | Unsupported | **Supported** | +| Scheduling methods and performance | Based on database lock, there is a performance bottleneck | **Lock-free design, high performance without upper limit** | +| Alarm monitoring | Unsupported | **Email, WebHook, DingTalk. An interface is provided for customization.** | +| System dependence | Any relational database (MySQL, Oracle ...) supported by JDBC | **Any relational database (MySQL, Oracle ...) supported by Spring Data Jpa** | +| workflow | Unsupported | **Supported** | # Document **[Docs](https://www.yuque.com/powerjob/en/introduce)** @@ -77,9 +76,8 @@ Application password: 123 # Others - -- PowerJob is permanently open source software(Apache License, Version 2.0), please feel free to try, deploy and put into production! -- Author of PowerJob (@KFCFans) has abundant time for maintenance, and is willing to provide technical support if you have needs! +- Welcome to the Gitter Community: [LINK](https://gitter.im/PowerJob/community) +- PowerJob is permanently open source software(Apache License, Version 2.0), please feel free to try, deploy and put into production! - Welcome to contribute to PowerJob, both Pull Requests and Issues are precious. - Please STAR PowerJob if it is valuable. ~ =  ̄ω ̄ = - Do you need any help or want to propose suggestions? Please raise Github issues or contact the Author @KFCFans-> `tengjiqi@gmail.com` directly. \ No newline at end of file From 374bae9fc1e2c009b0d12f643da6694e7a6bc78f Mon Sep 17 00:00:00 2001 From: tjq Date: Sun, 10 Jan 2021 17:36:40 +0800 Subject: [PATCH 15/19] feat: change pom version to 3.4.3 and ready to release --- powerjob-client/pom.xml | 4 ++-- powerjob-common/pom.xml | 2 +- powerjob-server/pom.xml | 4 ++-- powerjob-server/src/main/resources/static/js/5.js | 2 +- powerjob-server/src/main/resources/static/js/app.js | 2 +- powerjob-worker-agent/pom.xml | 4 ++-- powerjob-worker-samples/pom.xml | 4 ++-- powerjob-worker-spring-boot-starter/pom.xml | 4 ++-- powerjob-worker/pom.xml | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/powerjob-client/pom.xml b/powerjob-client/pom.xml index 71f1c2ba..4b2b8795 100644 --- a/powerjob-client/pom.xml +++ b/powerjob-client/pom.xml @@ -10,13 +10,13 @@ 4.0.0 powerjob-client - 3.4.2 + 3.4.3 jar 5.6.1 1.2.68 - 3.4.2 + 3.4.3 3.2.4 diff --git a/powerjob-common/pom.xml b/powerjob-common/pom.xml index 22125af3..a5dce3e0 100644 --- a/powerjob-common/pom.xml +++ b/powerjob-common/pom.xml @@ -10,7 +10,7 @@ 4.0.0 powerjob-common - 3.4.2 + 3.4.3 jar diff --git a/powerjob-server/pom.xml b/powerjob-server/pom.xml index 46956b5a..870ab105 100644 --- a/powerjob-server/pom.xml +++ b/powerjob-server/pom.xml @@ -10,13 +10,13 @@ 4.0.0 powerjob-server - 3.4.2 + 3.4.3 jar 2.9.2 2.3.4.RELEASE - 3.4.2 + 3.4.3 8.0.19 19.7.0.0 diff --git a/powerjob-server/src/main/resources/static/js/5.js b/powerjob-server/src/main/resources/static/js/5.js index 864d2712..178fa996 100644 --- a/powerjob-server/src/main/resources/static/js/5.js +++ b/powerjob-server/src/main/resources/static/js/5.js @@ -20,7 +20,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n//\n//\n//\n//\n//\n//\n//\n/ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n { attrs: { id: \"home\" } },\n [\n _c(\n \"el-row\",\n { attrs: { gutter: 24 } },\n [\n _c(\n \"el-col\",\n { attrs: { span: 6 } },\n [\n _c(\n \"el-card\",\n {\n staticStyle: { \"text-align\": \"center\" },\n attrs: { shadow: \"always\" }\n },\n [\n _c(\"div\", [\n _vm._v(\" \" + _vm._s(_vm.$t(\"message.appName\")) + \" \")\n ]),\n _c(\"div\", [\n _vm._v(\n \" \" + _vm._s(this.$store.state.appInfo.appName) + \" \"\n )\n ])\n ]\n )\n ],\n 1\n ),\n _c(\n \"el-col\",\n { attrs: { span: 6 } },\n [\n _c(\n \"el-card\",\n {\n staticStyle: { \"text-align\": \"center\" },\n attrs: { shadow: \"always\" }\n },\n [\n _c(\"div\", [\n _c(\n \"a\",\n {\n attrs: {\n href: \"https://github.com/KFCFans/PowerJob\",\n target: \"_blank\"\n }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.githubURL\")))]\n )\n ]),\n _c(\"div\", [\n _c(\n \"a\",\n {\n attrs: {\n href: \"https://github.com/KFCFans/PowerJob/wiki\",\n target: \"_blank\"\n }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.docURL\")))]\n )\n ])\n ]\n )\n ],\n 1\n ),\n _c(\n \"el-col\",\n { attrs: { span: 6 } },\n [\n _c(\"el-card\", { attrs: { shadow: \"always\" } }, [\n _c(\"div\", [\n _vm._v(\n \" \" +\n _vm._s(_vm.$t(\"message.omsServerTimezone\")) +\n \":\" +\n _vm._s(_vm.systemInfo.timezone) +\n \" \"\n )\n ]),\n _c(\"div\", [\n _vm._v(\n \" \" +\n _vm._s(_vm.$t(\"message.omsServerTime\")) +\n \":\" +\n _vm._s(_vm.systemInfo.serverTime) +\n \" \"\n )\n ])\n ])\n ],\n 1\n ),\n _c(\n \"el-col\",\n { attrs: { span: 6 } },\n [\n _c(\"el-card\", { attrs: { shadow: \"always\" } }, [\n _c(\"div\", [\n _vm._v(\n \" \" +\n _vm._s(_vm.$t(\"message.localBrowserTimezone\")) +\n \":\" +\n _vm._s(Intl.DateTimeFormat().resolvedOptions().timeZone) +\n \" \"\n )\n ]),\n _c(\"div\", [\n _vm._v(\n \" \" +\n _vm._s(_vm.$t(\"message.localBrowserTime\")) +\n \":\" +\n _vm._s(this.common.timestamp2Str(new Date().getTime())) +\n \" \"\n )\n ])\n ])\n ],\n 1\n )\n ],\n 1\n ),\n _c(\n \"el-row\",\n { attrs: { gutter: 24 } },\n [\n _c(\"el-col\", { attrs: { span: 6 } }, [\n _c(\"div\", { staticClass: \"wrap\" }, [\n _c(\"div\", { staticClass: \"grid-content bg-purple\" }, [\n _c(\"div\", { staticClass: \"text mTitle\" }, [\n _vm._v(_vm._s(_vm.$t(\"message.totalJobNum\")))\n ]),\n _c(\"div\", { staticClass: \"text mText\" }, [\n _vm._v(_vm._s(_vm.systemInfo.jobCount))\n ])\n ]),\n _c(\"i\", { staticClass: \"el-icon-orange\" })\n ])\n ]),\n _c(\"el-col\", { attrs: { span: 6 } }, [\n _c(\"div\", { staticClass: \"wrap\" }, [\n _c(\"div\", { staticClass: \"grid-content bg-purple\" }, [\n _c(\"div\", { staticClass: \"text mTitle\" }, [\n _vm._v(_vm._s(_vm.$t(\"message.runningInstanceNum\")))\n ]),\n _c(\"div\", { staticClass: \"text\" }, [\n _vm._v(_vm._s(_vm.systemInfo.runningInstanceCount))\n ])\n ]),\n _c(\"i\", { staticClass: \"el-icon-timer\" })\n ])\n ]),\n _c(\"el-col\", { attrs: { span: 6 } }, [\n _c(\"div\", { staticClass: \"wrap\" }, [\n _c(\"div\", { staticClass: \"grid-content bg-purple\" }, [\n _c(\"div\", { staticClass: \"text mTitle\" }, [\n _vm._v(_vm._s(_vm.$t(\"message.recentFailedInstanceNum\")))\n ]),\n _c(\"div\", { staticClass: \"text\" }, [\n _vm._v(_vm._s(_vm.systemInfo.failedInstanceCount))\n ])\n ]),\n _c(\"i\", { staticClass: \"el-icon-bell\" })\n ])\n ]),\n _c(\"el-col\", { attrs: { span: 6 } }, [\n _c(\"div\", { staticClass: \"wrap\" }, [\n _c(\"div\", { staticClass: \"grid-content bg-purple\" }, [\n _c(\"div\", { staticClass: \"text mTitle\" }, [\n _vm._v(_vm._s(_vm.$t(\"message.workerNum\")))\n ]),\n _c(\"div\", { staticClass: \"text\" }, [\n _vm._v(_vm._s(_vm.activeWorkerCount))\n ])\n ]),\n _c(\"i\", { staticClass: \"el-icon-cpu\" })\n ])\n ])\n ],\n 1\n ),\n _c(\n \"el-row\",\n [\n _c(\n \"el-col\",\n { attrs: { span: 24 } },\n [\n _c(\n \"el-table\",\n {\n staticStyle: { width: \"100%\" },\n attrs: {\n data: _vm.workerList,\n height: \"400px\",\n \"row-class-name\": _vm.workerTableRowClassName\n }\n },\n [\n _c(\"el-table-column\", {\n attrs: {\n prop: \"address\",\n label: _vm.$t(\"message.workerAddress\")\n }\n }),\n _c(\"el-table-column\", {\n attrs: { prop: \"cpuLoad\", label: _vm.$t(\"message.cpuLoad\") }\n }),\n _c(\"el-table-column\", {\n attrs: {\n prop: \"memoryLoad\",\n label: _vm.$t(\"message.memoryLoad\")\n }\n }),\n _c(\"el-table-column\", {\n attrs: {\n prop: \"diskLoad\",\n label: _vm.$t(\"message.diskLoad\")\n }\n })\n ],\n 1\n )\n ],\n 1\n )\n ],\n 1\n )\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./src/components/views/Home.vue?./node_modules/cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%22f7b44cbc-vue-loader-template%22%7D!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n { attrs: { id: \"home\" } },\n [\n _c(\n \"el-row\",\n { attrs: { gutter: 24 } },\n [\n _c(\n \"el-col\",\n { attrs: { span: 6 } },\n [\n _c(\n \"el-card\",\n {\n staticStyle: { \"text-align\": \"center\" },\n attrs: { shadow: \"always\" }\n },\n [\n _c(\"div\", [\n _vm._v(\" \" + _vm._s(_vm.$t(\"message.appName\")) + \" \")\n ]),\n _c(\"div\", [\n _vm._v(\n \" \" + _vm._s(this.$store.state.appInfo.appName) + \" \"\n )\n ])\n ]\n )\n ],\n 1\n ),\n _c(\n \"el-col\",\n { attrs: { span: 6 } },\n [\n _c(\n \"el-card\",\n {\n staticStyle: { \"text-align\": \"center\" },\n attrs: { shadow: \"always\" }\n },\n [\n _c(\"div\", [\n _c(\n \"a\",\n {\n attrs: {\n href: \"https://github.com/PowerJob/PowerJob\",\n target: \"_blank\"\n }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.githubURL\")))]\n )\n ]),\n _c(\"div\", [\n _c(\n \"a\",\n {\n attrs: {\n href: \"https://github.com/PowerJob/PowerJob/wiki\",\n target: \"_blank\"\n }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.docURL\")))]\n )\n ])\n ]\n )\n ],\n 1\n ),\n _c(\n \"el-col\",\n { attrs: { span: 6 } },\n [\n _c(\"el-card\", { attrs: { shadow: \"always\" } }, [\n _c(\"div\", [\n _vm._v(\n \" \" +\n _vm._s(_vm.$t(\"message.omsServerTimezone\")) +\n \":\" +\n _vm._s(_vm.systemInfo.timezone) +\n \" \"\n )\n ]),\n _c(\"div\", [\n _vm._v(\n \" \" +\n _vm._s(_vm.$t(\"message.omsServerTime\")) +\n \":\" +\n _vm._s(_vm.systemInfo.serverTime) +\n \" \"\n )\n ])\n ])\n ],\n 1\n ),\n _c(\n \"el-col\",\n { attrs: { span: 6 } },\n [\n _c(\"el-card\", { attrs: { shadow: \"always\" } }, [\n _c(\"div\", [\n _vm._v(\n \" \" +\n _vm._s(_vm.$t(\"message.localBrowserTimezone\")) +\n \":\" +\n _vm._s(Intl.DateTimeFormat().resolvedOptions().timeZone) +\n \" \"\n )\n ]),\n _c(\"div\", [\n _vm._v(\n \" \" +\n _vm._s(_vm.$t(\"message.localBrowserTime\")) +\n \":\" +\n _vm._s(this.common.timestamp2Str(new Date().getTime())) +\n \" \"\n )\n ])\n ])\n ],\n 1\n )\n ],\n 1\n ),\n _c(\n \"el-row\",\n { attrs: { gutter: 24 } },\n [\n _c(\"el-col\", { attrs: { span: 6 } }, [\n _c(\"div\", { staticClass: \"wrap\" }, [\n _c(\"div\", { staticClass: \"grid-content bg-purple\" }, [\n _c(\"div\", { staticClass: \"text mTitle\" }, [\n _vm._v(_vm._s(_vm.$t(\"message.totalJobNum\")))\n ]),\n _c(\"div\", { staticClass: \"text mText\" }, [\n _vm._v(_vm._s(_vm.systemInfo.jobCount))\n ])\n ]),\n _c(\"i\", { staticClass: \"el-icon-orange\" })\n ])\n ]),\n _c(\"el-col\", { attrs: { span: 6 } }, [\n _c(\"div\", { staticClass: \"wrap\" }, [\n _c(\"div\", { staticClass: \"grid-content bg-purple\" }, [\n _c(\"div\", { staticClass: \"text mTitle\" }, [\n _vm._v(_vm._s(_vm.$t(\"message.runningInstanceNum\")))\n ]),\n _c(\"div\", { staticClass: \"text\" }, [\n _vm._v(_vm._s(_vm.systemInfo.runningInstanceCount))\n ])\n ]),\n _c(\"i\", { staticClass: \"el-icon-timer\" })\n ])\n ]),\n _c(\"el-col\", { attrs: { span: 6 } }, [\n _c(\"div\", { staticClass: \"wrap\" }, [\n _c(\"div\", { staticClass: \"grid-content bg-purple\" }, [\n _c(\"div\", { staticClass: \"text mTitle\" }, [\n _vm._v(_vm._s(_vm.$t(\"message.recentFailedInstanceNum\")))\n ]),\n _c(\"div\", { staticClass: \"text\" }, [\n _vm._v(_vm._s(_vm.systemInfo.failedInstanceCount))\n ])\n ]),\n _c(\"i\", { staticClass: \"el-icon-bell\" })\n ])\n ]),\n _c(\"el-col\", { attrs: { span: 6 } }, [\n _c(\"div\", { staticClass: \"wrap\" }, [\n _c(\"div\", { staticClass: \"grid-content bg-purple\" }, [\n _c(\"div\", { staticClass: \"text mTitle\" }, [\n _vm._v(_vm._s(_vm.$t(\"message.workerNum\")))\n ]),\n _c(\"div\", { staticClass: \"text\" }, [\n _vm._v(_vm._s(_vm.activeWorkerCount))\n ])\n ]),\n _c(\"i\", { staticClass: \"el-icon-cpu\" })\n ])\n ])\n ],\n 1\n ),\n _c(\n \"el-row\",\n [\n _c(\n \"el-col\",\n { attrs: { span: 24 } },\n [\n _c(\n \"el-table\",\n {\n staticStyle: { width: \"100%\" },\n attrs: {\n data: _vm.workerList,\n height: \"400px\",\n \"row-class-name\": _vm.workerTableRowClassName\n }\n },\n [\n _c(\"el-table-column\", {\n attrs: {\n prop: \"address\",\n label: _vm.$t(\"message.workerAddress\")\n }\n }),\n _c(\"el-table-column\", {\n attrs: { prop: \"cpuLoad\", label: _vm.$t(\"message.cpuLoad\") }\n }),\n _c(\"el-table-column\", {\n attrs: {\n prop: \"memoryLoad\",\n label: _vm.$t(\"message.memoryLoad\")\n }\n }),\n _c(\"el-table-column\", {\n attrs: {\n prop: \"diskLoad\",\n label: _vm.$t(\"message.diskLoad\")\n }\n })\n ],\n 1\n )\n ],\n 1\n )\n ],\n 1\n )\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./src/components/views/Home.vue?./node_modules/cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%22f7b44cbc-vue-loader-template%22%7D!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), diff --git a/powerjob-server/src/main/resources/static/js/app.js b/powerjob-server/src/main/resources/static/js/app.js index a200db6f..11cf5df3 100644 --- a/powerjob-server/src/main/resources/static/js/app.js +++ b/powerjob-server/src/main/resources/static/js/app.js @@ -688,7 +688,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Use /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Users_salieri_Desktop_code_PowerJob_Console_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2 */ \"./node_modules/@babel/runtime/helpers/esm/objectSpread2.js\");\n/* harmony import */ var element_ui_lib_locale_lang_en__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! element-ui/lib/locale/lang/en */ \"./node_modules/element-ui/lib/locale/lang/en.js\");\n/* harmony import */ var element_ui_lib_locale_lang_en__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(element_ui_lib_locale_lang_en__WEBPACK_IMPORTED_MODULE_1__);\n\n\n\nvar en = Object(_Users_salieri_Desktop_code_PowerJob_Console_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n message: {\n 'save': 'save',\n 'cancel': 'cancel',\n 'refresh': 'refresh',\n 'query': 'query',\n 'reset': 'reset',\n 'keyword': 'keyword',\n 'run': 'run',\n 'edit': 'edit',\n 'delete': 'delete',\n 'success': 'success',\n 'failed': 'failed',\n 'detail': 'detail',\n 'download': 'download',\n 'stop': 'stop',\n 'back': 'back',\n 'all': 'ALL',\n 'more': '| more',\n // 欢迎界面\n 'appRegister': 'App Registration',\n 'userRegister': 'User Registration',\n 'appNameInputPLH': 'Enter The AppName',\n 'appName': 'AppName',\n 'appPassword': 'AppPassword',\n 'register': 'register',\n 'name': 'name',\n 'phone': 'phone',\n 'email': 'email',\n 'webhook': 'webhook',\n 'welcomeTitle': 'Welcome to use PowerJob!',\n 'login': 'Login',\n 'logout': 'Logout',\n 'changeAppInfo': 'Change AppInfo',\n 'newPassword': 'New Password',\n 'newPassword2': 'Check New Password',\n 'stayLogged': 'Keep me logged in',\n 'tabHome': 'Home',\n 'tabJobManage': 'JobManage',\n 'tabJobInstance': 'JobInstance',\n 'tabWorkflowManage': 'WorkflowManage',\n 'tabWfInstance': 'WorkflowInstance',\n 'tabContainerOps': 'ContainerOps',\n 'tabTemplate': 'TemplateGenerator',\n 'tabContainerManager': 'ContainerManager',\n 'omsServerTime': 'Server Time',\n 'omsServerTimezone': 'Server Timezone',\n 'localBrowserTime': 'Local Time',\n 'localBrowserTimezone': 'Local Timezone',\n 'githubURL': 'GitHub Repo',\n 'docURL': 'Document Address',\n 'totalJobNum': 'total job Num',\n 'runningInstanceNum': 'running instance num',\n 'recentFailedInstanceNum': 'recent failed instance Num',\n 'workerNum': 'worker cluster size',\n 'workerAddress': 'worker address',\n 'cpuLoad': 'CPU Load',\n 'memoryLoad': 'Memory Load',\n 'diskLoad': 'Disk Load',\n // JobManage\n 'jobId': 'JobID',\n 'instanceId': 'InstanceID',\n 'jobName': 'JobName',\n 'scheduleInfo': 'ScheduleInfo',\n 'executeType': 'ExecuteType',\n 'processorType': 'ProcessorType',\n 'status': 'status',\n 'operation': 'operation',\n 'newJob': 'New Job',\n 'jobDescription': 'JobDescription',\n 'jobParams': 'JobParams',\n 'timeExpressionType': 'TimeExpressionType',\n 'timeExpressionPlaceHolder': 'cron expression or number(millions) for fix_rate/fix_delay job',\n 'executeConfig': 'ExecuteConfig',\n 'javaProcessorInfoPLH': 'classname, eg: com.github.kfcfans.DemoProcessor',\n 'containerProcessorInfoPLH': 'containerID#classname, eg: 1#com.github.kfcfans.DemoProcessor',\n 'shellProcessorInfoPLH': 'shell script',\n 'pythonProcessorInfoPLH': 'python script',\n 'runtimeConfig': 'RuntimeConfig',\n 'maxInstanceNum': 'MaxInstanceNum',\n 'threadConcurrency': 'ThreadConcurrency',\n 'timeout': 'TimeLimit (ms)',\n 'retryConfig': 'RetryConfig',\n 'taskRetryTimes': 'InstanceRetryTimes',\n 'subTaskRetryTimes': \"TaskRetryTimes\",\n 'workerConfig': 'WorkerConfig',\n 'minCPU': 'MinAvailableCPUCores',\n 'minMemory': 'MinMemory(GB)',\n 'minDisk': 'MinDisk(GB)',\n 'clusterConfig': 'ClusterConfig',\n 'designatedWorkerAddress': 'DesignatedWorkerAddress',\n 'designatedWorkerAddressPLH': 'empty for all worker or IP:Port,IP:Port ...',\n 'maxWorkerNum': 'MaxWorkerNum',\n 'maxWorkerNumPLH': '0 means no limit',\n 'alarmConfig': 'AlarmConfig',\n 'alarmSelectorPLH': 'select alarm recipient ',\n 'standalone': 'Standalone',\n 'broadcast': 'Broadcast',\n 'map': 'MAP',\n 'mapReduce': 'MapReduce',\n 'fixRate': 'Fix Rate (ms)',\n 'fixDelay': 'Fix Delay (ms)',\n 'workflow': 'workflow',\n 'validateTimeExpression': 'validate',\n 'javaContainer': 'Java(Container)',\n 'runHistory': 'history',\n 'reRun': 'retry',\n // JobInstance\n 'wfInstanceId': 'WorkflowInstanceId',\n 'normalInstance': 'normal instance',\n 'wfInstance': 'workflow instance',\n 'triggerTime': 'trigger time',\n 'finishedTime': 'finished time',\n 'log': 'log',\n 'runningTimes': 'running times',\n 'taskTrackerAddress': 'taskTracker address',\n 'startTime': 'start time',\n 'expectedTriggerTime': 'expected trigger time',\n 'result': 'result',\n 'subTaskInfo': 'task info',\n 'secondlyJobHistory': 'secondlyJobHistory',\n 'subInstanceId': 'subInstanceId',\n 'instanceParams': 'instanceParams',\n // workflowManage\n 'wfId': 'WorkflowID',\n 'wfName': 'WorkflowName',\n 'newWorkflow': 'new workflow',\n 'wfDescription': 'description',\n 'importJob': 'import job',\n 'deleteJob': 'delete job',\n 'newStartPoint': 'new starting point',\n 'newEndPoint': 'new ending point',\n 'deleteEdge': 'delete edge',\n 'importJobTitle': \"select jobs\",\n 'wfTimeExpressionPLH': 'cron expression for CRON or empty for API',\n 'import': 'import',\n 'ntfClickNeedDeleteNode': 'Please click on the node you want to delete.',\n 'ntfClickStartPoint': 'Please click on the start node',\n 'ntfClickTargetPoint': 'Please click on the end node',\n 'ntfClickDeleteEdge': 'Please click on the edge you want to remove.',\n 'ntfAddStartPointFirst': 'Please add the starting point first!',\n 'ntfInvalidEdge': 'Illegal operation (same origin and destination)!',\n // workflowInstance\n 'wfTips': 'tips:Click on a node to view details of the job instance',\n 'ntfClickWaitingNode': 'Waiting for the upstream instances... No instances have been generated, and details cannot be viewed!',\n 'wfInitParams': 'initParams',\n // 容器\n 'newContainer': 'new container',\n 'containerType': 'type',\n 'containerGitURL': 'Git URL',\n 'branchName': 'branch',\n 'username': 'username',\n 'oldPassword': 'old password',\n 'password': 'password',\n 'containerId': 'ID',\n 'containerName': 'name',\n 'containerVersion': 'version',\n 'deployTime': 'deployed time',\n 'deploy': 'deploy',\n 'deployedWorkerList': 'worker list',\n 'uploadTips': 'Drag and drop or click on the file to upload it automatically',\n // 任务实例状态\n 'waitingDispatch': 'waiting dispatch',\n 'waitingWorkerReceive': 'waiting receive',\n 'running': 'running',\n 'stopped': 'stopped',\n 'canceled': 'canceled',\n 'wfWaiting': 'waiting',\n 'waitingUpstream': 'waiting upstream'\n }\n}, element_ui_lib_locale_lang_en__WEBPACK_IMPORTED_MODULE_1___default.a);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (en);\n\n//# sourceURL=webpack:///./src/i18n/langs/en.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Users_salieri_Desktop_code_PowerJob_Console_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2 */ \"./node_modules/@babel/runtime/helpers/esm/objectSpread2.js\");\n/* harmony import */ var element_ui_lib_locale_lang_en__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! element-ui/lib/locale/lang/en */ \"./node_modules/element-ui/lib/locale/lang/en.js\");\n/* harmony import */ var element_ui_lib_locale_lang_en__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(element_ui_lib_locale_lang_en__WEBPACK_IMPORTED_MODULE_1__);\n\n\n\nvar en = Object(_Users_salieri_Desktop_code_PowerJob_Console_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n message: {\n 'save': 'Save',\n 'cancel': 'Cancel',\n 'refresh': 'Refresh',\n 'query': 'Query',\n 'reset': 'Reset',\n 'keyword': 'Keyword',\n 'run': 'Run',\n 'edit': 'Edit',\n 'delete': 'Delete',\n 'success': 'Success',\n 'failed': 'Failed',\n 'detail': 'Detail',\n 'download': 'Download',\n 'stop': 'Stop',\n 'back': 'Back',\n 'all': 'ALL',\n 'more': '| More',\n // 欢迎界面\n 'appRegister': 'App Registration',\n 'userRegister': 'User Registration',\n 'appNameInputPLH': 'Enter The AppName',\n 'appName': 'AppName',\n 'appPassword': 'AppPassword',\n 'register': 'Register',\n 'name': 'Name',\n 'phone': 'Phone',\n 'email': 'Email',\n 'webhook': 'Webhook',\n 'welcomeTitle': 'Welcome to use PowerJob!',\n 'login': 'Login',\n 'logout': 'Logout',\n 'changeAppInfo': 'Change AppInfo',\n 'newPassword': 'New Password',\n 'newPassword2': 'Check New Password',\n 'stayLogged': 'Keep me logged in',\n 'tabHome': 'Home',\n 'tabJobManage': 'Job management',\n 'tabJobInstance': 'Job instances',\n 'tabWorkflowManage': 'Workflow management',\n 'tabWfInstance': 'Workflow instances',\n 'tabContainerOps': 'Container DevOps',\n 'tabTemplate': 'Template generator',\n 'tabContainerManager': 'Container Management',\n 'omsServerTime': 'Server Time',\n 'omsServerTimezone': 'Server Timezone',\n 'localBrowserTime': 'Local Time',\n 'localBrowserTimezone': 'Local Timezone',\n 'githubURL': 'GitHub Repo',\n 'docURL': 'Document Address',\n 'totalJobNum': 'Total job num',\n 'runningInstanceNum': 'Running instance num',\n 'recentFailedInstanceNum': 'Recent failed instance num',\n 'workerNum': 'Worker node num',\n 'workerAddress': 'Worker address',\n 'cpuLoad': 'CPU Load',\n 'memoryLoad': 'Memory Load',\n 'diskLoad': 'Disk Load',\n // JobManage\n 'jobId': 'JobID',\n 'instanceId': 'InstanceID',\n 'jobName': 'JobName',\n 'scheduleInfo': 'ScheduleInfo',\n 'executeType': 'ExecutionType',\n 'processorType': 'ProcessorType',\n 'status': 'Status',\n 'operation': 'Operation',\n 'newJob': 'New Job',\n 'jobDescription': 'JobDescription',\n 'jobParams': 'JobParams',\n 'timeExpressionType': 'TimeExpressionType',\n 'timeExpressionPlaceHolder': 'Cron expression or number of millions for fixed_rate/fixed_delay job',\n 'executeConfig': 'ExecutionConfig',\n 'javaProcessorInfoPLH': 'Classname, eg: com.github.kfcfans.DemoProcessor',\n 'containerProcessorInfoPLH': 'ContainerID#classname, eg: 1#com.github.kfcfans.DemoProcessor',\n 'shellProcessorInfoPLH': 'Shell script',\n 'pythonProcessorInfoPLH': 'Python script',\n 'runtimeConfig': 'RuntimeConfig',\n 'maxInstanceNum': 'MaxInstanceNum',\n 'threadConcurrency': 'ThreadConcurrency',\n 'timeout': 'TimeLimit (ms)',\n 'retryConfig': 'RetryConfig',\n 'taskRetryTimes': 'InstanceRetryTimes',\n 'subTaskRetryTimes': \"TaskRetryTimes\",\n 'workerConfig': 'WorkerConfig',\n 'minCPU': 'MinAvailableCPUCores',\n 'minMemory': 'MinMemory(GB)',\n 'minDisk': 'MinDisk(GB)',\n 'clusterConfig': 'ClusterConfig',\n 'designatedWorkerAddress': 'DesignatedWorkerAddress',\n 'designatedWorkerAddressPLH': 'Empty for all workers; ip:port,ip:port for specific',\n 'maxWorkerNum': 'MaxWorkerNum',\n 'maxWorkerNumPLH': '0 means no limit',\n 'alarmConfig': 'AlarmConfig',\n 'alarmSelectorPLH': 'Alarm receiver(s)',\n 'standalone': 'Standalone',\n 'broadcast': 'Broadcast',\n 'map': 'MAP',\n 'mapReduce': 'MapReduce',\n 'fixRate': 'Fixed Rate (ms)',\n 'fixDelay': 'Fixed Delay (ms)',\n 'workflow': 'Workflow',\n 'validateTimeExpression': 'Validate',\n 'javaContainer': 'Java(Container)',\n 'runHistory': 'History',\n 'reRun': 'Retry',\n // JobInstance\n 'wfInstanceId': 'WorkflowInstanceId',\n 'normalInstance': 'Normal instance',\n 'wfInstance': 'Workflow instance',\n 'triggerTime': 'Trigger time',\n 'finishedTime': 'Finished time',\n 'log': 'Log',\n 'runningTimes': 'Running times',\n 'taskTrackerAddress': 'TaskTracker address',\n 'startTime': 'Start time',\n 'expectedTriggerTime': 'Expected trigger time',\n 'result': 'Result',\n 'subTaskInfo': 'Task info',\n 'secondlyJobHistory': 'SecondlyJobHistory',\n 'subInstanceId': 'SubInstanceId',\n 'instanceParams': 'InstanceParams',\n // workflowManage\n 'wfId': 'WorkflowID',\n 'wfName': 'WorkflowName',\n 'newWorkflow': 'New workflow',\n 'wfDescription': 'Description',\n 'importJob': 'Import job',\n 'deleteJob': 'Delete job',\n 'newStartPoint': 'New starting point',\n 'newEndPoint': 'New ending point',\n 'deleteEdge': 'Delete edge',\n 'importJobTitle': \"Select jobs\",\n 'wfTimeExpressionPLH': 'Cron expression for CRON or empty for API',\n 'import': 'Import',\n 'ntfClickNeedDeleteNode': 'Please click on the node you want to delete.',\n 'ntfClickStartPoint': 'Please click on the start node',\n 'ntfClickTargetPoint': 'Please click on the end node',\n 'ntfClickDeleteEdge': 'Please click on the edge you want to remove.',\n 'ntfAddStartPointFirst': 'Please add the starting point first!',\n 'ntfInvalidEdge': 'Illegal operation (same origin and destination)!',\n // workflowInstance\n 'wfTips': 'tips:Click on a node to view details of the job instance',\n 'ntfClickWaitingNode': 'Waiting for the upstream instances... No instances have been generated, and details cannot be viewed!',\n 'wfInitParams': 'InitParams',\n // 容器\n 'newContainer': 'New container',\n 'containerType': 'Type',\n 'containerGitURL': 'Git URL',\n 'branchName': 'Branch',\n 'username': 'Username',\n 'oldPassword': 'Old password',\n 'password': 'Password',\n 'containerId': 'ID',\n 'containerName': 'Name',\n 'containerVersion': 'Version',\n 'deployTime': 'Deployed time',\n 'deploy': 'Deploy',\n 'deployedWorkerList': 'Worker list',\n 'uploadTips': 'Drag and drop or click on the file to upload it automatically',\n // 任务实例状态\n 'waitingDispatch': 'Waiting dispatch',\n 'waitingWorkerReceive': 'Waiting receive',\n 'running': 'Running',\n 'stopped': 'Stopped',\n 'canceled': 'Canceled',\n 'wfWaiting': 'Waiting',\n 'waitingUpstream': 'Waiting upstream'\n }\n}, element_ui_lib_locale_lang_en__WEBPACK_IMPORTED_MODULE_1___default.a);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (en);\n\n//# sourceURL=webpack:///./src/i18n/langs/en.js?"); /***/ }), diff --git a/powerjob-worker-agent/pom.xml b/powerjob-worker-agent/pom.xml index 49575f6a..aa2c813c 100644 --- a/powerjob-worker-agent/pom.xml +++ b/powerjob-worker-agent/pom.xml @@ -10,12 +10,12 @@ 4.0.0 powerjob-worker-agent - 3.4.2 + 3.4.3 jar - 3.4.2 + 3.4.3 1.2.3 4.3.2 diff --git a/powerjob-worker-samples/pom.xml b/powerjob-worker-samples/pom.xml index 6db5e26f..1f3b70e6 100644 --- a/powerjob-worker-samples/pom.xml +++ b/powerjob-worker-samples/pom.xml @@ -10,11 +10,11 @@ 4.0.0 powerjob-worker-samples - 3.4.2 + 3.4.3 2.2.6.RELEASE - 3.4.2 + 3.4.3 1.2.68 diff --git a/powerjob-worker-spring-boot-starter/pom.xml b/powerjob-worker-spring-boot-starter/pom.xml index 8a6f7749..ea70054f 100644 --- a/powerjob-worker-spring-boot-starter/pom.xml +++ b/powerjob-worker-spring-boot-starter/pom.xml @@ -10,11 +10,11 @@ 4.0.0 powerjob-worker-spring-boot-starter - 3.4.2 + 3.4.3 jar - 3.4.2 + 3.4.3 2.2.6.RELEASE diff --git a/powerjob-worker/pom.xml b/powerjob-worker/pom.xml index e3dc356d..9667fbbb 100644 --- a/powerjob-worker/pom.xml +++ b/powerjob-worker/pom.xml @@ -10,12 +10,12 @@ 4.0.0 powerjob-worker - 3.4.2 + 3.4.3 jar 5.2.4.RELEASE - 3.4.2 + 3.4.3 1.4.200 3.4.2 5.6.1 From 37cf53e0a9efbf26c7886eea24a1d897145557f5 Mon Sep 17 00:00:00 2001 From: tjq Date: Sun, 10 Jan 2021 17:56:11 +0800 Subject: [PATCH 16/19] fix: Grammatical errors --- .../kfcfans/powerjob/common/TimeExpressionType.java | 8 +++----- .../kfcfans/powerjob/server/service/ValidateService.java | 4 ++-- .../worker/core/tracker/task/FrequentTaskTracker.java | 6 +++--- .../powerjob/worker/core/tracker/task/TaskTracker.java | 4 ++-- .../github/kfcfans/powerjob/FrequentTaskTrackerTest.java | 4 ++-- .../test/java/com/github/kfcfans/powerjob/TestUtils.java | 4 ++-- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/TimeExpressionType.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/TimeExpressionType.java index 0d1f2378..cbfbc990 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/TimeExpressionType.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/TimeExpressionType.java @@ -18,15 +18,13 @@ public enum TimeExpressionType { API(1), CRON(2), - // FIXED_RATE - FIX_RATE(3), - // FIXED_DELAY - FIX_DELAY(4), + FIXED_RATE(3), + FIXED_DELAY(4), WORKFLOW(5); int v; - public static final List frequentTypes = Lists.newArrayList(FIX_RATE.v, FIX_DELAY.v); + public static final List frequentTypes = Lists.newArrayList(FIXED_RATE.v, FIXED_DELAY.v); public static TimeExpressionType of(int v) { for (TimeExpressionType type : values()) { diff --git a/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/service/ValidateService.java b/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/service/ValidateService.java index 742ecfee..aa8cb7eb 100644 --- a/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/service/ValidateService.java +++ b/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/service/ValidateService.java @@ -33,8 +33,8 @@ public class ValidateService { case API: return Lists.newArrayList(OmsConstant.NONE); case WORKFLOW: return Lists.newArrayList("VALID: depends on workflow"); case CRON: return calculateCronExpression(timeExpression); - case FIX_RATE: return calculateFixRate(timeExpression); - case FIX_DELAY: return Lists.newArrayList("VALID: depends on execution cost time"); + case FIXED_RATE: return calculateFixRate(timeExpression); + case FIXED_DELAY: return Lists.newArrayList("VALID: depends on execution cost time"); } // impossible return Collections.emptyList(); diff --git a/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/core/tracker/task/FrequentTaskTracker.java b/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/core/tracker/task/FrequentTaskTracker.java index 9fa9b34b..a50029b3 100644 --- a/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/core/tracker/task/FrequentTaskTracker.java +++ b/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/core/tracker/task/FrequentTaskTracker.java @@ -88,7 +88,7 @@ public class FrequentTaskTracker extends TaskTracker { // 2. 启动任务发射器 launcher = new Launcher(); - if (timeExpressionType == TimeExpressionType.FIX_RATE) { + if (timeExpressionType == TimeExpressionType.FIXED_RATE) { // 固定频率需要设置最小间隔 if (timeParams < MIN_INTERVAL) { throw new PowerJobException("time interval too small, please set the timeExpressionInfo >= 1000"); @@ -172,7 +172,7 @@ public class FrequentTaskTracker extends TaskTracker { // 判断是否超出最大执行实例数 if (maxInstanceNum > 0) { - if (timeExpressionType == TimeExpressionType.FIX_RATE) { + if (timeExpressionType == TimeExpressionType.FIXED_RATE) { if (subInstanceId2TimeHolder.size() > maxInstanceNum) { log.warn("[FQTaskTracker-{}] cancel to launch the subInstance({}) due to too much subInstance is running.", instanceId, subInstanceId); processFinishedSubInstance(subInstanceId, false, "TOO_MUCH_INSTANCE"); @@ -368,7 +368,7 @@ public class FrequentTaskTracker extends TaskTracker { taskPersistenceService.deleteAllSubInstanceTasks(instanceId, subInstanceId); // FIX_DELAY 则调度下次任务 - if (timeExpressionType == TimeExpressionType.FIX_DELAY) { + if (timeExpressionType == TimeExpressionType.FIXED_DELAY) { scheduledPool.schedule(launcher, timeParams, TimeUnit.MILLISECONDS); } } diff --git a/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/core/tracker/task/TaskTracker.java b/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/core/tracker/task/TaskTracker.java index 463c7aee..4efc5430 100644 --- a/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/core/tracker/task/TaskTracker.java +++ b/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/core/tracker/task/TaskTracker.java @@ -115,8 +115,8 @@ public abstract class TaskTracker { try { TimeExpressionType timeExpressionType = TimeExpressionType.valueOf(req.getTimeExpressionType()); switch (timeExpressionType) { - case FIX_RATE: - case FIX_DELAY:return new FrequentTaskTracker(req); + case FIXED_RATE: + case FIXED_DELAY:return new FrequentTaskTracker(req); default:return new CommonTaskTracker(req); } } catch (Exception e) { diff --git a/powerjob-worker/src/test/java/com/github/kfcfans/powerjob/FrequentTaskTrackerTest.java b/powerjob-worker/src/test/java/com/github/kfcfans/powerjob/FrequentTaskTrackerTest.java index 048218e8..2e377764 100644 --- a/powerjob-worker/src/test/java/com/github/kfcfans/powerjob/FrequentTaskTrackerTest.java +++ b/powerjob-worker/src/test/java/com/github/kfcfans/powerjob/FrequentTaskTrackerTest.java @@ -41,13 +41,13 @@ public class FrequentTaskTrackerTest { @Test public void testFixRateJob() throws Exception { - remoteTaskTracker.tell(TestUtils.genServerScheduleJobReq(ExecuteType.STANDALONE, TimeExpressionType.FIX_RATE), null); + remoteTaskTracker.tell(TestUtils.genServerScheduleJobReq(ExecuteType.STANDALONE, TimeExpressionType.FIXED_RATE), null); Thread.sleep(5000000); } @Test public void testFixDelayJob() throws Exception { - remoteTaskTracker.tell(TestUtils.genServerScheduleJobReq(ExecuteType.MAP_REDUCE, TimeExpressionType.FIX_DELAY), null); + remoteTaskTracker.tell(TestUtils.genServerScheduleJobReq(ExecuteType.MAP_REDUCE, TimeExpressionType.FIXED_DELAY), null); Thread.sleep(5000000); } } diff --git a/powerjob-worker/src/test/java/com/github/kfcfans/powerjob/TestUtils.java b/powerjob-worker/src/test/java/com/github/kfcfans/powerjob/TestUtils.java index c55ce57f..36bbf2c7 100644 --- a/powerjob-worker/src/test/java/com/github/kfcfans/powerjob/TestUtils.java +++ b/powerjob-worker/src/test/java/com/github/kfcfans/powerjob/TestUtils.java @@ -32,8 +32,8 @@ public class TestUtils { req.setTimeExpressionType(timeExpressionType.name()); switch (timeExpressionType) { case CRON:req.setTimeExpression("0 * * * * ? "); - case FIX_RATE: - case FIX_DELAY:req.setTimeExpression("5000"); + case FIXED_RATE: + case FIXED_DELAY:req.setTimeExpression("5000"); } switch (executeType) { From 2ecbc2c205b5730917972dbce242c8b0eb0e95c6 Mon Sep 17 00:00:00 2001 From: tjq Date: Sun, 10 Jan 2021 18:01:40 +0800 Subject: [PATCH 17/19] fix: Grammatical errors --- powerjob-server/src/main/resources/static/js/6.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerjob-server/src/main/resources/static/js/6.js b/powerjob-server/src/main/resources/static/js/6.js index 39e5e714..652b9900 100644 --- a/powerjob-server/src/main/resources/static/js/6.js +++ b/powerjob-server/src/main/resources/static/js/6.js @@ -20,7 +20,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n//\n//\n//\n//\n//\n//\n//\n/ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _common_TimeExpressionValidator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/TimeExpressionValidator */ \"./src/components/common/TimeExpressionValidator.vue\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"JobManager\",\n components: {\n TimeExpressionValidator: _common_TimeExpressionValidator__WEBPACK_IMPORTED_MODULE_0__[\"default\"]\n },\n data: function data() {\n return {\n modifiedJobFormVisible: false,\n // 新建任务对象\n modifiedJobForm: {\n id: undefined,\n jobName: \"\",\n jobDescription: \"\",\n appId: this.$store.state.appInfo.id,\n jobParams: \"\",\n timeExpressionType: \"\",\n timeExpression: \"\",\n executeType: \"\",\n processorType: \"\",\n processorInfo: \"\",\n maxInstanceNum: 0,\n concurrency: 5,\n instanceTimeLimit: 0,\n instanceRetryNum: 0,\n taskRetryNum: 1,\n minCpuCores: 0,\n minMemorySpace: 0,\n minDiskSpace: 0,\n enable: true,\n designatedWorkers: \"\",\n maxWorkerCount: 0,\n notifyUserIds: []\n },\n // 任务查询请求对象\n jobQueryContent: {\n appId: this.$store.state.appInfo.id,\n index: 0,\n pageSize: 10,\n jobId: undefined,\n keyword: undefined\n },\n // 任务列表(查询结果),包含index、pageSize、totalPages、totalItems、data(List类型)\n jobInfoPageResult: {\n pageSize: 10,\n totalItems: 0,\n data: []\n },\n // 时间表达式选择类型\n timeExpressionTypeOptions: [{\n key: \"API\",\n label: \"API\"\n }, {\n key: \"CRON\",\n label: \"CRON\"\n }, {\n key: \"FIX_RATE\",\n label: this.$t('message.fixRate')\n }, {\n key: \"FIX_DELAY\",\n label: this.$t('message.fixDelay')\n }, {\n key: \"WORKFLOW\",\n label: this.$t('message.workflow')\n }],\n // 处理器类型\n processorTypeOptions: [{\n key: \"EMBEDDED_JAVA\",\n label: \"JAVA\"\n }, {\n key: \"JAVA_CONTAINER\",\n label: this.$t('message.javaContainer')\n }, {\n key: \"SHELL\",\n label: \"SHELL\"\n }, {\n key: \"PYTHON\",\n label: \"PYTHON\"\n }],\n // 执行方式类型\n executeTypeOptions: [{\n key: \"STANDALONE\",\n label: this.$t('message.standalone')\n }, {\n key: \"BROADCAST\",\n label: this.$t('message.broadcast')\n }, {\n key: \"MAP\",\n label: this.$t('message.map')\n }, {\n key: \"MAP_REDUCE\",\n label: this.$t('message.mapReduce')\n }],\n // 用户列表\n userList: [],\n // 时间表达式校验窗口\n timeExpressionValidatorVisible: false\n };\n },\n methods: {\n // 保存变更,包括新增和修改\n saveJob: function saveJob() {\n var _this = this;\n\n var that = this;\n this.axios.post(\"/job/save\", this.modifiedJobForm).then(function () {\n that.modifiedJobFormVisible = false;\n that.$message.success(_this.$t('message.success')); // 重新加载数据\n\n that.listJobInfos();\n }, function () {\n return that.modifiedJobFormVisible = false;\n });\n },\n // 列出符合当前搜索条件的任务\n listJobInfos: function listJobInfos() {\n var that = this;\n this.axios.post(\"/job/list\", this.jobQueryContent).then(function (res) {\n that.jobInfoPageResult = res;\n });\n },\n // 修改任务状态\n changeJobStatus: function changeJobStatus(data) {\n // switch 会自动更改 enable 的值\n var that = this;\n\n if (data.enable === false) {\n // 仅有,有特殊逻辑(关闭秒级任务),走单独接口\n that.axios.get(\"/job/disable?jobId=\" + data.id).then(function () {\n return that.listJobInfos();\n });\n } else {\n // 启用,则发起正常的保存操作\n this.modifiedJobForm = data;\n this.saveJob();\n }\n },\n // 新增任务,去除旧数据\n onClickNewJob: function onClickNewJob() {\n this.modifiedJobForm.id = undefined;\n this.modifiedJobForm.jobName = undefined;\n this.modifiedJobForm.jobDescription = undefined;\n this.modifiedJobForm.jobParams = undefined;\n this.modifiedJobForm.timeExpression = undefined;\n this.modifiedJobForm.timeExpressionType = undefined;\n this.modifiedJobForm.processorInfo = undefined;\n this.modifiedJobForm.processorType = undefined;\n this.modifiedJobForm.executeType = undefined;\n this.modifiedJobFormVisible = true;\n },\n // 点击 编辑按钮\n onClickModify: function onClickModify(data) {\n // 修复点击编辑后再点击新增 行数据被清空 的问题\n this.modifiedJobForm = JSON.parse(JSON.stringify(data));\n this.modifiedJobFormVisible = true;\n },\n // 点击 立即运行按钮\n onClickRun: function onClickRun(data) {\n var _this2 = this;\n\n var that = this;\n var url = \"/job/run?jobId=\" + data.id + \"&appId=\" + that.$store.state.appInfo.id;\n this.axios.get(url).then(function () {\n return that.$message.success(_this2.$t('message.success'));\n });\n },\n // 点击 删除任务\n onClickDeleteJob: function onClickDeleteJob(data) {\n var _this3 = this;\n\n var that = this;\n var url = \"/job/delete?jobId=\" + data.id;\n this.axios.get(url).then(function () {\n that.$message.success(_this3.$t('message.success'));\n that.listJobInfos();\n });\n },\n // 点击 历史记录\n onClickRunHistory: function onClickRunHistory(data) {\n console.log(JSON.stringify(data));\n this.$router.push({\n name: 'instanceManager',\n params: {\n jobId: data.id\n }\n });\n },\n // 点击 换页\n onClickChangePage: function onClickChangePage(index) {\n // 后端从0开始,前端从1开始\n this.jobQueryContent.index = index - 1;\n this.listJobInfos();\n },\n // 点击重置按钮\n onClickReset: function onClickReset() {\n this.jobQueryContent.keyword = undefined;\n this.jobQueryContent.jobId = undefined;\n this.listJobInfos();\n },\n verifyPlaceholder: function verifyPlaceholder(processorType) {\n var res;\n\n switch (processorType) {\n case \"EMBEDDED_JAVA\":\n res = this.$t('message.javaProcessorInfoPLH');\n break;\n\n case \"JAVA_CONTAINER\":\n res = this.$t('message.containerProcessorInfoPLH');\n break;\n\n case \"SHELL\":\n res = this.$t('message.shellProcessorInfoPLH');\n break;\n\n case \"PYTHON\":\n res = this.$t('message.pythonProcessorInfoPLH');\n }\n\n return res;\n },\n // 翻译执行类型\n translateExecuteType: function translateExecuteType(executeType) {\n switch (executeType) {\n case \"STANDALONE\":\n return this.$t('message.standalone');\n\n case \"BROADCAST\":\n return this.$t('message.broadcast');\n\n case \"MAP_REDUCE\":\n return this.$t('message.mapReduce');\n\n case \"MAP\":\n return this.$t('message.map');\n\n default:\n return \"UNKNOWN\";\n }\n },\n // 翻译处理器类型\n translateProcessorType: function translateProcessorType(processorType) {\n if (processorType === \"JAVA_CONTAINER\") {\n return this.$t('message.javaContainer');\n }\n\n return processorType;\n },\n // 点击校验\n onClickValidateTimeExpression: function onClickValidateTimeExpression() {\n this.timeExpressionValidatorVisible = true;\n }\n },\n mounted: function mounted() {\n // 加载用户信息\n var that = this;\n that.axios.get(\"/user/list\").then(function (res) {\n return that.userList = res;\n }); // 加载任务信息\n\n this.listJobInfos();\n }\n});\n\n//# sourceURL=webpack:///./src/components/views/JobManager.vue?./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _common_TimeExpressionValidator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/TimeExpressionValidator */ \"./src/components/common/TimeExpressionValidator.vue\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"JobManager\",\n components: {\n TimeExpressionValidator: _common_TimeExpressionValidator__WEBPACK_IMPORTED_MODULE_0__[\"default\"]\n },\n data: function data() {\n return {\n modifiedJobFormVisible: false,\n // 新建任务对象\n modifiedJobForm: {\n id: undefined,\n jobName: \"\",\n jobDescription: \"\",\n appId: this.$store.state.appInfo.id,\n jobParams: \"\",\n timeExpressionType: \"\",\n timeExpression: \"\",\n executeType: \"\",\n processorType: \"\",\n processorInfo: \"\",\n maxInstanceNum: 0,\n concurrency: 5,\n instanceTimeLimit: 0,\n instanceRetryNum: 0,\n taskRetryNum: 1,\n minCpuCores: 0,\n minMemorySpace: 0,\n minDiskSpace: 0,\n enable: true,\n designatedWorkers: \"\",\n maxWorkerCount: 0,\n notifyUserIds: []\n },\n // 任务查询请求对象\n jobQueryContent: {\n appId: this.$store.state.appInfo.id,\n index: 0,\n pageSize: 10,\n jobId: undefined,\n keyword: undefined\n },\n // 任务列表(查询结果),包含index、pageSize、totalPages、totalItems、data(List类型)\n jobInfoPageResult: {\n pageSize: 10,\n totalItems: 0,\n data: []\n },\n // 时间表达式选择类型\n timeExpressionTypeOptions: [{\n key: \"API\",\n label: \"API\"\n }, {\n key: \"CRON\",\n label: \"CRON\"\n }, {\n key: \"FIXED_RATE\",\n label: this.$t('message.fixRate')\n }, {\n key: \"FIXED_DELAY\",\n label: this.$t('message.fixDelay')\n }, {\n key: \"WORKFLOW\",\n label: this.$t('message.workflow')\n }],\n // 处理器类型\n processorTypeOptions: [{\n key: \"EMBEDDED_JAVA\",\n label: \"JAVA\"\n }, {\n key: \"JAVA_CONTAINER\",\n label: this.$t('message.javaContainer')\n }, {\n key: \"SHELL\",\n label: \"SHELL\"\n }, {\n key: \"PYTHON\",\n label: \"PYTHON\"\n }],\n // 执行方式类型\n executeTypeOptions: [{\n key: \"STANDALONE\",\n label: this.$t('message.standalone')\n }, {\n key: \"BROADCAST\",\n label: this.$t('message.broadcast')\n }, {\n key: \"MAP\",\n label: this.$t('message.map')\n }, {\n key: \"MAP_REDUCE\",\n label: this.$t('message.mapReduce')\n }],\n // 用户列表\n userList: [],\n // 时间表达式校验窗口\n timeExpressionValidatorVisible: false\n };\n },\n methods: {\n // 保存变更,包括新增和修改\n saveJob: function saveJob() {\n var _this = this;\n\n var that = this;\n this.axios.post(\"/job/save\", this.modifiedJobForm).then(function () {\n that.modifiedJobFormVisible = false;\n that.$message.success(_this.$t('message.success')); // 重新加载数据\n\n that.listJobInfos();\n }, function () {\n return that.modifiedJobFormVisible = false;\n });\n },\n // 列出符合当前搜索条件的任务\n listJobInfos: function listJobInfos() {\n var that = this;\n this.axios.post(\"/job/list\", this.jobQueryContent).then(function (res) {\n that.jobInfoPageResult = res;\n });\n },\n // 修改任务状态\n changeJobStatus: function changeJobStatus(data) {\n // switch 会自动更改 enable 的值\n var that = this;\n\n if (data.enable === false) {\n // 仅有,有特殊逻辑(关闭秒级任务),走单独接口\n that.axios.get(\"/job/disable?jobId=\" + data.id).then(function () {\n return that.listJobInfos();\n });\n } else {\n // 启用,则发起正常的保存操作\n this.modifiedJobForm = data;\n this.saveJob();\n }\n },\n // 新增任务,去除旧数据\n onClickNewJob: function onClickNewJob() {\n this.modifiedJobForm.id = undefined;\n this.modifiedJobForm.jobName = undefined;\n this.modifiedJobForm.jobDescription = undefined;\n this.modifiedJobForm.jobParams = undefined;\n this.modifiedJobForm.timeExpression = undefined;\n this.modifiedJobForm.timeExpressionType = undefined;\n this.modifiedJobForm.processorInfo = undefined;\n this.modifiedJobForm.processorType = undefined;\n this.modifiedJobForm.executeType = undefined;\n this.modifiedJobFormVisible = true;\n },\n // 点击 编辑按钮\n onClickModify: function onClickModify(data) {\n // 修复点击编辑后再点击新增 行数据被清空 的问题\n this.modifiedJobForm = JSON.parse(JSON.stringify(data));\n this.modifiedJobFormVisible = true;\n },\n // 点击 立即运行按钮\n onClickRun: function onClickRun(data) {\n var _this2 = this;\n\n var that = this;\n var url = \"/job/run?jobId=\" + data.id + \"&appId=\" + that.$store.state.appInfo.id;\n this.axios.get(url).then(function () {\n return that.$message.success(_this2.$t('message.success'));\n });\n },\n // 点击 删除任务\n onClickDeleteJob: function onClickDeleteJob(data) {\n var _this3 = this;\n\n var that = this;\n var url = \"/job/delete?jobId=\" + data.id;\n this.axios.get(url).then(function () {\n that.$message.success(_this3.$t('message.success'));\n that.listJobInfos();\n });\n },\n // 点击 历史记录\n onClickRunHistory: function onClickRunHistory(data) {\n console.log(JSON.stringify(data));\n this.$router.push({\n name: 'instanceManager',\n params: {\n jobId: data.id\n }\n });\n },\n // 点击 换页\n onClickChangePage: function onClickChangePage(index) {\n // 后端从0开始,前端从1开始\n this.jobQueryContent.index = index - 1;\n this.listJobInfos();\n },\n // 点击重置按钮\n onClickReset: function onClickReset() {\n this.jobQueryContent.keyword = undefined;\n this.jobQueryContent.jobId = undefined;\n this.listJobInfos();\n },\n verifyPlaceholder: function verifyPlaceholder(processorType) {\n var res;\n\n switch (processorType) {\n case \"EMBEDDED_JAVA\":\n res = this.$t('message.javaProcessorInfoPLH');\n break;\n\n case \"JAVA_CONTAINER\":\n res = this.$t('message.containerProcessorInfoPLH');\n break;\n\n case \"SHELL\":\n res = this.$t('message.shellProcessorInfoPLH');\n break;\n\n case \"PYTHON\":\n res = this.$t('message.pythonProcessorInfoPLH');\n }\n\n return res;\n },\n // 翻译执行类型\n translateExecuteType: function translateExecuteType(executeType) {\n switch (executeType) {\n case \"STANDALONE\":\n return this.$t('message.standalone');\n\n case \"BROADCAST\":\n return this.$t('message.broadcast');\n\n case \"MAP_REDUCE\":\n return this.$t('message.mapReduce');\n\n case \"MAP\":\n return this.$t('message.map');\n\n default:\n return \"UNKNOWN\";\n }\n },\n // 翻译处理器类型\n translateProcessorType: function translateProcessorType(processorType) {\n if (processorType === \"JAVA_CONTAINER\") {\n return this.$t('message.javaContainer');\n }\n\n return processorType;\n },\n // 点击校验\n onClickValidateTimeExpression: function onClickValidateTimeExpression() {\n this.timeExpressionValidatorVisible = true;\n }\n },\n mounted: function mounted() {\n // 加载用户信息\n var that = this;\n that.axios.get(\"/user/list\").then(function (res) {\n return that.userList = res;\n }); // 加载任务信息\n\n this.listJobInfos();\n }\n});\n\n//# sourceURL=webpack:///./src/components/views/JobManager.vue?./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), From 515ce9bce2511c64983b011bc0e64823a104d790 Mon Sep 17 00:00:00 2001 From: tjq Date: Sun, 10 Jan 2021 18:09:35 +0800 Subject: [PATCH 18/19] refacotr: no throw PowerJobException in OpenAPI --- .../com/github/kfcfans/powerjob/client/OhMyClient.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/OhMyClient.java b/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/OhMyClient.java index aac051cf..7b049b1e 100644 --- a/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/OhMyClient.java +++ b/powerjob-client/src/main/java/com/github/kfcfans/powerjob/client/OhMyClient.java @@ -192,7 +192,7 @@ public class OhMyClient { String post = postHA(OpenAPIConstant.RUN_JOB, builder.build()); return JSONObject.parseObject(post, LONG_RESULT_TYPE); } - public ResultDTO runJob(Long jobId) throws PowerJobException { + public ResultDTO runJob(Long jobId) { return runJob(jobId, null, 0); } @@ -357,7 +357,7 @@ public class OhMyClient { String post = postHA(OpenAPIConstant.RUN_WORKFLOW, builder.build()); return JSONObject.parseObject(post, LONG_RESULT_TYPE); } - public ResultDTO runWorkflow(Long workflowId) throws PowerJobException { + public ResultDTO runWorkflow(Long workflowId) { return runWorkflow(workflowId, null, 0); } @@ -367,7 +367,7 @@ public class OhMyClient { * @param wfInstanceId workflow instanceId * @return Standard return object */ - public ResultDTO stopWorkflowInstance(Long wfInstanceId) throws PowerJobException { + public ResultDTO stopWorkflowInstance(Long wfInstanceId) { RequestBody body = new FormBody.Builder() .add("wfInstanceId", wfInstanceId.toString()) .add("appId", appId.toString()) @@ -424,6 +424,6 @@ public class OhMyClient { } log.error("[OhMyClient] do post for path: {} failed because of no server available in {}.", path, allAddress); - throw new PowerJobException("no server available when send post"); + throw new PowerJobException("no server available when send post request"); } } From 8d6d7c927d0e437ef9b4245a66265fc58b83b05f Mon Sep 17 00:00:00 2001 From: tjq Date: Sun, 10 Jan 2021 18:15:23 +0800 Subject: [PATCH 19/19] fix: Grammatical errors --- powerjob-server/src/main/resources/static/js/9.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerjob-server/src/main/resources/static/js/9.js b/powerjob-server/src/main/resources/static/js/9.js index 9955e5b3..0d8fb775 100644 --- a/powerjob-server/src/main/resources/static/js/9.js +++ b/powerjob-server/src/main/resources/static/js/9.js @@ -20,7 +20,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _com /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n { attrs: { id: \"instance_manager\" } },\n [\n _c(\n \"el-row\",\n [\n _c(\n \"el-col\",\n { attrs: { span: 22 } },\n [\n _c(\n \"el-form\",\n {\n staticClass: \"el-form--inline\",\n attrs: { inline: true, model: _vm.instanceQueryContent }\n },\n [\n _c(\n \"el-form-item\",\n { attrs: { label: _vm.$t(\"message.jobId\") } },\n [\n _c(\"el-input\", {\n attrs: { placeholder: _vm.$t(\"message.jobId\") },\n model: {\n value: _vm.instanceQueryContent.jobId,\n callback: function($$v) {\n _vm.$set(_vm.instanceQueryContent, \"jobId\", $$v)\n },\n expression: \"instanceQueryContent.jobId\"\n }\n })\n ],\n 1\n ),\n _c(\n \"el-form-item\",\n { attrs: { label: _vm.$t(\"message.instanceId\") } },\n [\n _c(\"el-input\", {\n attrs: { placeholder: _vm.$t(\"message.instanceId\") },\n model: {\n value: _vm.instanceQueryContent.instanceId,\n callback: function($$v) {\n _vm.$set(\n _vm.instanceQueryContent,\n \"instanceId\",\n $$v\n )\n },\n expression: \"instanceQueryContent.instanceId\"\n }\n })\n ],\n 1\n ),\n _vm.instanceQueryContent.type === \"WORKFLOW\"\n ? _c(\n \"el-form-item\",\n { attrs: { label: _vm.$t(\"message.wfInstanceId\") } },\n [\n _c(\"el-input\", {\n attrs: {\n placeholder: _vm.$t(\"message.wfInstanceId\")\n },\n model: {\n value: _vm.instanceQueryContent.wfInstanceId,\n callback: function($$v) {\n _vm.$set(\n _vm.instanceQueryContent,\n \"wfInstanceId\",\n $$v\n )\n },\n expression: \"instanceQueryContent.wfInstanceId\"\n }\n })\n ],\n 1\n )\n : _vm._e(),\n _c(\n \"el-form-item\",\n { attrs: { label: _vm.$t(\"message.status\") } },\n [\n _c(\n \"el-select\",\n {\n attrs: { placeholder: _vm.$t(\"message.status\") },\n model: {\n value: _vm.instanceQueryContent.status,\n callback: function($$v) {\n _vm.$set(_vm.instanceQueryContent, \"status\", $$v)\n },\n expression: \"instanceQueryContent.status\"\n }\n },\n _vm._l(_vm.instanceStatusOptions, function(item) {\n return _c(\"el-option\", {\n key: item.key,\n attrs: { label: item.label, value: item.key }\n })\n }),\n 1\n )\n ],\n 1\n ),\n _c(\n \"el-form-item\",\n [\n _c(\n \"el-button\",\n {\n attrs: { type: \"primary\" },\n on: { click: _vm.listInstanceInfos }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.query\")))]\n ),\n _c(\n \"el-button\",\n {\n attrs: { type: \"cancel\" },\n on: { click: _vm.onClickRest }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.reset\")))]\n )\n ],\n 1\n )\n ],\n 1\n )\n ],\n 1\n ),\n _c(\"el-col\", { attrs: { span: 2 } }, [\n _c(\n \"div\",\n { staticStyle: { float: \"right\", \"padding-right\": \"10px\" } },\n [\n _c(\n \"el-button\",\n {\n attrs: { type: \"primary\" },\n on: { click: _vm.listInstanceInfos }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.refresh\")))]\n )\n ],\n 1\n )\n ])\n ],\n 1\n ),\n _c(\n \"el-tabs\",\n {\n attrs: { type: \"card\" },\n on: { \"tab-click\": _vm.listInstanceInfos },\n model: {\n value: _vm.instanceQueryContent.type,\n callback: function($$v) {\n _vm.$set(_vm.instanceQueryContent, \"type\", $$v)\n },\n expression: \"instanceQueryContent.type\"\n }\n },\n [\n _c(\"el-tab-pane\", {\n attrs: { label: _vm.$t(\"message.normalInstance\"), name: \"NORMAL\" }\n }),\n _c(\"el-tab-pane\", {\n attrs: { label: _vm.$t(\"message.wfInstance\"), name: \"WORKFLOW\" }\n })\n ],\n 1\n ),\n _c(\n \"el-row\",\n [\n _c(\n \"el-table\",\n {\n staticStyle: { width: \"100%\" },\n attrs: {\n data: _vm.instancePageResult.data,\n \"row-class-name\": _vm.instanceTableRowClassName\n }\n },\n [\n _c(\"el-table-column\", {\n attrs: {\n prop: \"jobId\",\n label: _vm.$t(\"message.jobId\"),\n width: \"80\"\n }\n }),\n _c(\"el-table-column\", {\n attrs: { prop: \"jobName\", label: _vm.$t(\"message.jobName\") }\n }),\n _vm.instanceQueryContent.type === \"WORKFLOW\"\n ? _c(\"el-table-column\", {\n attrs: {\n prop: \"wfInstanceId\",\n label: _vm.$t(\"message.wfInstanceId\")\n }\n })\n : _vm._e(),\n _c(\"el-table-column\", {\n attrs: {\n prop: \"instanceId\",\n label: _vm.$t(\"message.instanceId\")\n }\n }),\n _c(\"el-table-column\", {\n attrs: {\n prop: \"status\",\n label: _vm.$t(\"message.status\"),\n width: \"160\"\n },\n scopedSlots: _vm._u([\n {\n key: \"default\",\n fn: function(scope) {\n return [\n _vm._v(\n \" \" + _vm._s(_vm.fetchStatus(scope.row.status)) + \" \"\n )\n ]\n }\n }\n ])\n }),\n _c(\"el-table-column\", {\n attrs: {\n prop: \"actualTriggerTime\",\n label: _vm.$t(\"message.triggerTime\")\n }\n }),\n _c(\"el-table-column\", {\n attrs: {\n prop: \"finishedTime\",\n label: _vm.$t(\"message.finishedTime\")\n }\n }),\n _c(\"el-table-column\", {\n attrs: { label: \"操作\", width: \"300\" },\n scopedSlots: _vm._u([\n {\n key: \"default\",\n fn: function(scope) {\n return [\n _c(\n \"el-button\",\n {\n attrs: { size: \"mini\", type: \"primary\" },\n on: {\n click: function($event) {\n return _vm.onClickShowDetail(scope.row)\n }\n }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.detail\")))]\n ),\n _c(\n \"el-button\",\n {\n attrs: { size: \"mini\", type: \"success\" },\n on: {\n click: function($event) {\n return _vm.onClickShowLog(scope.row)\n }\n }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.log\")))]\n ),\n _c(\n \"el-button\",\n {\n attrs: { size: \"mini\", type: \"warning\" },\n on: {\n click: function($event) {\n return _vm.onClickRetryJob(scope.row)\n }\n }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.reRun\")))]\n ),\n _c(\n \"el-button\",\n {\n attrs: { size: \"mini\", type: \"danger\" },\n on: {\n click: function($event) {\n return _vm.onClickStop(scope.row)\n }\n }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.stop\")))]\n )\n ]\n }\n }\n ])\n })\n ],\n 1\n )\n ],\n 1\n ),\n _c(\n \"el-row\",\n [\n _c(\n \"el-col\",\n { attrs: { span: 24 } },\n [\n _c(\"el-pagination\", {\n attrs: {\n total: this.instancePageResult.totalItems,\n \"page-size\": this.instancePageResult.pageSize,\n layout: \"prev, pager, next\"\n },\n on: { \"current-change\": _vm.onClickChangeInstancePage }\n })\n ],\n 1\n )\n ],\n 1\n ),\n _vm.instanceDetailVisible\n ? _c(\n \"el-dialog\",\n {\n attrs: { visible: _vm.instanceDetailVisible, width: \"80%\" },\n on: {\n \"update:visible\": function($event) {\n _vm.instanceDetailVisible = $event\n }\n }\n },\n [\n _c(\"InstanceDetail\", {\n attrs: { \"instance-id\": _vm.currentInstanceId }\n })\n ],\n 1\n )\n : _vm._e(),\n _c(\n \"el-dialog\",\n {\n attrs: { visible: _vm.instanceLogVisible, width: \"80%\" },\n on: {\n \"update:visible\": function($event) {\n _vm.instanceLogVisible = $event\n }\n }\n },\n [\n _c(\n \"el-row\",\n [\n _c(\n \"el-col\",\n {\n staticStyle: { \"margin-bottom\": \"20px\" },\n attrs: { span: 4, offset: 20 }\n },\n [\n _c(\n \"el-button\",\n {\n attrs: {\n type: \"primary\",\n size: \"mini\",\n icon: \"el-icon-download\"\n },\n on: {\n click: function($event) {\n return _vm.onclickDownloadLog()\n }\n }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.download\")))]\n )\n ],\n 1\n )\n ],\n 1\n ),\n _c(\n \"el-row\",\n [\n _c(\"el-col\", { attrs: { span: 24 } }, [\n _c(\"h4\", { staticStyle: { \"white-space\": \"pre-line\" } }, [\n _vm._v(\" \" + _vm._s(this.paginableInstanceLog.data) + \" \")\n ])\n ])\n ],\n 1\n ),\n _c(\n \"el-row\",\n [\n _c(\n \"el-col\",\n { attrs: { span: 24 } },\n [\n _c(\"el-pagination\", {\n attrs: {\n \"page-count\": _vm.paginableInstanceLog.totalPages,\n layout: \"prev, pager, next\"\n },\n on: { \"current-change\": _vm.onClickChangeLogPage }\n })\n ],\n 1\n )\n ],\n 1\n )\n ],\n 1\n )\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./src/components/views/InstanceManager.vue?./node_modules/cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%22f7b44cbc-vue-loader-template%22%7D!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n { attrs: { id: \"instance_manager\" } },\n [\n _c(\n \"el-row\",\n [\n _c(\n \"el-col\",\n { attrs: { span: 22 } },\n [\n _c(\n \"el-form\",\n {\n staticClass: \"el-form--inline\",\n attrs: { inline: true, model: _vm.instanceQueryContent }\n },\n [\n _c(\n \"el-form-item\",\n { attrs: { label: _vm.$t(\"message.jobId\") } },\n [\n _c(\"el-input\", {\n attrs: { placeholder: _vm.$t(\"message.jobId\") },\n model: {\n value: _vm.instanceQueryContent.jobId,\n callback: function($$v) {\n _vm.$set(_vm.instanceQueryContent, \"jobId\", $$v)\n },\n expression: \"instanceQueryContent.jobId\"\n }\n })\n ],\n 1\n ),\n _c(\n \"el-form-item\",\n { attrs: { label: _vm.$t(\"message.instanceId\") } },\n [\n _c(\"el-input\", {\n attrs: { placeholder: _vm.$t(\"message.instanceId\") },\n model: {\n value: _vm.instanceQueryContent.instanceId,\n callback: function($$v) {\n _vm.$set(\n _vm.instanceQueryContent,\n \"instanceId\",\n $$v\n )\n },\n expression: \"instanceQueryContent.instanceId\"\n }\n })\n ],\n 1\n ),\n _vm.instanceQueryContent.type === \"WORKFLOW\"\n ? _c(\n \"el-form-item\",\n { attrs: { label: _vm.$t(\"message.wfInstanceId\") } },\n [\n _c(\"el-input\", {\n attrs: {\n placeholder: _vm.$t(\"message.wfInstanceId\")\n },\n model: {\n value: _vm.instanceQueryContent.wfInstanceId,\n callback: function($$v) {\n _vm.$set(\n _vm.instanceQueryContent,\n \"wfInstanceId\",\n $$v\n )\n },\n expression: \"instanceQueryContent.wfInstanceId\"\n }\n })\n ],\n 1\n )\n : _vm._e(),\n _c(\n \"el-form-item\",\n { attrs: { label: _vm.$t(\"message.status\") } },\n [\n _c(\n \"el-select\",\n {\n attrs: { placeholder: _vm.$t(\"message.status\") },\n model: {\n value: _vm.instanceQueryContent.status,\n callback: function($$v) {\n _vm.$set(_vm.instanceQueryContent, \"status\", $$v)\n },\n expression: \"instanceQueryContent.status\"\n }\n },\n _vm._l(_vm.instanceStatusOptions, function(item) {\n return _c(\"el-option\", {\n key: item.key,\n attrs: { label: item.label, value: item.key }\n })\n }),\n 1\n )\n ],\n 1\n ),\n _c(\n \"el-form-item\",\n [\n _c(\n \"el-button\",\n {\n attrs: { type: \"primary\" },\n on: { click: _vm.listInstanceInfos }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.query\")))]\n ),\n _c(\n \"el-button\",\n {\n attrs: { type: \"cancel\" },\n on: { click: _vm.onClickRest }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.reset\")))]\n )\n ],\n 1\n )\n ],\n 1\n )\n ],\n 1\n ),\n _c(\"el-col\", { attrs: { span: 2 } }, [\n _c(\n \"div\",\n { staticStyle: { float: \"right\", \"padding-right\": \"10px\" } },\n [\n _c(\n \"el-button\",\n {\n attrs: { type: \"primary\" },\n on: { click: _vm.listInstanceInfos }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.refresh\")))]\n )\n ],\n 1\n )\n ])\n ],\n 1\n ),\n _c(\n \"el-tabs\",\n {\n attrs: { type: \"card\" },\n on: { \"tab-click\": _vm.listInstanceInfos },\n model: {\n value: _vm.instanceQueryContent.type,\n callback: function($$v) {\n _vm.$set(_vm.instanceQueryContent, \"type\", $$v)\n },\n expression: \"instanceQueryContent.type\"\n }\n },\n [\n _c(\"el-tab-pane\", {\n attrs: { label: _vm.$t(\"message.normalInstance\"), name: \"NORMAL\" }\n }),\n _c(\"el-tab-pane\", {\n attrs: { label: _vm.$t(\"message.wfInstance\"), name: \"WORKFLOW\" }\n })\n ],\n 1\n ),\n _c(\n \"el-row\",\n [\n _c(\n \"el-table\",\n {\n staticStyle: { width: \"100%\" },\n attrs: {\n data: _vm.instancePageResult.data,\n \"row-class-name\": _vm.instanceTableRowClassName\n }\n },\n [\n _c(\"el-table-column\", {\n attrs: {\n prop: \"jobId\",\n label: _vm.$t(\"message.jobId\"),\n width: \"80\"\n }\n }),\n _c(\"el-table-column\", {\n attrs: { prop: \"jobName\", label: _vm.$t(\"message.jobName\") }\n }),\n _vm.instanceQueryContent.type === \"WORKFLOW\"\n ? _c(\"el-table-column\", {\n attrs: {\n prop: \"wfInstanceId\",\n label: _vm.$t(\"message.wfInstanceId\")\n }\n })\n : _vm._e(),\n _c(\"el-table-column\", {\n attrs: {\n prop: \"instanceId\",\n label: _vm.$t(\"message.instanceId\")\n }\n }),\n _c(\"el-table-column\", {\n attrs: {\n prop: \"status\",\n label: _vm.$t(\"message.status\"),\n width: \"160\"\n },\n scopedSlots: _vm._u([\n {\n key: \"default\",\n fn: function(scope) {\n return [\n _vm._v(\n \" \" + _vm._s(_vm.fetchStatus(scope.row.status)) + \" \"\n )\n ]\n }\n }\n ])\n }),\n _c(\"el-table-column\", {\n attrs: {\n prop: \"actualTriggerTime\",\n label: _vm.$t(\"message.triggerTime\")\n }\n }),\n _c(\"el-table-column\", {\n attrs: {\n prop: \"finishedTime\",\n label: _vm.$t(\"message.finishedTime\")\n }\n }),\n _c(\"el-table-column\", {\n attrs: { label: _vm.$t(\"message.operation\"), width: \"300\" },\n scopedSlots: _vm._u([\n {\n key: \"default\",\n fn: function(scope) {\n return [\n _c(\n \"el-button\",\n {\n attrs: { size: \"mini\", type: \"primary\" },\n on: {\n click: function($event) {\n return _vm.onClickShowDetail(scope.row)\n }\n }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.detail\")))]\n ),\n _c(\n \"el-button\",\n {\n attrs: { size: \"mini\", type: \"success\" },\n on: {\n click: function($event) {\n return _vm.onClickShowLog(scope.row)\n }\n }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.log\")))]\n ),\n _c(\n \"el-button\",\n {\n attrs: { size: \"mini\", type: \"warning\" },\n on: {\n click: function($event) {\n return _vm.onClickRetryJob(scope.row)\n }\n }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.reRun\")))]\n ),\n _c(\n \"el-button\",\n {\n attrs: { size: \"mini\", type: \"danger\" },\n on: {\n click: function($event) {\n return _vm.onClickStop(scope.row)\n }\n }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.stop\")))]\n )\n ]\n }\n }\n ])\n })\n ],\n 1\n )\n ],\n 1\n ),\n _c(\n \"el-row\",\n [\n _c(\n \"el-col\",\n { attrs: { span: 24 } },\n [\n _c(\"el-pagination\", {\n attrs: {\n total: this.instancePageResult.totalItems,\n \"page-size\": this.instancePageResult.pageSize,\n layout: \"prev, pager, next\"\n },\n on: { \"current-change\": _vm.onClickChangeInstancePage }\n })\n ],\n 1\n )\n ],\n 1\n ),\n _vm.instanceDetailVisible\n ? _c(\n \"el-dialog\",\n {\n attrs: { visible: _vm.instanceDetailVisible, width: \"80%\" },\n on: {\n \"update:visible\": function($event) {\n _vm.instanceDetailVisible = $event\n }\n }\n },\n [\n _c(\"InstanceDetail\", {\n attrs: { \"instance-id\": _vm.currentInstanceId }\n })\n ],\n 1\n )\n : _vm._e(),\n _c(\n \"el-dialog\",\n {\n attrs: { visible: _vm.instanceLogVisible, width: \"80%\" },\n on: {\n \"update:visible\": function($event) {\n _vm.instanceLogVisible = $event\n }\n }\n },\n [\n _c(\n \"el-row\",\n [\n _c(\n \"el-col\",\n {\n staticStyle: { \"margin-bottom\": \"20px\" },\n attrs: { span: 4, offset: 20 }\n },\n [\n _c(\n \"el-button\",\n {\n attrs: {\n type: \"primary\",\n size: \"mini\",\n icon: \"el-icon-download\"\n },\n on: {\n click: function($event) {\n return _vm.onclickDownloadLog()\n }\n }\n },\n [_vm._v(_vm._s(_vm.$t(\"message.download\")))]\n )\n ],\n 1\n )\n ],\n 1\n ),\n _c(\n \"el-row\",\n [\n _c(\"el-col\", { attrs: { span: 24 } }, [\n _c(\"h4\", { staticStyle: { \"white-space\": \"pre-line\" } }, [\n _vm._v(\" \" + _vm._s(this.paginableInstanceLog.data) + \" \")\n ])\n ])\n ],\n 1\n ),\n _c(\n \"el-row\",\n [\n _c(\n \"el-col\",\n { attrs: { span: 24 } },\n [\n _c(\"el-pagination\", {\n attrs: {\n \"page-count\": _vm.paginableInstanceLog.totalPages,\n layout: \"prev, pager, next\"\n },\n on: { \"current-change\": _vm.onClickChangeLogPage }\n })\n ],\n 1\n )\n ],\n 1\n )\n ],\n 1\n )\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./src/components/views/InstanceManager.vue?./node_modules/cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%22f7b44cbc-vue-loader-template%22%7D!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }),