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 String EMPTY = "";
|
||||
|
||||
/**
|
||||
* http agent
|
||||
*/
|
||||
|
@ -43,7 +43,7 @@ public class MetricsHttpAgent implements HttpAgent {
|
||||
@Override
|
||||
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");
|
||||
HttpResult result = null;
|
||||
HttpResult result;
|
||||
try {
|
||||
result = httpAgent.httpGet(path, headers, paramValues, encoding, readTimeoutMs);
|
||||
} catch (IOException e) {
|
||||
@ -59,7 +59,7 @@ public class MetricsHttpAgent implements HttpAgent {
|
||||
@Override
|
||||
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");
|
||||
HttpResult result = null;
|
||||
HttpResult result;
|
||||
try {
|
||||
result = httpAgent.httpPost(path, headers, paramValues, encoding, readTimeoutMs);
|
||||
} catch (IOException e) {
|
||||
@ -75,7 +75,7 @@ public class MetricsHttpAgent implements HttpAgent {
|
||||
@Override
|
||||
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");
|
||||
HttpResult result = null;
|
||||
HttpResult result;
|
||||
try {
|
||||
result = httpAgent.httpDelete(path, headers, paramValues, encoding, readTimeoutMs);
|
||||
} catch (IOException e) {
|
||||
|
@ -44,7 +44,7 @@ public abstract class AbstractConfigChangeParser implements ConfigChangeParser {
|
||||
Map<String, ConfigChangeItem> result = new HashMap<String, ConfigChangeItem>(16);
|
||||
for (Iterator<Map.Entry<String, Object>> entryItr = oldMap.entrySet().iterator(); entryItr.hasNext();) {
|
||||
Map.Entry<String, Object> e = entryItr.next();
|
||||
ConfigChangeItem cci = null;
|
||||
ConfigChangeItem cci;
|
||||
if (newMap.containsKey(e.getKey())) {
|
||||
if (e.getValue().equals(newMap.get(e.getKey()))) {
|
||||
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.common.utils.MD5Utils;
|
||||
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.ParamUtil;
|
||||
import com.alibaba.nacos.client.utils.TenantUtil;
|
||||
@ -519,7 +520,10 @@ public class ClientWorker {
|
||||
|
||||
// check server config
|
||||
List<String> changedGroupKeys = checkUpdateDataIds(cacheDatas, inInitializingCacheList);
|
||||
LOGGER.info("get changedGroupKeys:" + changedGroupKeys);
|
||||
if (!CollectionUtils.isEmpty(changedGroupKeys)) {
|
||||
LOGGER.info("get changedGroupKeys:" + changedGroupKeys);
|
||||
}
|
||||
|
||||
|
||||
for (String groupKey : changedGroupKeys) {
|
||||
String[] key = GroupKey.parseKey(groupKey);
|
||||
|
@ -18,6 +18,7 @@ package com.alibaba.nacos.core.code;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.reflections.Reflections;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -35,6 +36,9 @@ import java.util.concurrent.ConcurrentMap;
|
||||
@Component
|
||||
public class ControllerMethodsCache {
|
||||
|
||||
@Value("${server.servlet.contextPath:/nacos}")
|
||||
private String contextPath;
|
||||
|
||||
private ConcurrentMap<String, Method> methods = new
|
||||
ConcurrentHashMap<>();
|
||||
|
||||
@ -43,7 +47,7 @@ public class ControllerMethodsCache {
|
||||
}
|
||||
|
||||
public Method getMethod(String httpMethod, String path) {
|
||||
String key = httpMethod + "-->" + path.replace("/nacos", "");
|
||||
String key = httpMethod + "-->" + path.replace(contextPath, "");
|
||||
return methods.get(key);
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ public class ServiceStatusSynchronizer implements Synchronizer {
|
||||
return null;
|
||||
}
|
||||
|
||||
Map<String,String> params = new HashMap<>(10);
|
||||
Map<String,String> params = new HashMap<>(1);
|
||||
|
||||
params.put("key", key);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user