mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 11:52:08 +08:00
ZK-增加配置的默认值
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
package com.xiaojukeji.know.streaming.km.common.bean.entity.config;
|
package com.xiaojukeji.know.streaming.km.common.bean.entity.config;
|
||||||
|
|
||||||
|
import com.xiaojukeji.know.streaming.km.common.constant.Constant;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
@@ -11,7 +11,6 @@ import java.util.Properties;
|
|||||||
* @author zengqiao
|
* @author zengqiao
|
||||||
* @date 22/02/24
|
* @date 22/02/24
|
||||||
*/
|
*/
|
||||||
@Data
|
|
||||||
@ApiModel(description = "ZK配置")
|
@ApiModel(description = "ZK配置")
|
||||||
public class ZKConfig implements Serializable {
|
public class ZKConfig implements Serializable {
|
||||||
@ApiModelProperty(value="ZK的jmx配置")
|
@ApiModelProperty(value="ZK的jmx配置")
|
||||||
@@ -21,11 +20,51 @@ public class ZKConfig implements Serializable {
|
|||||||
private Boolean openSecure = false;
|
private Boolean openSecure = false;
|
||||||
|
|
||||||
@ApiModelProperty(value="ZK的Session超时时间", example = "15000")
|
@ApiModelProperty(value="ZK的Session超时时间", example = "15000")
|
||||||
private Long sessionTimeoutUnitMs = 15000L;
|
private Integer sessionTimeoutUnitMs = 15000;
|
||||||
|
|
||||||
@ApiModelProperty(value="ZK的Request超时时间", example = "5000")
|
@ApiModelProperty(value="ZK的Request超时时间", example = "5000")
|
||||||
private Long requestTimeoutUnitMs = 5000L;
|
private Integer requestTimeoutUnitMs = 5000;
|
||||||
|
|
||||||
@ApiModelProperty(value="ZK的Request超时时间")
|
@ApiModelProperty(value="ZK的Request超时时间")
|
||||||
private Properties otherProps = new Properties();
|
private Properties otherProps = new Properties();
|
||||||
|
|
||||||
|
public JmxConfig getJmxConfig() {
|
||||||
|
return jmxConfig == null? new JmxConfig(): jmxConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJmxConfig(JmxConfig jmxConfig) {
|
||||||
|
this.jmxConfig = jmxConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getOpenSecure() {
|
||||||
|
return openSecure != null && openSecure;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpenSecure(Boolean openSecure) {
|
||||||
|
this.openSecure = openSecure;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSessionTimeoutUnitMs() {
|
||||||
|
return sessionTimeoutUnitMs == null? Constant.DEFAULT_SESSION_TIMEOUT_UNIT_MS: sessionTimeoutUnitMs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSessionTimeoutUnitMs(Integer sessionTimeoutUnitMs) {
|
||||||
|
this.sessionTimeoutUnitMs = sessionTimeoutUnitMs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRequestTimeoutUnitMs() {
|
||||||
|
return requestTimeoutUnitMs == null? Constant.DEFAULT_REQUEST_TIMEOUT_UNIT_MS: requestTimeoutUnitMs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequestTimeoutUnitMs(Integer requestTimeoutUnitMs) {
|
||||||
|
this.requestTimeoutUnitMs = requestTimeoutUnitMs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Properties getOtherProps() {
|
||||||
|
return otherProps == null? new Properties() : otherProps;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOtherProps(Properties otherProps) {
|
||||||
|
this.otherProps = otherProps;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ public class Constant {
|
|||||||
public static final Integer YES = 1;
|
public static final Integer YES = 1;
|
||||||
public static final Integer NO = 0;
|
public static final Integer NO = 0;
|
||||||
|
|
||||||
public static final Integer ALIVE = 1;
|
public static final Integer ALIVE = 1;
|
||||||
public static final Integer DOWN = 0;
|
public static final Integer DOWN = 0;
|
||||||
|
|
||||||
public static final Integer ONE_HUNDRED = 100;
|
public static final Integer ONE_HUNDRED = 100;
|
||||||
|
|
||||||
@@ -33,6 +33,7 @@ public class Constant {
|
|||||||
public static final Long B_TO_MB = 1024L * 1024L;
|
public static final Long B_TO_MB = 1024L * 1024L;
|
||||||
|
|
||||||
public static final Integer DEFAULT_SESSION_TIMEOUT_UNIT_MS = 15000;
|
public static final Integer DEFAULT_SESSION_TIMEOUT_UNIT_MS = 15000;
|
||||||
|
public static final Integer DEFAULT_REQUEST_TIMEOUT_UNIT_MS = 5000;
|
||||||
|
|
||||||
public static final Float MIN_HEALTH_SCORE = 10f;
|
public static final Float MIN_HEALTH_SCORE = 10f;
|
||||||
|
|
||||||
@@ -66,4 +67,5 @@ public class Constant {
|
|||||||
|
|
||||||
public static final Integer DEFAULT_RETRY_TIME = 3;
|
public static final Integer DEFAULT_RETRY_TIME = 3;
|
||||||
|
|
||||||
|
public static final Integer ZK_ALIVE_BUT_4_LETTER_FORBIDDEN = 11;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user