Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyuhang0 committed May 19, 2023
1 parent 5bb6f9b commit 72a45ef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 0 additions & 2 deletions core/src/main/scala/com/pingcap/tispark/TiConfigConst.scala
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,5 @@ object TiConfigConst {
val DEFAULT_LOAD_TABLES: Boolean = true
// health check timeout
val GRPC_HEALTH_CHECK_TIMEOUT = "spark.tispark.grpc.health_check_timeout_in_ms"
val DEFAULT_GRPC_HEALTH_CHECK_TIMEOUT = "2000"
val GPRC_HEALTH_CHECK_PERIOD = "spark.tispark.grpc.health_check_period_in_ms"
val DEFAULT_GRPC_HEALTH_CHECK_PERIOD = "3000"
}
4 changes: 2 additions & 2 deletions core/src/main/scala/com/pingcap/tispark/utils/TiUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ object TiUtil {
conf
.get(
TiConfigConst.GRPC_HEALTH_CHECK_TIMEOUT,
TiConfigConst.DEFAULT_GRPC_HEALTH_CHECK_TIMEOUT)
TiConfiguration.DEFHealthCheckTimeout.toString)
.toInt)
tiConf.setHealthCheckPeriod(conf
.get(TiConfigConst.GPRC_HEALTH_CHECK_PERIOD, TiConfigConst.DEFAULT_GRPC_HEALTH_CHECK_PERIOD)
.get(TiConfigConst.GPRC_HEALTH_CHECK_PERIOD, TiConfiguration.DEFHealthCheckPeriod.toString)
.toInt)
tiConf
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,11 @@ public TiConfiguration setCertReloadIntervalInSeconds(String interval) {
private ReplicaReadPolicy replicaReadPolicy = ReplicaReadPolicy.DEFAULT;

private boolean enableGrpcForward = false;
private int healthCheckTimeout;
private int healthCheckPeriod;

public static final int DEFHealthCheckTimeout = 2000;
public static final int DEFHealthCheckPeriod = 3000;
private int healthCheckTimeout = DEFHealthCheckTimeout;
private int healthCheckPeriod = DEFHealthCheckPeriod;

private static Long getTimeAsSeconds(String key) {
return Utils.timeStringAsSec(key);
Expand Down

0 comments on commit 72a45ef

Please sign in to comment.