docs: review translation

This commit is contained in:
tjq 2021-01-10 11:54:16 +08:00
parent b97c26c78b
commit 5feaf6106e
12 changed files with 44 additions and 46 deletions

View File

@ -4,7 +4,7 @@ import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
/** /**
* 处理器类型 * Task Processor Type
* *
* @author tjq * @author tjq
* @since 2020/3/23 * @since 2020/3/23
@ -18,8 +18,8 @@ public enum ProcessorType {
PYTHON(3, "Python脚本"), PYTHON(3, "Python脚本"),
JAVA_CONTAINER(4, "Java容器"); JAVA_CONTAINER(4, "Java容器");
private int v; private final int v;
private String des; private final String des;
public static ProcessorType of(int v) { public static ProcessorType of(int v) {
for (ProcessorType type : values()) { for (ProcessorType type : values()) {

View File

@ -7,7 +7,7 @@ import lombok.Getter;
import java.util.List; import java.util.List;
/** /**
* 时间表达式类型 * Scheduling time strategies
* *
* @author tjq * @author tjq
* @since 2020/3/30 * @since 2020/3/30
@ -18,7 +18,9 @@ public enum TimeExpressionType {
API(1), API(1),
CRON(2), CRON(2),
// FIXED_RATE
FIX_RATE(3), FIX_RATE(3),
// FIXED_DELAY
FIX_DELAY(4), FIX_DELAY(4),
WORKFLOW(5); WORKFLOW(5);

View File

@ -6,7 +6,7 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/** /**
* The class for deployed container. * Deployed Container Information
* *
* @author tjq * @author tjq
* @since 2020/5/18 * @since 2020/5/18
@ -29,7 +29,7 @@ public class DeployedContainerInfo implements OmsSerializable {
*/ */
private long deployedTime; private long deployedTime;
/** /**
* Address of the server. Report is not required. * No need to report to the server
*/ */
private String workerAddress; private String workerAddress;
} }

View File

@ -7,7 +7,7 @@ import lombok.NoArgsConstructor;
import java.util.List; import java.util.List;
/** /**
* Detailed info of task instances. * Detailed info of job instances.
* *
* @author tjq * @author tjq
* @since 2020/4/11 * @since 2020/4/11
@ -32,17 +32,14 @@ public class InstanceDetail implements OmsSerializable {
* Status of the task instance. * Status of the task instance.
*/ */
private Integer status; private Integer status;
// 任务执行结果可能不存在
/** /**
* Execution result, which may be null. * Execution result, which may be null.
*/ */
private String result; private String result;
// TaskTracker地址
/** /**
* Task tracker address. * Task tracker address.
*/ */
private String taskTrackerAddress; private String taskTrackerAddress;
// 启动参数
/** /**
* Param string that is passed to an instance when it is initialized. * Param string that is passed to an instance when it is initialized.
*/ */

View File

@ -71,20 +71,17 @@ public class SystemMetrics implements OmsSerializable, Comparable<SystemMetrics>
* @return score * @return score
*/ */
public int calculateScore() { public int calculateScore() {
if (score > 0) {
if (score > 0) { return score;
return score; }
} // Memory is vital to TaskTracker, so we set the multiplier factor as 2.
double memScore = (jvmMaxMemory - jvmUsedMemory) * 2;
// Memory is vital to TaskTracker, so we set the multiplier factor as 2. // Calculate the remaining load of CPU. Multiplier is set as 1.
double memScore = (jvmMaxMemory - jvmUsedMemory) * 2; double cpuScore = cpuProcessors - cpuLoad;
// Calculate the remaining load of CPU. Multiplier is set as 1. // Windows can not fetch CPU load, set cpuScore as 1.
double cpuScore = cpuProcessors - cpuLoad; if (cpuScore > cpuProcessors) {
// Windows can not fetch CPU load, set cpuScore as 1. cpuScore = 1;
if (cpuScore > cpuProcessors) {
cpuScore = 1;
} }
score = (int) (memScore + cpuScore); score = (int) (memScore + cpuScore);
return score; return score;
} }
@ -93,8 +90,8 @@ public class SystemMetrics implements OmsSerializable, Comparable<SystemMetrics>
* Judge if the machine is available. * Judge if the machine is available.
* *
* @param minCPUCores Minimum available CPU cores. * @param minCPUCores Minimum available CPU cores.
* @param minMemorySpace 判断标准之最低可用内存 * @param minMemorySpace Minimum available memory size
* @param minDiskSpace Minimum disk space 判断标准之最低可用磁盘空间 * @param minDiskSpace Minimum disk space
* @return {@code boolean} whether the machine is available. * @return {@code boolean} whether the machine is available.
*/ */
public boolean available(double minCPUCores, double minMemorySpace, double minDiskSpace) { public boolean available(double minCPUCores, double minMemorySpace, double minDiskSpace) {
@ -106,8 +103,8 @@ public class SystemMetrics implements OmsSerializable, Comparable<SystemMetrics>
return false; return false;
} }
// Negative number means being unable to fetch CPU info, return true.
// 0 indicates the CPU is free, which is the optimal condition. // 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) { if (cpuLoad <= 0 || minCPUCores <= 0) {
return true; return true;
} }

View File

@ -18,7 +18,7 @@ import java.util.List;
public class SaveJobInfoRequest { 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; private Long id;
/* ************************** Base info of related job. ************************** */ /* ************************** Base info of related job. ************************** */
@ -105,11 +105,6 @@ public class SaveJobInfoRequest {
*/ */
private double minDiskSpace = 0; 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; private boolean enable = true;
@ -117,6 +112,7 @@ public class SaveJobInfoRequest {
/** /**
* Designated PowerJob-worker nodes. Blank value indicates that there is * Designated PowerJob-worker nodes. Blank value indicates that there is
* no limit. Non-blank value means to run the corresponding machine(s) only. * 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; private String designatedWorkers;
/** /**

View File

@ -7,7 +7,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
/** /**
* SpringBoot entry. * powerjob-server entry
* *
* @author tjq * @author tjq
* @since 2020/3/29 * @since 2020/3/29
@ -26,10 +26,9 @@ public class OhMyApplication {
public static void main(String[] args) { public static void main(String[] args) {
// Print tips before starting.
pre(); pre();
// Init ActorSystem // Init ActorSystem first
OhMyServer.init(); OhMyServer.init();
// Start SpringBoot application. // Start SpringBoot application.

View File

@ -14,7 +14,8 @@ spring.datasource.core.hikari.minimum-idle=5
oms.mongodb.enable=true oms.mongodb.enable=true
spring.data.mongodb.uri=mongodb+srv://zqq:No1Bug2Please3!@cluster0.wie54.gcp.mongodb.net/powerjob_daily?retryWrites=true&w=majority 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.host=smtp.163.com
spring.mail.username=zqq@163.com spring.mail.username=zqq@163.com
spring.mail.password=GOFZPNARMVKCGONV 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.enable=true
spring.mail.properties.mail.smtp.starttls.required=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-key=dingauqwkvxxnqskknfv
oms.alarm.ding.app-secret=XWrEPdAZMPgJeFtHuL0LH73LRj-74umF2_0BFcoXMfvnX0pCQvt0rpb1JOJU_HLl oms.alarm.ding.app-secret=XWrEPdAZMPgJeFtHuL0LH73LRj-74umF2_0BFcoXMfvnX0pCQvt0rpb1JOJU_HLl
oms.alarm.ding.agent-id=847044348 oms.alarm.ding.agent-id=847044348
@ -35,6 +37,6 @@ oms.container.retention.remote=-1
####### Cache properties ####### ####### Cache properties #######
oms.instance.metadata.cache.size=1024 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. ####### ####### split-brain could be avoided while performance overhead would increase. #######
oms.accurate.select.server.percentage = 50 oms.accurate.select.server.percentage = 50

View File

@ -14,7 +14,8 @@ spring.datasource.core.hikari.minimum-idle=5
oms.mongodb.enable=true oms.mongodb.enable=true
spring.data.mongodb.uri=mongodb://remotehost:27017/powerjob-pre 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.host=smtp.qq.com
spring.mail.username=zqq spring.mail.username=zqq
spring.mail.password=qqz 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.enable=true
spring.mail.properties.mail.smtp.starttls.required=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-key=dingauqwkvxxnqskknfv
oms.alarm.ding.app-secret=XWrEPdAZMPgJeFtHuL0LH73LRj-74umF2_0BFcoXMfvnX0pCQvt0rpb1JOJU_HLl oms.alarm.ding.app-secret=XWrEPdAZMPgJeFtHuL0LH73LRj-74umF2_0BFcoXMfvnX0pCQvt0rpb1JOJU_HLl
oms.alarm.ding.agent-id=847044348 oms.alarm.ding.agent-id=847044348
@ -35,6 +37,6 @@ oms.container.retention.remote=-1
####### Cache properties ####### ####### Cache properties #######
oms.instance.metadata.cache.size=1024 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. ####### ####### split-brain could be avoided while performance overhead would increase. #######
oms.accurate.select.server.percentage = 50 oms.accurate.select.server.percentage = 50

View File

@ -14,7 +14,8 @@ spring.datasource.core.hikari.minimum-idle=5
oms.mongodb.enable=true oms.mongodb.enable=true
spring.data.mongodb.uri=mongodb://localhost:27017/powerjob-product 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.host=smtp.qq.com
spring.mail.username=zqq spring.mail.username=zqq
spring.mail.password=qqz 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.enable=true
spring.mail.properties.mail.smtp.starttls.required=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-key=
oms.alarm.ding.app-secret= oms.alarm.ding.app-secret=
oms.alarm.ding.agent-id= oms.alarm.ding.agent-id=
@ -35,6 +37,6 @@ oms.container.retention.remote=-1
####### Cache properties ####### ####### Cache properties #######
oms.instance.metadata.cache.size=2048 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. ####### ####### split-brain could be avoided while performance overhead would increase. #######
oms.accurate.select.server.percentage = 50 oms.accurate.select.server.percentage = 50

View File

@ -50,6 +50,7 @@
</dependencies> </dependencies>
<!-- 谁说SpringBoot的打包插件只能给SpringBoot用的省的我写一堆配置还有BUG... -->
<build> <build>
<plugins> <plugins>
<plugin> <plugin>

View File

@ -11,13 +11,13 @@ import picocli.CommandLine.Command;
import picocli.CommandLine.Option; import picocli.CommandLine.Option;
/** /**
* 启动类 * powerjob-worker-agent entry
* *
* @author tjq * @author tjq
* @since 2020/5/20 * @since 2020/5/20
*/ */
@Slf4j @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 { public class MainApplication implements Runnable {
@Option(names = {"-a", "--app"}, description = "worker-agent's name", required = true) @Option(names = {"-a", "--app"}, description = "worker-agent's name", required = true)