Skip to content

Commit

Permalink
Merge pull request #3295 from alibaba/develop
Browse files Browse the repository at this point in the history
Upgrade to 1.3.1 version
  • Loading branch information
KomachiSion authored Jul 10, 2020
2 parents c648249 + 7ddba00 commit 5e53396
Show file tree
Hide file tree
Showing 1,008 changed files with 51,839 additions and 48,075 deletions.
35 changes: 35 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 180
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- good first issue
- contribution welcome
- dependencies
- kind/bug
- kind/code quality
- kind/enhancement
- kind/performance
- kind/proposal
- kind/refactor
- kind/feature
- kind/user experience
- Soc2019
- SoC2020
- kind/notice
# Label to use when marking an issue as stale
staleLabel: expired
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
Thanks for your feedback and contribution. But the issue/pull request has
not had recent activity more than **180 days**. This issue/pull request will
be closed if no further activity occurs **7 days later**.
We may solve this issue in new version. So can you upgrade to newest version
and retry?
If there are still issues or want to contribute again. Please create new issue
or pull request again.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ before_install:
script:
- mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true
- mvn -Prelease-nacos -Dmaven.test.skip=true clean install -U
- mvn clean install -Pcit-test
- mvn clean package -Pit-test
after_success:
- mvn clean package -Pit-test
Expand Down
4 changes: 2 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Nacos
Copyright 2018-2019 The Apache Software Foundation
Copyright 2018-2020

This product includes software developed at
The Alibaba MiddleWare Group.
Expand Down Expand Up @@ -29,4 +29,4 @@ under the License.

Also, please refer to each LICENSE.<component>.txt file, which is located in
the 'license' directory of the distribution file, for the license terms of the
components that this product depends on.
components that this product depends on.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Nacos provides four major functions.

* **Dynamic Configuration Management**

Dynamic Configuration Service allows you to manage configurations of all services in a centralized and dynamic manner across all environments. Nacos eliminates the need to redeploy applications and services when configurations are updatedwhich makes configuration changes more efficient and agile.
Dynamic Configuration Service allows you to manage configurations of all services in a centralized and dynamic manner across all environments. Nacos eliminates the need to redeploy applications and services when configurations are updated, which makes configuration changes more efficient and agile.

* **Dynamic DNS Service**

Expand Down
50 changes: 24 additions & 26 deletions address/pom.xml
Original file line number Diff line number Diff line change
@@ -1,54 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 1999-2018 Alibaba Group Holding Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
~ Copyright 1999-2018 Alibaba Group Holding Ltd.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>nacos-all</artifactId>
<groupId>com.alibaba.nacos</groupId>
<version>1.3.0</version>
<version>1.3.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>nacos-address</artifactId>
<packaging>jar</packaging>

<name>nacos-address ${project.version}</name>
<url>http://nacos.io</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>nacos-naming</artifactId>
<exclusions>
<exclusion>
<groupId>com.alibaba.nacos</groupId>
<groupId>${project.groupId}</groupId>
<artifactId>nacos-cmdb</artifactId>
</exclusion>
</exclusions>
Expand All @@ -64,15 +62,15 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>

<reporting>
<plugins>
<plugin>
Expand All @@ -81,7 +79,7 @@
</plugin>
</plugins>
</reporting>

<profiles>
<profile>
<id>release-address</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.alibaba.nacos.address;

import org.springframework.boot.SpringApplication;
Expand All @@ -26,8 +27,9 @@
*/
@SpringBootApplication(scanBasePackages = "com.alibaba.nacos")
public class AddressServer {

public static void main(String[] args) {

SpringApplication.run(AddressServer.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 the original author or authors.
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.alibaba.nacos.address.component;

import com.alibaba.nacos.address.constant.AddressServerConstants;
Expand All @@ -34,32 +35,38 @@
*/
@Component
public class AddressServerGeneratorManager {


/**
* Generate product name.
*
* @param name name
* @return product
*/
public String generateProductName(String name) {

if (StringUtils.isBlank(name) || AddressServerConstants.DEFAULT_PRODUCT.equals(name)) {

return AddressServerConstants.ALIWARE_NACOS_DEFAULT_PRODUCT_NAME;
}

return String.format(AddressServerConstants.ALIWARE_NACOS_PRODUCT_DOM_TEMPLATE, name);
}

/**
* Note: if the parameter inputted is empty then will return the empty list.
*
* @param serviceName
* @param clusterName
* @param ipArray
* @return
* @param serviceName service name
* @param clusterName cluster name
* @param ipArray array of ips
* @return instance list
*/
public List<Instance> generateInstancesByIps(String serviceName, String rawProductName, String clusterName, String[] ipArray) {
if (StringUtils.isEmpty(serviceName)
|| StringUtils.isEmpty(clusterName)
|| ipArray == null || ipArray.length == 0) {
public List<Instance> generateInstancesByIps(String serviceName, String rawProductName, String clusterName,
String[] ipArray) {
if (StringUtils.isEmpty(serviceName) || StringUtils.isEmpty(clusterName) || ipArray == null
|| ipArray.length == 0) {
return Collections.emptyList();
}

List<Instance> instanceList = new ArrayList<>(ipArray.length);
for (String ip : ipArray) {
String[] ipAndPort = generateIpAndPort(ip);
Expand All @@ -73,46 +80,50 @@ public List<Instance> generateInstancesByIps(String serviceName, String rawProdu
instance.setEphemeral(false);
instanceList.add(instance);
}

return instanceList;
}

public String[] generateIpAndPort(String ip) {

private String[] generateIpAndPort(String ip) {
int index = ip.indexOf(AddressServerConstants.IP_PORT_SEPARATOR);
if (index != -1) {

return new String[]{ip.substring(0, index), ip.substring(index + 1)};
return new String[] {ip.substring(0, index), ip.substring(index + 1)};
}

return new String[]{ip, String.valueOf(AddressServerConstants.DEFAULT_SERVER_PORT)};
return new String[] {ip, String.valueOf(AddressServerConstants.DEFAULT_SERVER_PORT)};
}

/**
* Generate response ips.
*
* @param instanceList a instance set will generate string response to client.
* @return the result of response to client
*/
public String generateResponseIps(List<Instance> instanceList) {

StringBuilder ips = new StringBuilder();
instanceList.forEach(instance -> {
ips.append(instance.getIp() + ":" + instance.getPort());
ips.append("\n");
});

return ips.toString();
}

/**
* @param rawServiceName the raw service name will not contains the {@Constans.DEFAULT_GROUP}
* Generate nacos service name.
*
* @param rawServiceName the raw service name will not contains the {@link Constants#DEFAULT_GROUP}.
* @return the nacos service name
*/
public String generateNacosServiceName(String rawServiceName) {

if (rawServiceName.indexOf(Constants.DEFAULT_GROUP) != -1) {
return rawServiceName;
}

return Constants.DEFAULT_GROUP + AddressServerConstants.GROUP_SERVICE_NAME_SEP + rawServiceName;
}
}
Loading

0 comments on commit 5e53396

Please sign in to comment.