Skip to content

Commit 5feaf61

Browse files
committed
docs: review translation
1 parent b97c26c commit 5feaf61

File tree

12 files changed

+44
-46
lines changed

12 files changed

+44
-46
lines changed

powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/ProcessorType.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import lombok.Getter;
55

66
/**
7-
* 处理器类型
7+
* Task Processor Type
88
*
99
* @author tjq
1010
* @since 2020/3/23
@@ -18,8 +18,8 @@ public enum ProcessorType {
1818
PYTHON(3, "Python脚本"),
1919
JAVA_CONTAINER(4, "Java容器");
2020

21-
private int v;
22-
private String des;
21+
private final int v;
22+
private final String des;
2323

2424
public static ProcessorType of(int v) {
2525
for (ProcessorType type : values()) {

powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/TimeExpressionType.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import java.util.List;
88

99
/**
10-
* 时间表达式类型
10+
* Scheduling time strategies
1111
*
1212
* @author tjq
1313
* @since 2020/3/30
@@ -18,7 +18,9 @@ public enum TimeExpressionType {
1818

1919
API(1),
2020
CRON(2),
21+
// FIXED_RATE
2122
FIX_RATE(3),
23+
// FIXED_DELAY
2224
FIX_DELAY(4),
2325
WORKFLOW(5);
2426

powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/DeployedContainerInfo.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import lombok.NoArgsConstructor;
77

88
/**
9-
* The class for deployed container.
9+
* Deployed Container Information
1010
*
1111
* @author tjq
1212
* @since 2020/5/18
@@ -29,7 +29,7 @@ public class DeployedContainerInfo implements OmsSerializable {
2929
*/
3030
private long deployedTime;
3131
/**
32-
* Address of the server. Report is not required.
32+
* No need to report to the server
3333
*/
3434
private String workerAddress;
3535
}

powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/InstanceDetail.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import java.util.List;
88

99
/**
10-
* Detailed info of task instances.
10+
* Detailed info of job instances.
1111
*
1212
* @author tjq
1313
* @since 2020/4/11
@@ -32,17 +32,14 @@ public class InstanceDetail implements OmsSerializable {
3232
* Status of the task instance.
3333
*/
3434
private Integer status;
35-
// 任务执行结果(可能不存在)
3635
/**
3736
* Execution result, which may be null.
3837
*/
3938
private String result;
40-
// TaskTracker地址
4139
/**
4240
* Task tracker address.
4341
*/
4442
private String taskTrackerAddress;
45-
// 启动参数
4643
/**
4744
* Param string that is passed to an instance when it is initialized.
4845
*/

powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/model/SystemMetrics.java

+13-16
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,17 @@ public int compareTo(SystemMetrics that) {
7171
* @return score
7272
*/
7373
public int calculateScore() {
74-
75-
if (score > 0) {
76-
return score;
77-
}
78-
79-
// Memory is vital to TaskTracker, so we set the multiplier factor as 2.
80-
double memScore = (jvmMaxMemory - jvmUsedMemory) * 2;
81-
// Calculate the remaining load of CPU. Multiplier is set as 1.
82-
double cpuScore = cpuProcessors - cpuLoad;
83-
// Windows can not fetch CPU load, set cpuScore as 1.
84-
if (cpuScore > cpuProcessors) {
85-
cpuScore = 1;
74+
if (score > 0) {
75+
return score;
76+
}
77+
// Memory is vital to TaskTracker, so we set the multiplier factor as 2.
78+
double memScore = (jvmMaxMemory - jvmUsedMemory) * 2;
79+
// Calculate the remaining load of CPU. Multiplier is set as 1.
80+
double cpuScore = cpuProcessors - cpuLoad;
81+
// Windows can not fetch CPU load, set cpuScore as 1.
82+
if (cpuScore > cpuProcessors) {
83+
cpuScore = 1;
8684
}
87-
8885
score = (int) (memScore + cpuScore);
8986
return score;
9087
}
@@ -93,8 +90,8 @@ public int calculateScore() {
9390
* Judge if the machine is available.
9491
*
9592
* @param minCPUCores Minimum available CPU cores.
96-
* @param minMemorySpace 判断标准之最低可用内存
97-
* @param minDiskSpace Minimum disk space 判断标准之最低可用磁盘空间
93+
* @param minMemorySpace Minimum available memory size
94+
* @param minDiskSpace Minimum disk space
9895
* @return {@code boolean} whether the machine is available.
9996
*/
10097
public boolean available(double minCPUCores, double minMemorySpace, double minDiskSpace) {
@@ -106,8 +103,8 @@ public boolean available(double minCPUCores, double minMemorySpace, double minDi
106103
return false;
107104
}
108105

109-
// Negative number means being unable to fetch CPU info, return true.
110106
// 0 indicates the CPU is free, which is the optimal condition.
107+
// Negative number means being unable to fetch CPU info, return true.
111108
if (cpuLoad <= 0 || minCPUCores <= 0) {
112109
return true;
113110
}

powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/request/http/SaveJobInfoRequest.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
public class SaveJobInfoRequest {
1919

2020
/**
21-
* id of the job. set null to save or non-null to update the job.
21+
* id of the job. set null to create or non-null to update the job.
2222
*/
2323
private Long id;
2424
/* ************************** Base info of related job. ************************** */
@@ -105,18 +105,14 @@ public class SaveJobInfoRequest {
105105
*/
106106
private double minDiskSpace = 0;
107107

108-
/**
109-
* {@code 1} indicates that the worker node is running well,
110-
* {@code 2} indicates that the worker node has been inactive
111-
* and future tasks will not be assigned to the node.
112-
*/
113108
private boolean enable = true;
114109

115110

116111
/* ************************** PowerJob-worker cluster property ************************** */
117112
/**
118113
* Designated PowerJob-worker nodes. Blank value indicates that there is
119114
* no limit. Non-blank value means to run the corresponding machine(s) only.
115+
* example: 192.168.1.1:27777,192.168.1.2:27777
120116
*/
121117
private String designatedWorkers;
122118
/**

powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/OhMyApplication.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.springframework.scheduling.annotation.EnableScheduling;
88

99
/**
10-
* SpringBoot entry.
10+
* powerjob-server entry
1111
*
1212
* @author tjq
1313
* @since 2020/3/29
@@ -26,10 +26,9 @@ public class OhMyApplication {
2626

2727
public static void main(String[] args) {
2828

29-
// Print tips before starting.
3029
pre();
3130

32-
// Init ActorSystem
31+
// Init ActorSystem first
3332
OhMyServer.init();
3433

3534
// Start SpringBoot application.

powerjob-server/src/main/resources/application-daily.properties

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ spring.datasource.core.hikari.minimum-idle=5
1414
oms.mongodb.enable=true
1515
spring.data.mongodb.uri=mongodb+srv://zqq:[email protected]/powerjob_daily?retryWrites=true&w=majority
1616

17-
####### Email properties(Comment out the mail properties if you do not have needs) #######
17+
####### Email properties(Non-core configuration properties) #######
18+
####### Delete the following code to disable the mail #######
1819
spring.mail.host=smtp.163.com
1920
spring.mail.username=[email protected]
2021
spring.mail.password=GOFZPNARMVKCGONV
2122
spring.mail.properties.mail.smtp.auth=true
2223
spring.mail.properties.mail.smtp.starttls.enable=true
2324
spring.mail.properties.mail.smtp.starttls.required=true
2425

25-
####### DingTalk properties(Comment out the DingTalk properties if you do not have needs) #######
26+
####### DingTalk properties(Non-core configuration properties) #######
27+
####### Delete the following code to disable the DingTalk #######
2628
oms.alarm.ding.app-key=dingauqwkvxxnqskknfv
2729
oms.alarm.ding.app-secret=XWrEPdAZMPgJeFtHuL0LH73LRj-74umF2_0BFcoXMfvnX0pCQvt0rpb1JOJU_HLl
2830
oms.alarm.ding.agent-id=847044348
@@ -35,6 +37,6 @@ oms.container.retention.remote=-1
3537
####### Cache properties #######
3638
oms.instance.metadata.cache.size=1024
3739

38-
####### Threshold in fetching server(0~100). 100 means full detection of server, in which #######
40+
####### Threshold in precise fetching server(0~100). 100 means full detection of server, in which #######
3941
####### split-brain could be avoided while performance overhead would increase. #######
4042
oms.accurate.select.server.percentage = 50

powerjob-server/src/main/resources/application-pre.properties

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ spring.datasource.core.hikari.minimum-idle=5
1414
oms.mongodb.enable=true
1515
spring.data.mongodb.uri=mongodb://remotehost:27017/powerjob-pre
1616

17-
####### Email properties(Comment out the mail properties if you do not have needs) #######
17+
####### Email properties(Non-core configuration properties) #######
18+
####### Delete the following code to disable the mail #######
1819
spring.mail.host=smtp.qq.com
1920
spring.mail.username=zqq
2021
spring.mail.password=qqz
2122
spring.mail.properties.mail.smtp.auth=true
2223
spring.mail.properties.mail.smtp.starttls.enable=true
2324
spring.mail.properties.mail.smtp.starttls.required=true
2425

25-
####### DingTalk properties(Comment out the DingTalk properties if you do not have needs) #######
26+
####### DingTalk properties(Non-core configuration properties) #######
27+
####### Delete the following code to disable the DingTalk #######
2628
oms.alarm.ding.app-key=dingauqwkvxxnqskknfv
2729
oms.alarm.ding.app-secret=XWrEPdAZMPgJeFtHuL0LH73LRj-74umF2_0BFcoXMfvnX0pCQvt0rpb1JOJU_HLl
2830
oms.alarm.ding.agent-id=847044348
@@ -35,6 +37,6 @@ oms.container.retention.remote=-1
3537
####### Cache properties #######
3638
oms.instance.metadata.cache.size=1024
3739

38-
####### Threshold in fetching server(0~100). 100 means full detection of server, in which #######
40+
####### Threshold in precise fetching server(0~100). 100 means full detection of server, in which #######
3941
####### split-brain could be avoided while performance overhead would increase. #######
4042
oms.accurate.select.server.percentage = 50

powerjob-server/src/main/resources/application-product.properties

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ spring.datasource.core.hikari.minimum-idle=5
1414
oms.mongodb.enable=true
1515
spring.data.mongodb.uri=mongodb://localhost:27017/powerjob-product
1616

17-
####### Email properties(Comment out the mail properties if you do not have needs) #######
17+
####### Email properties(Non-core configuration properties) #######
18+
####### Delete the following code to disable the mail #######
1819
spring.mail.host=smtp.qq.com
1920
spring.mail.username=zqq
2021
spring.mail.password=qqz
2122
spring.mail.properties.mail.smtp.auth=true
2223
spring.mail.properties.mail.smtp.starttls.enable=true
2324
spring.mail.properties.mail.smtp.starttls.required=true
2425

25-
####### DingTalk properties(Comment out the DingTalk properties if you do not have needs) #######
26+
####### DingTalk properties(Non-core configuration properties) #######
27+
####### Delete the following code to disable the DingTalk #######
2628
oms.alarm.ding.app-key=
2729
oms.alarm.ding.app-secret=
2830
oms.alarm.ding.agent-id=
@@ -35,6 +37,6 @@ oms.container.retention.remote=-1
3537
####### Cache properties #######
3638
oms.instance.metadata.cache.size=2048
3739

38-
####### Threshold in fetching server(0~100). 100 means full detection of server, in which #######
40+
####### Threshold in precise fetching server(0~100). 100 means full detection of server, in which #######
3941
####### split-brain could be avoided while performance overhead would increase. #######
4042
oms.accurate.select.server.percentage = 50

powerjob-worker-agent/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
</dependencies>
5151

5252

53+
<!-- 谁说SpringBoot的打包插件只能给SpringBoot用的?省的我写一堆配置还有BUG... -->
5354
<build>
5455
<plugins>
5556
<plugin>

powerjob-worker-agent/src/main/java/com/github/kfcfans/powerjob/worker/MainApplication.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
import picocli.CommandLine.Option;
1212

1313
/**
14-
* 启动类
14+
* powerjob-worker-agent entry
1515
*
1616
* @author tjq
1717
* @since 2020/5/20
1818
*/
1919
@Slf4j
20-
@Command(name = "OhMyAgent", mixinStandardHelpOptions = true, version = "1.2.0", description = "OhMyScheduler-Worker agent")
20+
@Command(name = "OhMyAgent", mixinStandardHelpOptions = true, version = "3.4.3", description = "powerjob-worker agent")
2121
public class MainApplication implements Runnable {
2222

2323
@Option(names = {"-a", "--app"}, description = "worker-agent's name", required = true)

0 commit comments

Comments
 (0)