style(naming): Variable name specification

This commit is contained in:
chuntaojun 2020-03-07 11:39:08 +08:00
parent 86e3b0dbc9
commit 4f264fed2d
3 changed files with 11 additions and 10 deletions

1
.gitignore vendored
View File

@ -12,3 +12,4 @@ target
node_modules
test/derby.log
derby.log
work

View File

@ -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<String> 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) {

View File

@ -106,7 +106,7 @@ public class ServiceManager implements RecordListener<Service> {
@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<Service> {
// 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> {
}
}
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;
}));