From 4f264fed2db9e55c47699d9c6f41c6e9ce8630d7 Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Sat, 7 Mar 2020 11:39:08 +0800 Subject: [PATCH] style(naming): Variable name specification --- .gitignore | 1 + .../java/com/alibaba/nacos/naming/core/Service.java | 10 +++++----- .../com/alibaba/nacos/naming/core/ServiceManager.java | 10 +++++----- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index cf4b56953..fafa25900 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ target node_modules test/derby.log derby.log +work diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java b/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java index 9f4be5b8d..5862ea509 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java @@ -60,7 +60,7 @@ public class Service extends com.alibaba.nacos.api.naming.pojo.Service implement /** * Identify the information used to determine how many isEmpty judgments the service has experienced */ - private int finalizeCnt = 0; + private int finalizeCount = 0; private String token; private List owners = new ArrayList<>(); @@ -517,12 +517,12 @@ public class Service extends com.alibaba.nacos.api.naming.pojo.Service implement } } - public int getFinalizeCnt() { - return finalizeCnt; + public int getFinalizeCount() { + return finalizeCount; } - public void setFinalizeCnt(int finalizeCnt) { - this.finalizeCnt = finalizeCnt; + public void setFinalizeCount(int finalizeCount) { + this.finalizeCount = finalizeCount; } public void addCluster(Cluster cluster) { diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java b/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java index 736219aec..e8fd98083 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java @@ -106,7 +106,7 @@ public class ServiceManager implements RecordListener { @Value("${nacos.naming.empty.service.auto-clean:false}") private boolean emptyServiceAutoClean; - private int maxFinalizeCnt = 3; + private int maxFinalizeCount = 3; private final Object putServiceLock = new Object(); @@ -827,7 +827,7 @@ public class ServiceManager implements RecordListener { // experiences Empty is determined by finalizeCnt, and if the specified // value is reached, it is removed - if (service.getFinalizeCnt() > maxFinalizeCnt) { + if (service.getFinalizeCount() > maxFinalizeCount) { Loggers.SRV_LOG.warn("namespace : {}, [{}] services are automatically cleaned", namespace, serviceName); try { @@ -838,12 +838,12 @@ public class ServiceManager implements RecordListener { } } - service.setFinalizeCnt(service.getFinalizeCnt() + 1); + service.setFinalizeCount(service.getFinalizeCount() + 1); Loggers.SRV_LOG.debug("namespace : {}, [{}] The number of times the current service experiences " + - "an empty instance is : {}", namespace, serviceName, service.getFinalizeCnt()); + "an empty instance is : {}", namespace, serviceName, service.getFinalizeCount()); } else { - service.setFinalizeCnt(0); + service.setFinalizeCount(0); } return service; }));