10000 1.0.0 rc3 by nkorange · Pull Request #999 · alibaba/nacos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

1.0.0 rc3 #999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 51 commits into from
Apr 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
4956e20
Merge pull request #4 from alibaba/develop
yanlinly Nov 5, 2018
0133666
Fix #179
yanlinly Nov 5, 2018
30780f9
Merge pull request #5 from yanlinly/hotfix__namespace
yanlinly Nov 5, 2018
233272a
Merge remote-tracking branch 'nacos/develop'
yanlinly Nov 6, 2018
2f41248
Merge pull request #1 from alibaba/master
jifengnan Jan 13, 2019
abbdbab
Merge pull request #2 from alibaba/master
jifengnan Jan 31, 2019
05c3881
Merge pull request #4 from alibaba/master
jifengnan Mar 12, 2019
df7278a
#502 Fix url too long problem.
nkorange Mar 17, 2019
a902194
Close #910
nkorange Mar 18, 2019
7ec7311
Close #911
nkorange Mar 18, 2019
3f2d704
Fix #923
nkorange Mar 18, 2019
52d4e01
#502 Fix several bugs
nkorange Mar 18, 2019
f6ea504
#502 Refactor
nkorange Mar 19, 2019
7303ea7
#745 Remove server mode
nkorange Mar 20, 2019
cf8a3c7
Merge pull request #959 from alibaba/hotfix_client_beat
Mar 25, 2019
a745423
Merge branch 'develop' into feature_naming_group
nkorange Mar 25, 2019
e2a7206
Fix #961
nkorange Mar 26, 2019
14ecd9c
#502 Fix data inconsistent bug
nkorange Mar 26, 2019
8ff3b60
Add 8000 User-Agent header in access log
nkorange Mar 26, 2019
074d243
Merge branch 'master' into develop
yanlinly Mar 27, 2019
06df9ab
Merge pull request #6 from alibaba/develop
yanlinly Mar 27, 2019
d11fd7f
support aliyun ram role
yanlinly Mar 27, 2019
020350b
Merge pull request #964 from yanlinly/master
hxy1991 Mar 27, 2019
9500939
Merge pull request #5 from alibaba/master
jifengnan Mar 27, 2019
bb27800
#502 Fix remove service failed bug
nkorange Mar 27, 2019
37b9004
Fix #973
nkorange Mar 29, 2019
4c5b06c
Optimize code
nkorange Mar 29, 2019
9b7d613
update versionUtils in stream close
xuechaos Mar 29, 2019
1f125c4
Fix the issue: ArrayIndexOutOfBoundsException may be thrown when invo…
jifengnan Mar 29, 2019
180f3a7
Add unit test cases
jifengnan Mar 29, 2019
b1790fa
Merge pull request #975 from jifengnan/issue_974
Apr 1, 2019
7277680
适配测试用例
alios-studio Apr 1, 2019
2c7daa6
Fix #948
nkorange Apr 1, 2019
4dde5d6
Merge remote-tracking branch 'origin/feature_naming_group' into featu…
nkorange Apr 1, 2019
df4f338
Fixes #984
hxy1991 Apr 1, 2019
12c032c
#502 Fix raft publish bug
nkorange Apr 1, 2019
9c90502
Fixes #986
hxy1991 Apr 1, 2019
51dd3db
#502 Fix client beat bug
nkorange Apr 1, 2019
adcc955
Merge pull request #985 from hxy1991/fix_984
hxy1991 Apr 1, 2019
178b80e
del warnings spotbugs-annotations #981
xuechaos Apr 1, 2019
0b6246e
remove lgpl dependency
yanlinly Apr 1, 2019
ec8046e
Merge pull request #991 from yanlinly/master
xuechaos Apr 1, 2019
acaee3f
Merge pull request #993 from alibaba/del_warnings
yanlinly Apr 2, 2019
d8b768b
#502 Check if key blank before instantiate new list.
nkorange Apr 2, 2019
210af39
#502 Update switch name
nkorange Apr 2, 2019
e0547c8
Merge pull request #997 from alibaba/feature_naming_group
Apr 2, 2019
2fe8a76
Fix console 401 error
nkorange Apr 2, 2019
8e20fd6
Merge pull request #987 from hxy1991/fix_986
Apr 3, 2019
73d13b5
fix typo 控件 => 空间
neatlife Mar 30, 2019
4dc4031
Update version to 1.0.0-RC3
nkorange Apr 3, 2019
2cb96d1
#923 Recognize 'cluster'
nkorange Apr 3, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>1.0.0-RC2</version>
<version>1.0.0-RC3</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/com/alibaba/nacos/api/PropertyKeyConst.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class PropertyKeyConst {

public final static String SECRET_KEY = "secretKey";

public final static String RAM_ROLE_NAME = "ramRoleName";

public final static String SERVER_ADDR = "serverAddr";

public final static String CONTEXT_PATH = "contextPath";
Expand Down
10 changes: 10 additions & 0 deletions api/src/main/java/com/alibaba/nacos/api/naming/NamingService.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,16 @@ public interface NamingService {
*/
void deregisterInstance(String serviceName, String groupName, String ip, int port, String clusterName) throws NacosException;

/**
* deregister instance with full instance information
*
* @param serviceName name of service
* @param groupName group of service
* @param instance instance information
* @throws NacosException
*/
void deregisterInstance(String serviceName, String groupName, Instance instance) throws NacosException;

/**
* get all instances of a service
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* 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.
*/
package com.alibaba.nacos.api.naming;

/**
* Some keys of metadata that are recognized by Nacos
*
* @author nkorange
* @since 1.0.0
*/
public class PreservedMetadataKeys {

/**
* The key to indicate the registry source of service instance, such as Dubbo, SpringCloud, etc.
*/
public static final String REGISTER_SOURCE = "preserved.register.source";
}
16 changes: 8 additions & 8 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>1.0.0-RC2</version>
<version>1.0.0-RC3</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -85,18 +85,18 @@
</dependency>

<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-lgpl</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>

<dependency>
<groupId>net.jcip</groupId>
<artifactId>jcip-annotations</artifactId>
<optional>true</optional>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>

<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
<groupId>net.jcip</groupId>
<artifactId>jcip-annotations</artifactId>
<optional>true</optional>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
import com.alibaba.nacos.client.utils.LogUtils;
import com.alibaba.nacos.client.utils.ParamUtil;
import com.alibaba.nacos.client.utils.StringUtils;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.type.TypeReference;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import org.slf4j.Logger;

import java.io.IOException;
import java.net.ConnectException;
import java.net.HttpURLConnection;
Expand Down Expand Up @@ -222,6 +221,11 @@ public String call() throws Exception {
}

private void initAkSk(Properties properties) {
String ramRoleName = properties.getProperty(PropertyKeyConst.RAM_ROLE_NAME);
if (!StringUtils.isBlank(ramRoleName)) {
STSConfig.getInstance().setRamRoleName(ramRoleName);
}

String ak = properties.getProperty(PropertyKeyConst.ACCESS_KEY);
if (StringUtils.isBlank(ak)) {
accessKey = SpasAdapter.getAk();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import com.alibaba.nacos.client.utils.LogUtils;
import com.alibaba.nacos.client.utils.ParamUtil;
import com.alibaba.nacos.client.utils.StringUtils;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.slf4j.Logger;

import java.io.File;
Expand Down Expand Up @@ -102,7 +101,6 @@ public void removeTenantListener(String dataId, String group, Listener listener)
}
}

@SuppressFBWarnings("JLM_JSR166_UTILCONCURRENT_MONITORENTER")
void removeCache(String dataId, String group) {
String groupKey = GroupKey.getKey(dataId, group);
synchronized (cacheMap) {
Expand All @@ -115,7 +113,6 @@ void removeCache(String dataId, String group) {
MetricsMonitor.getListenConfigCountMonitor().set(cacheMap.get().size());
}

@SuppressFBWarnings("JLM_JSR166_UTILCONCURRENT_MONITORENTER")
void removeCache(String dataId, String group, String tenant) {
String groupKey = GroupKey.getKeyTenant(dataId, group, tenant);
synchronized (cacheMap) {
Expand All @@ -128,7 +125,6 @@ void removeCache(String dataId, String group, String tenant) {
MetricsMonitor.getListenConfigCountMonitor().set(cacheMap.get().size());
}

@SuppressFBWarnings("JLM_JSR166_UTILCONCURRENT_MONITORENTER")
public CacheData addCacheDataIfAbsent(String dataId, String group) {
CacheData cache = getCache(dataId, group);
if (null != cache) {
Expand Down Expand Up @@ -163,7 +159,6 @@ public CacheData addCacheDataIfAbsent(String dataId, String group) {
return cache;
}

@SuppressFBWarnings("JLM_JSR166_UTILCONCURRENT_MONITORENTER")
public CacheData addCacheDataIfAbsent(String dataId, String group, String tenant) {
CacheData cache = getCache(dataId, group, tenant);
if (null != cache) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.alibaba.nacos.client.config.impl.HttpSimpleClient.HttpResult;
import com.alibaba.nacos.client.config.utils.IOUtils;
import com.alibaba.nacos.client.utils.*;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.slf4j.Logger;

import java.io.IOException;
Expand Down Expand Up @@ -396,7 +395,6 @@ public RandomizedServerAddress(String ip) {
}

@Override
@SuppressFBWarnings("EQ_COMPARETO_USE_OBJECT_EQUALS")
public int compareTo(RandomizedServerAddress other) {
if (this.priority != other.priority) {
return other.priority - this.priority;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
@SuppressWarnings("PMD.ClassNamingShouldBeCamelRule")
public class STSConfig {
private static final String RAM_SECURITY_CREDENTIALS_URL
= "";
= "http://100.100.100.200/latest/meta-data/ram/security-credentials/";
private String ramRoleName;
/**
* STS 临时凭证有效期剩余多少时开始刷新(允许本地时间比 STS 服务时间最多慢多久)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,11 @@ private void init(Properties properties) {

private int initClientBeatThreadCount(Properties properties) {
if (properties == null) {

return UtilAndComs.DEFAULT_CLIENT_BEAT_THREAD_COUNT;
}

int clientBeatThreadCount = NumberUtils.toInt(properties.getProperty(PropertyKeyConst.NAMING_CLIENT_BEAT_THREAD_COUNT),
return NumberUtils.toInt(properties.getProperty(PropertyKeyConst.NAMING_CLIENT_BEAT_THREAD_COUNT),
UtilAndComs.DEFAULT_CLIENT_BEAT_THREAD_COUNT);

return clientBeatThreadCount;
}

private int initPollingThreadCount(Properties properties) {
Expand All @@ -120,10 +117,8 @@ private int initPollingThreadCount(Properties properties) {
return UtilAndComs.DEFAULT_POLLING_THREAD_COUNT;
}

int pollingThreadCount = NumberUtils.toInt(properties.getProperty(PropertyKeyConst.NAMING_POLLING_THREAD_COUNT),
return NumberUtils.toInt(properties.getProperty(PropertyKeyConst.NAMING_POLLING_THREAD_COUNT),
UtilAndComs.DEFAULT_POLLING_THREAD_COUNT);

return pollingThreadCount;
}

private boolean isLoadCacheAtStart(Properties properties) {
Expand Down Expand Up @@ -283,16 +278,18 @@ public void registerInstance(String serviceName, Instance instance) throws Nacos
@Override
public void registerInstance(String serviceName, String groupName, Instance instance) throws NacosException {

BeatInfo beatInfo = new BeatInfo();
beatInfo.setServiceName(NamingUtils.getGroupedName(serviceName, groupName));
beatInfo.setIp(instance.getIp());
beatInfo.setPort(instance.getPort());
beatInfo.setCluster(instance.getClusterName());
beatInfo.setWeight(instance.getWeight());
beatInfo.setMetadata(instance.getMetadata());
beatInfo.setScheduled(false);

beatReactor.addBeatInfo(NamingUtils.getGroupedName(serviceName, groupName), beatInfo);
if (instance.isEphemeral()) {
BeatInfo beatInfo = new BeatInfo();
beatInfo.setServiceName(NamingUtils.getGroupedName(serviceName, groupName));
beatInfo.setIp(instance.getIp());
beatInfo.setPort(instance.getPort());
beatInfo.setCluster(instance.getClusterName());
beatInfo.setWeight(instance.getWeight());
beatInfo.setMetadata(instance.getMetadata());
beatInfo.setScheduled(false);

beatReactor.addBeatInfo(NamingUtils.getGroupedName(serviceName, groupName), beatInfo);
}

serverProxy.registerService(NamingUtils.getGroupedName(serviceName, groupName), groupName, instance);
}
Expand All @@ -314,8 +311,18 @@ public void deregisterInstance(String serviceName, String ip, int port, String c

@Override
public void deregisterInstance(String serviceName, String groupName, String ip, int port, String clusterName) throws NacosException {
beatReactor.removeBeatInfo(NamingUtils.getGroupedName(serviceName, groupName), ip, port);
serverProxy.deregisterService(NamingUtils.getGroupedName(serviceName, groupName), ip, port, clusterName);
Instance instance = new Instance();
instance.setIp(ip);
instance.setPort(port);
instance.setClusterName(clusterName);

deregisterInstance(serviceName, groupName, instance);
}

@Override
public void deregisterInstance(String serviceName, String groupName, Instance instance) throws NacosException {
beatReactor.removeBeatInfo(NamingUtils.getGroupedName(serviceName, groupName), instance.getIp(), instance.getPort());
serverProxy.deregisterService(NamingUtils.getGroupedName(serviceName, groupName), instance);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.alibaba.nacos.client.naming.net.NamingProxy;
import com.alibaba.nacos.client.naming.utils.StringUtils;
import com.alibaba.nacos.client.naming.utils.UtilAndComs;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.util.*;
import java.util.concurrent.*;
Expand Down Expand Up @@ -267,7 +266,6 @@ public void scheduleUpdateIfAbsent(String serviceName, String clusters) {
}
}

@SuppressFBWarnings("NN_NAKED_NOTIFY")
public void updateServiceNow(String serviceName, String clusters) {
ServiceInfo oldService = getSerivceInfo0(serviceName, clusters);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,18 @@ public void registerService(String serviceName, String groupName, Instance insta

}

public void deregisterService(String serviceName, String ip, int port, String clusterName) throws NacosException {
public void deregisterService(String serviceName, Instance instance) throws NacosException {

NAMING_LOGGER.info("[DEREGISTER-SERVICE] {} deregistering service {} with instance: {}:{}@{}",
namespaceId, serviceName, ip, port, clusterName);
NAMING_LOGGER.info("[DEREGISTER-SERVICE] {} deregistering service {} with instance: {}",
namespaceId, serviceName, instance);

final Map<String, String> params = new HashMap<String, String>(8);
params.put(CommonParams.NAMESPACE_ID, namespaceId);
params.put("ip", ip);
params.put("port", String.valueOf(port));
params.put(CommonParams.SERVICE_NAME, serviceName);
params.put(CommonParams.CLUSTER_NAME, clusterName);
params.put(CommonParams.CLUSTER_NAME, instance.getClusterName());
params.put("ip", instance.getIp());
params.put("port", String.valueOf(instance.getPort()));
params.put("ephemeral", String.valueOf(instance.isEphemeral()));

reqAPI(UtilAndComs.NACOS_URL_INSTANCE, params, HttpMethod.DELETE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package com.alibaba.nacos.client.naming.utils;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.io.*;
import java.nio.channels.FileChannel;
Expand Down Expand Up @@ -163,7 +162,6 @@ public static void cleanDirectory(File directory) throws IOException {
}
}

@SuppressFBWarnings("BIT_IOR_OF_SIGNED_BYTE")
public static boolean isGzipStream(byte[] bytes) {

int minByteArraySize = 2;
Expand Down
18 changes: 4 additions & 14 deletions client/src/main/java/com/alibaba/nacos/client/utils/JSONUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
package com.alibaba.nacos.client.utils;

import java.io.IOException;

import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.DeserializationConfig.Feature;
import org.codehaus.jackson.type.JavaType;
import org.codehaus.jackson.type.TypeReference;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
* Json tool
Expand All @@ -33,7 +31,7 @@ public class JSONUtils {
static ObjectMapper mapper = new ObjectMapper();

static {
mapper.disable(Feature.FAIL_ON_UNKNOWN_PROPERTIES);
mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
}

public static String serializeObject(Object o) throws IOException {
Expand All @@ -49,12 +47,4 @@ public static Object deserializeObject(String s, TypeReference<?> typeReference)
return mapper.readValue(s, typeReference);
}

public static JavaType getCollectionType(Class<?> collectionClass, Class<?>... elementClasses) {
return mapper.getTypeFactory().constructParametricType(collectionClass, elementClasses);
}

public static Object deserializeCollection(String s, JavaType type) throws IOException {
return mapper.readValue(s, type);
}

}
2 changes: 1 addition & 1 deletion cmdb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<artifactId>nacos-all</artifactId>
<groupId>com.alibaba.nacos</groupId>
<version>1.0.0-RC2</version>
<version>1.0.0-RC3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>1.0.0-RC2</version>
<version>1.0.0-RC3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Loading
0