Merge remote-tracking branch 'origin' into feature_1.3.0_beta_grpc
This commit is contained in:
commit
be75c582c2
@ -56,8 +56,6 @@ public class NacosConfigService implements ConfigService {
|
|||||||
|
|
||||||
private static final long POST_TIMEOUT = 3000L;
|
private static final long POST_TIMEOUT = 3000L;
|
||||||
|
|
||||||
private static final String EMPTY = "";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* http agent
|
* http agent
|
||||||
*/
|
*/
|
||||||
|
@ -43,7 +43,7 @@ public class MetricsHttpAgent implements HttpAgent {
|
|||||||
@Override
|
@Override
|
||||||
public HttpResult httpGet(String path, List<String> headers, List<String> paramValues, String encoding, long readTimeoutMs) throws IOException {
|
public HttpResult httpGet(String path, List<String> headers, List<String> paramValues, String encoding, long readTimeoutMs) throws IOException {
|
||||||
Histogram.Timer timer = MetricsMonitor.getConfigRequestMonitor("GET", path, "NA");
|
Histogram.Timer timer = MetricsMonitor.getConfigRequestMonitor("GET", path, "NA");
|
||||||
HttpResult result = null;
|
HttpResult result;
|
||||||
try {
|
try {
|
||||||
result = httpAgent.httpGet(path, headers, paramValues, encoding, readTimeoutMs);
|
result = httpAgent.httpGet(path, headers, paramValues, encoding, readTimeoutMs);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -59,7 +59,7 @@ public class MetricsHttpAgent implements HttpAgent {
|
|||||||
@Override
|
@Override
|
||||||
public HttpResult httpPost(String path, List<String> headers, List<String> paramValues, String encoding, long readTimeoutMs) throws IOException {
|
public HttpResult httpPost(String path, List<String> headers, List<String> paramValues, String encoding, long readTimeoutMs) throws IOException {
|
||||||
Histogram.Timer timer = MetricsMonitor.getConfigRequestMonitor("POST", path, "NA");
|
Histogram.Timer timer = MetricsMonitor.getConfigRequestMonitor("POST", path, "NA");
|
||||||
HttpResult result = null;
|
HttpResult result;
|
||||||
try {
|
try {
|
||||||
result = httpAgent.httpPost(path, headers, paramValues, encoding, readTimeoutMs);
|
result = httpAgent.httpPost(path, headers, paramValues, encoding, readTimeoutMs);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -75,7 +75,7 @@ public class MetricsHttpAgent implements HttpAgent {
|
|||||||
@Override
|
@Override
|
||||||
public HttpResult httpDelete(String path, List<String> headers, List<String> paramValues, String encoding, long readTimeoutMs) throws IOException {
|
public HttpResult httpDelete(String path, List<String> headers, List<String> paramValues, String encoding, long readTimeoutMs) throws IOException {
|
||||||
Histogram.Timer timer = MetricsMonitor.getConfigRequestMonitor("DELETE", path, "NA");
|
Histogram.Timer timer = MetricsMonitor.getConfigRequestMonitor("DELETE", path, "NA");
|
||||||
HttpResult result = null;
|
HttpResult result;
|
||||||
try {
|
try {
|
||||||
result = httpAgent.httpDelete(path, headers, paramValues, encoding, readTimeoutMs);
|
result = httpAgent.httpDelete(path, headers, paramValues, encoding, readTimeoutMs);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -44,7 +44,7 @@ public abstract class AbstractConfigChangeParser implements ConfigChangeParser {
|
|||||||
Map<String, ConfigChangeItem> result = new HashMap<String, ConfigChangeItem>(16);
|
Map<String, ConfigChangeItem> result = new HashMap<String, ConfigChangeItem>(16);
|
||||||
for (Iterator<Map.Entry<String, Object>> entryItr = oldMap.entrySet().iterator(); entryItr.hasNext();) {
|
for (Iterator<Map.Entry<String, Object>> entryItr = oldMap.entrySet().iterator(); entryItr.hasNext();) {
|
||||||
Map.Entry<String, Object> e = entryItr.next();
|
Map.Entry<String, Object> e = entryItr.next();
|
||||||
ConfigChangeItem cci = null;
|
ConfigChangeItem cci;
|
||||||
if (newMap.containsKey(e.getKey())) {
|
if (newMap.containsKey(e.getKey())) {
|
||||||
if (e.getValue().equals(newMap.get(e.getKey()))) {
|
if (e.getValue().equals(newMap.get(e.getKey()))) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -27,6 +27,7 @@ import com.alibaba.nacos.client.config.impl.HttpSimpleClient.HttpResult;
|
|||||||
import com.alibaba.nacos.client.config.utils.ContentUtils;
|
import com.alibaba.nacos.client.config.utils.ContentUtils;
|
||||||
import com.alibaba.nacos.common.utils.MD5Utils;
|
import com.alibaba.nacos.common.utils.MD5Utils;
|
||||||
import com.alibaba.nacos.client.monitor.MetricsMonitor;
|
import com.alibaba.nacos.client.monitor.MetricsMonitor;
|
||||||
|
import com.alibaba.nacos.client.naming.utils.CollectionUtils;
|
||||||
import com.alibaba.nacos.client.utils.LogUtils;
|
import com.alibaba.nacos.client.utils.LogUtils;
|
||||||
import com.alibaba.nacos.client.utils.ParamUtil;
|
import com.alibaba.nacos.client.utils.ParamUtil;
|
||||||
import com.alibaba.nacos.client.utils.TenantUtil;
|
import com.alibaba.nacos.client.utils.TenantUtil;
|
||||||
@ -519,7 +520,10 @@ public class ClientWorker {
|
|||||||
|
|
||||||
// check server config
|
// check server config
|
||||||
List<String> changedGroupKeys = checkUpdateDataIds(cacheDatas, inInitializingCacheList);
|
List<String> changedGroupKeys = checkUpdateDataIds(cacheDatas, inInitializingCacheList);
|
||||||
LOGGER.info("get changedGroupKeys:" + changedGroupKeys);
|
if (!CollectionUtils.isEmpty(changedGroupKeys)) {
|
||||||
|
LOGGER.info("get changedGroupKeys:" + changedGroupKeys);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for (String groupKey : changedGroupKeys) {
|
for (String groupKey : changedGroupKeys) {
|
||||||
String[] key = GroupKey.parseKey(groupKey);
|
String[] key = GroupKey.parseKey(groupKey);
|
||||||
|
@ -18,6 +18,7 @@ package com.alibaba.nacos.core.code;
|
|||||||
|
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.reflections.Reflections;
|
import org.reflections.Reflections;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@ -35,6 +36,9 @@ import java.util.concurrent.ConcurrentMap;
|
|||||||
@Component
|
@Component
|
||||||
public class ControllerMethodsCache {
|
public class ControllerMethodsCache {
|
||||||
|
|
||||||
|
@Value("${server.servlet.contextPath:/nacos}")
|
||||||
|
private String contextPath;
|
||||||
|
|
||||||
private ConcurrentMap<String, Method> methods = new
|
private ConcurrentMap<String, Method> methods = new
|
||||||
ConcurrentHashMap<>();
|
ConcurrentHashMap<>();
|
||||||
|
|
||||||
@ -43,7 +47,7 @@ public class ControllerMethodsCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Method getMethod(String httpMethod, String path) {
|
public Method getMethod(String httpMethod, String path) {
|
||||||
String key = httpMethod + "-->" + path.replace("/nacos", "");
|
String key = httpMethod + "-->" + path.replace(contextPath, "");
|
||||||
return methods.get(key);
|
return methods.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ public class ServiceStatusSynchronizer implements Synchronizer {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String,String> params = new HashMap<>(10);
|
Map<String,String> params = new HashMap<>(1);
|
||||||
|
|
||||||
params.put("key", key);
|
params.put("key", key);
|
||||||
|
|
||||||
|
2
pom.xml
2
pom.xml
@ -786,7 +786,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-databind</artifactId>
|
<artifactId>jackson-databind</artifactId>
|
||||||
<version>2.9.10.3</version>
|
<version>2.9.10.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.jackson</groupId>
|
<groupId>org.codehaus.jackson</groupId>
|
||||||
|
Loading…
Reference in New Issue
Block a user