Skip to content

Commit 23317ad

Browse files
author
dapeng
committed
重启测试增加failure.interval和delay.interval参数
1 parent e035d74 commit 23317ad

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ sh submit.sh -sql D:\sideSql.txt -name xctest -remoteSqlPluginPath /opt/dtstack
149149
* taskmanager.slots:per_job模式下指定每个taskmanager对应的slot数量(默认1)
150150
* savePointPath:任务恢复点的路径(默认无)
151151
* allowNonRestoredState:指示保存点是否允许非还原状态的标志(默认false)
152+
* restore.enable:是否失败重启(默认是true)
153+
* failure.interval:衡量失败率的时间段,单位分钟(默认6m)
154+
* delay.interval:连续两次重启尝试间的间隔,单位是秒(默认10s)
152155
* [prometheus 相关参数](docs/prometheus.md) per_job可指定metric写入到外部监控组件,以prometheus pushgateway举例
153156

154157

core/src/main/java/com/dtstack/flink/sql/constrant/ConfigConstrant.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public class ConfigConstrant {
6969
// restart plocy
7070
public static final int failureRate = 3;
7171

72-
public static final int failureInterval = 6; //min
72+
public static final String FAILUREINTERVAL = "failure.interval"; //min
7373

74-
public static final int delayInterval = 10; //sec
74+
public static final String DELAYINTERVAL= "delay.interval"; //sec
7575

7676
}

core/src/main/java/com/dtstack/flink/sql/environment/StreamEnvConfigManager.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ public static void streamExecutionEnvironmentConfig(StreamExecutionEnvironment s
104104
if(isRestore(confProperties).get()){
105105
streamEnv.setRestartStrategy(RestartStrategies.failureRateRestart(
106106
ConfigConstrant.failureRate,
107-
Time.of(ConfigConstrant.failureInterval, TimeUnit.MINUTES),
108-
Time.of(ConfigConstrant.delayInterval, TimeUnit.SECONDS)
107+
Time.of(getFailureInterval(confProperties).get(), TimeUnit.MINUTES),
108+
Time.of(getDelayInterval(confProperties).get(), TimeUnit.SECONDS)
109109
));
110110
} else {
111111
streamEnv.setRestartStrategy(RestartStrategies.noRestart());
@@ -172,6 +172,15 @@ public static Optional<Boolean> isRestore(Properties properties){
172172
return Optional.of(Boolean.valueOf(restoreEnable));
173173
}
174174

175+
public static Optional<Integer> getDelayInterval(Properties properties){
176+
String delayInterval = properties.getProperty(ConfigConstrant.DELAYINTERVAL, "10");
177+
return Optional.of(Integer.valueOf(delayInterval));
178+
}
179+
public static Optional<Integer> getFailureInterval(Properties properties){
180+
String failureInterval = properties.getProperty(ConfigConstrant.FAILUREINTERVAL, "6");
181+
return Optional.of(Integer.valueOf(failureInterval));
182+
}
183+
175184
/**
176185
* #ProcessingTime(默认), IngestionTime, EventTime
177186
* @param properties

0 commit comments

Comments
 (0)