Merge branch 'develop' into master

This commit is contained in:
peachyy 2019-04-15 14:10:38 +08:00 committed by GitHub
commit 67b7fc3497
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 26 additions and 24 deletions

View File

@ -16,7 +16,7 @@
<parent> <parent>
<groupId>com.alibaba.nacos</groupId> <groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId> <artifactId>nacos-all</artifactId>
<version>1.0.0</version> <version>1.0.0-RC4</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -16,7 +16,7 @@
<parent> <parent>
<groupId>com.alibaba.nacos</groupId> <groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId> <artifactId>nacos-all</artifactId>
<version>1.0.0</version> <version>1.0.0-RC4</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -56,6 +56,9 @@ public class NacosConfigService implements ConfigService {
private static final Logger LOGGER = LogUtils.logger(NacosConfigService.class); private static final Logger LOGGER = LogUtils.logger(NacosConfigService.class);
private final long POST_TIMEOUT = 3000L; private final long POST_TIMEOUT = 3000L;
private static final String EMPTY = "";
/** /**
* http agent * http agent
*/ */
@ -95,19 +98,14 @@ public class NacosConfigService implements ConfigService {
@Override @Override
public String call() { public String call() {
String namespace = System.getenv(PropertyKeyConst.SystemEnv.ALIBABA_ALIWARE_NAMESPACE); String namespace = System.getenv(PropertyKeyConst.SystemEnv.ALIBABA_ALIWARE_NAMESPACE);
return StringUtils.isNotBlank(namespace) ? namespace : ""; return StringUtils.isNotBlank(namespace) ? namespace : EMPTY;
} }
}); });
if (StringUtils.isBlank(namespaceTmp)) { if (StringUtils.isBlank(namespaceTmp)) {
namespaceTmp = properties.getProperty(PropertyKeyConst.NAMESPACE); namespaceTmp = properties.getProperty(PropertyKeyConst.NAMESPACE);
} }
namespace = StringUtils.isNotBlank(namespaceTmp) ? namespaceTmp.trim() : EMPTY;
if (StringUtils.isBlank(namespaceTmp)) {
namespaceTmp = "";
}
namespace = namespaceTmp;
properties.put(PropertyKeyConst.NAMESPACE, namespace); properties.put(PropertyKeyConst.NAMESPACE, namespace);
} }

View File

@ -181,7 +181,7 @@ public class ServerListManager {
String endpointTmp = properties.getProperty(PropertyKeyConst.ENDPOINT); String endpointTmp = properties.getProperty(PropertyKeyConst.ENDPOINT);
if (Boolean.valueOf(properties.getProperty(PropertyKeyConst.IS_USE_ENDPOINT_PARSING_RULE, ParamUtil.USE_ENDPOINT_PARSING_RULE_DEFAULT_VALUE))) { if (Boolean.valueOf(properties.getProperty(PropertyKeyConst.IS_USE_ENDPOINT_PARSING_RULE, ParamUtil.USE_ENDPOINT_PARSING_RULE_DEFAULT_VALUE))) {
String endpointUrl = ParamUtil.parsingEndpointRule(endpointPortTmp); String endpointUrl = ParamUtil.parsingEndpointRule(endpointTmp);
if (StringUtils.isNotBlank(endpointUrl)) { if (StringUtils.isNotBlank(endpointUrl)) {
serverAddrsStr = ""; serverAddrsStr = "";
} }

View File

@ -24,7 +24,7 @@ import com.alibaba.nacos.client.utils.StringUtils;
*/ */
public class TenantUtil { public class TenantUtil {
static String userTenant = ""; private static String userTenant = "";
static { static {
userTenant = System.getProperty("tenant.id", ""); userTenant = System.getProperty("tenant.id", "");

View File

@ -33,7 +33,7 @@ public class ParamUtil {
private final static Logger LOGGER = LogUtils.logger(ParamUtil.class); private final static Logger LOGGER = LogUtils.logger(ParamUtil.class);
public final static String USE_ENDPOINT_PARSING_RULE_DEFAULT_VALUE = "false"; public final static String USE_ENDPOINT_PARSING_RULE_DEFAULT_VALUE = "true";
private static final Pattern PATTERN = Pattern.compile("\\$\\{[^}]+\\}"); private static final Pattern PATTERN = Pattern.compile("\\$\\{[^}]+\\}");
private static String defaultContextPath = "nacos"; private static String defaultContextPath = "nacos";

View File

@ -18,7 +18,7 @@
<parent> <parent>
<artifactId>nacos-all</artifactId> <artifactId>nacos-all</artifactId>
<groupId>com.alibaba.nacos</groupId> <groupId>com.alibaba.nacos</groupId>
<version>1.0.0</version> <version>1.0.0-RC4</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -18,7 +18,7 @@
<parent> <parent>
<groupId>com.alibaba.nacos</groupId> <groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId> <artifactId>nacos-all</artifactId>
<version>1.0.0</version> <version>1.0.0-RC4</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -17,7 +17,7 @@
<parent> <parent>
<groupId>com.alibaba.nacos</groupId> <groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId> <artifactId>nacos-all</artifactId>
<version>1.0.0</version> <version>1.0.0-RC4</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -18,7 +18,7 @@
<parent> <parent>
<groupId>com.alibaba.nacos</groupId> <groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId> <artifactId>nacos-all</artifactId>
<version>1.0.0</version> <version>1.0.0-RC4</version>
</parent> </parent>
<artifactId>nacos-console</artifactId> <artifactId>nacos-console</artifactId>
<!--<packaging>war</packaging>--> <!--<packaging>war</packaging>-->

View File

@ -61,7 +61,7 @@ public class NamespaceController {
rr.setCode(200); rr.setCode(200);
// TODO 获取用kp // TODO 获取用kp
List<TenantInfo> tenantInfos = persistService.findTenantByKp("1"); List<TenantInfo> tenantInfos = persistService.findTenantByKp("1");
Namespace namespace0 = new Namespace("", "Public", 200, persistService.configInfoCount(""), 0); Namespace namespace0 = new Namespace("", "public", 200, persistService.configInfoCount(""), 0);
List<Namespace> namespaces = new ArrayList<Namespace>(); List<Namespace> namespaces = new ArrayList<Namespace>();
namespaces.add(namespace0); namespaces.add(namespace0);
for (TenantInfo tenantInfo : tenantInfos) { for (TenantInfo tenantInfo : tenantInfos) {

View File

@ -18,7 +18,7 @@
<parent> <parent>
<groupId>com.alibaba.nacos</groupId> <groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId> <artifactId>nacos-all</artifactId>
<version>1.0.0</version> <version>1.0.0-RC4</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -18,7 +18,7 @@
<parent> <parent>
<groupId>com.alibaba.nacos</groupId> <groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId> <artifactId>nacos-all</artifactId>
<version>1.0.0</version> <version>1.0.0-RC4</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -18,7 +18,7 @@
<parent> <parent>
<groupId>com.alibaba.nacos</groupId> <groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId> <artifactId>nacos-all</artifactId>
<version>1.0.0</version> <version>1.0.0-RC4</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -18,7 +18,7 @@
<parent> <parent>
<groupId>com.alibaba.nacos</groupId> <groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId> <artifactId>nacos-all</artifactId>
<version>1.0.0</version> <version>1.0.0-RC4</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -165,6 +165,9 @@ public class ServerListManager {
} }
public synchronized void onReceiveServerStatus(String configInfo) { public synchronized void onReceiveServerStatus(String configInfo) {
Loggers.SRV_LOG.info("receive config info: {}", configInfo);
String[] configs = configInfo.split("\r\n"); String[] configs = configInfo.split("\r\n");
if (configs.length == 0) { if (configs.length == 0) {
return; return;
@ -274,7 +277,8 @@ public class ServerListManager {
// for every change disable healthy check for some while // for every change disable healthy check for some while
if (switchDomain.isHealthCheckEnabled()) { if (switchDomain.isHealthCheckEnabled()) {
Loggers.SRV_LOG.info("[NACOS-DISTRO] healthy server list changed, " + Loggers.SRV_LOG.info("[NACOS-DISTRO] healthy server list changed, " +
"disable health check for {} ms from now on", STABLE_PERIOD); "disable health check for {} ms from now on, old: {}, new: {}", STABLE_PERIOD,
healthyServers, newHealthyList);
switchDomain.setHealthCheckEnabled(false); switchDomain.setHealthCheckEnabled(false);
autoDisabledHealthCheck = true; autoDisabledHealthCheck = true;

View File

@ -21,7 +21,7 @@
<inceptionYear>2018</inceptionYear> <inceptionYear>2018</inceptionYear>
<groupId>com.alibaba.nacos</groupId> <groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId> <artifactId>nacos-all</artifactId>
<version>1.0.0</version> <version>1.0.0-RC4</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>Alibaba NACOS ${project.version}</name> <name>Alibaba NACOS ${project.version}</name>

View File

@ -17,7 +17,7 @@
<parent> <parent>
<groupId>com.alibaba.nacos</groupId> <groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId> <artifactId>nacos-all</artifactId>
<version>1.0.0</version> <version>1.0.0-RC4</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>