提交 892e195f 编写于 作者: Z zengqiao

code format

上级 c5b1bed7
package com.xiaojukeji.kafka.manager.common.bizenum;
/**
* @author zengqiao
* @date 20/7/27
*/
public enum ApiLevelEnum {
LEVEL_0(0),
LEVEL_1(1),
LEVEL_2(2),
LEVEL_3(3)
;
private int level;
ApiLevelEnum(int level) {
this.level = level;
}
}
\ No newline at end of file
......@@ -24,18 +24,10 @@ public enum ConsumeHealthEnum {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public String toString() {
return "ConsumeHealthEnum{" +
......
......@@ -19,7 +19,10 @@ public enum DBStatusEnum {
return status;
}
public void setStatus(int status) {
this.status = status;
@Override
public String toString() {
return "DBStatusEnum{" +
"status=" + status +
'}';
}
}
\ No newline at end of file
......@@ -21,18 +21,10 @@ public enum IDCEnum {
return idc;
}
public void setIdc(String idc) {
this.idc = idc;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "IDCEnum{" +
......
......@@ -21,10 +21,6 @@ public enum KafkaBrokerRoleEnum {
return role;
}
public void setRole(String role) {
this.role = role;
}
@Override
public String toString() {
return "KafkaBrokerRoleEnum{" +
......
......@@ -24,18 +24,10 @@ public enum KafkaClientEnum {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "KafkaClientEnum{" +
......
......@@ -18,4 +18,11 @@ public enum OffsetResetTypeEnum {
public Integer getCode() {
return code;
}
@Override
public String toString() {
return "OffsetResetTypeEnum{" +
"code=" + code +
'}';
}
}
......@@ -27,4 +27,12 @@ public enum OperationStatusEnum {
public String getMessage() {
return message;
}
@Override
public String toString() {
return "OperationStatusEnum{" +
"code=" + code +
", message='" + message + '\'' +
'}';
}
}
\ No newline at end of file
......@@ -15,9 +15,9 @@ public enum PeakFlowStatusEnum {
;
public Integer code;
private Integer code;
public String message;
private String message;
PeakFlowStatusEnum(Integer code, String message) {
this.code = code;
......@@ -28,18 +28,10 @@ public enum PeakFlowStatusEnum {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public String toString() {
return "PeakFlowStatusEnum{" +
......
......@@ -29,4 +29,12 @@ public enum RebalanceDimensionEnum {
public String getMessage() {
return message;
}
@Override
public String toString() {
return "RebalanceDimensionEnum{" +
"code=" + code +
", message='" + message + '\'' +
'}';
}
}
\ No newline at end of file
......@@ -43,18 +43,10 @@ public enum TaskStatusEnum {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public String toString() {
return "TaskStatusEnum{" +
......@@ -64,9 +56,6 @@ public enum TaskStatusEnum {
}
public static Boolean isFinished(Integer code) {
if (code >= FINISHED.getCode()) {
return true;
}
return false;
return code >= FINISHED.getCode();
}
}
......@@ -45,11 +45,6 @@ public enum TaskStatusReassignEnum {
}
public static Boolean isFinished(Integer code) {
if (SUCCEED.getCode().equals(code)
|| FAILED.getCode().equals(code)
|| CANCELED.getCode().equals(code)) {
return true;
}
return false;
return SUCCEED.getCode().equals(code) || FAILED.getCode().equals(code) || CANCELED.getCode().equals(code);
}
}
\ No newline at end of file
......@@ -33,4 +33,12 @@ public enum TopicAuthorityEnum {
public String getMessage() {
return message;
}
@Override
public String toString() {
return "TopicAuthorityEnum{" +
"code=" + code +
", message='" + message + '\'' +
'}';
}
}
......@@ -29,4 +29,12 @@ public enum TopicExpiredStatusEnum {
public String getMessage() {
return message;
}
@Override
public String toString() {
return "TopicExpiredStatusEnum{" +
"status=" + status +
", message='" + message + '\'' +
'}';
}
}
......@@ -23,18 +23,10 @@ public enum TopicOffsetChangedEnum {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public String toString() {
return "TopicOffsetChangedEnum{" +
......
......@@ -26,18 +26,10 @@ public enum GatewayConfigKeyEnum {
return configType;
}
public void setConfigType(String configType) {
this.configType = configType;
}
public String getConfigName() {
return configName;
}
public void setConfigName(String configName) {
this.configName = configName;
}
@Override
public String toString() {
return "GatewayConfigKeyEnum{" +
......
......@@ -12,4 +12,7 @@ public class ApiLevelContent {
public static final int LEVEL_NORMAL_3 = 3;
public static final int LEVEL_DEFAULT_4 = 4;
private ApiLevelContent() {
}
}
\ No newline at end of file
......@@ -28,4 +28,7 @@ public class ApiPrefix {
// gateway
public static final String GATEWAY_API_V1_PREFIX = "/gateway" + API_V1_PREFIX;
private ApiPrefix() {
}
}
\ No newline at end of file
......@@ -30,4 +30,7 @@ public class ConfigConstant {
public static final String BROKER_CAPACITY_LIMIT_CONFIG_KEY = "BROKER_CAPACITY_LIMIT_CONFIG";
public static final String KAFKA_CLUSTER_DO_CONFIG_KEY = "KAFKA_CLUSTER_DO_CONFIG";
private ConfigConstant() {
}
}
......@@ -45,4 +45,7 @@ public class Constant {
public static final Integer DEFAULT_MAX_CAL_TOPIC_EXPIRED_DAY = 90;
public static final Integer INVALID_CODE = -1;
private Constant() {
}
}
......@@ -16,4 +16,7 @@ public class KafkaConstant {
public static final String CLIENT_VERSION_NAME_UNKNOWN = "unknown";
public static final String RETENTION_MS_KEY = "retention.ms";
private KafkaConstant() {
}
}
\ No newline at end of file
......@@ -39,4 +39,7 @@ public class KafkaMetricsCollections {
* Broker信息
*/
public static final int BROKER_VERSION = 400;
private KafkaMetricsCollections() {
}
}
......@@ -10,4 +10,7 @@ public class LogConstant {
public static final String API_METRICS_LOGGER = "API_METRICS_LOGGER";
public static final String SCHEDULED_TASK_LOGGER = "SCHEDULED_TASK_LOGGER";
private LogConstant() {
}
}
\ No newline at end of file
......@@ -11,4 +11,7 @@ public class LoginConstant {
public static final String COOKIE_CHINESE_USERNAME_KEY = "chineseName";
public static final Integer COOKIE_OR_SESSION_MAX_AGE_UNIT_MS = 24 * 60 * 60 * 1000;
private LoginConstant() {
}
}
\ No newline at end of file
......@@ -6,4 +6,7 @@ package com.xiaojukeji.kafka.manager.common.constant;
*/
public class SystemCodeConstant {
public static final String KAFKA_MANAGER = "kafka-manager";
private SystemCodeConstant() {
}
}
\ No newline at end of file
......@@ -54,4 +54,7 @@ public class TopicCreationConstant {
* 单次自动化审批, 最多允许的通过单子
*/
public static final Integer MAX_PASSED_ORDER_NUM_PER_TASK = 200;
private TopicCreationConstant() {
}
}
\ No newline at end of file
......@@ -16,4 +16,7 @@ public class TopicSampleConstant {
public static final Integer MAX_TIMEOUT_UNIT_MS = 10000;
public static final Integer POLL_TIME_OUT_UNIT_MS = 2000;
public static final Integer MAX_DATA_LENGTH_UNIT_BYTE = 2048;
private TopicSampleConstant() {
}
}
\ No newline at end of file
......@@ -18,4 +18,7 @@ public class TrickLoginConstant {
*/
public static final String TRICK_LOGIN_SWITCH_ON = "on";
public static final String TRICK_LOGIN_SWITCH_OFF = "off";
private TrickLoginConstant() {
}
}
......@@ -119,4 +119,7 @@ public class ZkPathUtil {
public static String getControllerCandidatePath(Integer brokerId) {
return D_CONTROLLER_CANDIDATES + ZOOKEEPER_SEPARATOR + brokerId;
}
private ZkPathUtil() {
}
}
......@@ -91,7 +91,7 @@ public class BrokerServiceImpl implements BrokerService {
for (BrokerDO brokerDO : brokerDOList) {
PeakFlowStatusEnum peakFlowStatus = getPeakFlowStatus(brokerDO.getMaxAvgBytesIn(), peakFlow);
peakFlowStatusMap.put(
peakFlowStatus.code,
peakFlowStatus.getCode(),
peakFlowStatusMap.getOrDefault(peakFlowStatus.getCode(), 0) + 1
);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册