Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
16ba537
feat: #2530
chuntaojun Mar 26, 2020
ce6dc51
fix: fix some bugs
chuntaojun Mar 26, 2020
da7ef15
style: fix code style
chuntaojun Mar 26, 2020
5e51859
style: remove useless folder
chuntaojun Mar 26, 2020
f5125dd
test: Modified unit test
chuntaojun Mar 26, 2020
418f88d
docs: Configuration file information changes
chuntaojun Mar 27, 2020
36b99c7
test: fix BeatReactorTest
chuntaojun Mar 27, 2020
e0dd6cc
fix:
chuntaojun Mar 27, 2020
57fc219
style: Fix License problem
chuntaojun Mar 27, 2020
3dd42fe
refactor: Generic fetch method modification
chuntaojun Mar 27, 2020
9133814
fix:
chuntaojun Mar 27, 2020
89a8ddd
Merge branch 'develop' of https://github.com/alibaba/nacos into featu…
chuntaojun Mar 28, 2020
586838e
Merge branch 'develop' of https://github.com/alibaba/nacos into featu…
chuntaojun Mar 29, 2020
66db520
fix: merge upstream develop
chuntaojun Mar 30, 2020
d871484
fix: hotfix issue 2560
chuntaojun Apr 1, 2020
b3fdacf
refactor:
chuntaojun Apr 1, 2020
2e7549a
refactor: Roll back the code
chuntaojun Apr 1, 2020
237edb0
fix throw exception log describe
Maijh97 Apr 1, 2020
c684b7e
Merge pull request #2566 from chuntaojun/hotfix_2560
nkorange Apr 2, 2020
2e1b5a0
Merge pull request #2569 from Maijh97/develop
nkorange Apr 2, 2020
9f8c19c
refactor: Change the distributed ID logic
chuntaojun Apr 2, 2020
42626c0
docs:
chuntaojun Apr 3, 2020
fad5e4d
refactor: modify pom.xml
chuntaojun Apr 4, 2020
57caa53
style: Fix the PMD rule
chuntaojun Apr 4, 2020
445377d
fix #2577: Naming client http read timeout and connect timeout contro…
wolfgangzhu Apr 4, 2020
4e52ff0
Merge pull request #2584 from wolfgangzhu/hotifx/back_issue
chuntaojun Apr 4, 2020
7586354
refactor: bug fix and refactor init logic
chuntaojun Apr 13, 2020
1aca7bc
refactor: core
chuntaojun Apr 13, 2020
0b3b5e8
refactor(all): code optimization
chuntaojun Apr 16, 2020
0af4d4f
refactor: addressing mode refactoring
chuntaojun Apr 18, 2020
bb70dcb
[ISSUE#2618]modify server md5 generation method
wangweizZZ Apr 18, 2020
a9918f2
refactor: request forwarding logic adjustment
chuntaojun Apr 19, 2020
aeb1491
unify the MD5 generation on both sides by MD5 utility classes in the …
wangweizZZ Apr 19, 2020
dcdbaf5
use MD5Utils replace MD5
wangweizZZ Apr 20, 2020
f222dcc
refactor: code optimization
chuntaojun Apr 21, 2020
6a0d71a
style: fix code style to adapter PMD
chuntaojun Apr 21, 2020
900fa66
Merge pull request #2647 from wangweizZZ/issue_2618
chuntaojun Apr 21, 2020
1bef710
add 'groupName' parameter
langghaha Apr 21, 2020
ef405e0
refactor: remove complex listening logic and bug fixes
chuntaojun Apr 22, 2020
853a8f5
refactor: core
chuntaojun Apr 22, 2020
e4c4752
refactor: remove complex logic, RPC ports can be customized
chuntaojun Apr 23, 2020
9c970b6
refactor: fix code stype
chuntaojun Apr 23, 2020
41e1f04
refactor: code refactor
chuntaojun Apr 24, 2020
bf94c96
refactor: none
chuntaojun Apr 24, 2020
8b4a377
refactor: address mode adds setting parameters
chuntaojun Apr 26, 2020
dd4b577
fix: fix double lock
chuntaojun Apr 26, 2020
6c495c0
keep query criteria
zhenxianyimeng Apr 21, 2020
986b543
fix: allow empty line in config type preperties
wfnuser Apr 27, 2020
4baaef4
fix: ignore yarn-error log
wfnuser Apr 27, 2020
a025e56
fix: fix config dump bug
chuntaojun Apr 28, 2020
a937e30
fix: fix some bugs
chuntaojun Apr 30, 2020
041effe
refactor: some code refactor
chuntaojun Apr 30, 2020
eb11ff9
fix: fix standalone sync node info bug
chuntaojun Apr 30, 2020
eca2aca
fix: bug fix
chuntaojun May 1, 2020
a82bcc1
fix: fix request transfer bug
chuntaojun May 2, 2020
2526c5d
fix: fix naming request redirect
chuntaojun May 3, 2020
1563dc7
fix: fixed a problem where parameters were encoded multiple times
chuntaojun May 5, 2020
60b84a4
refactor: merge upstream develop
chuntaojun May 5, 2020
272abe6
fix: fix parameter encode
chuntaojun May 6, 2020
5e28189
refactor: remove debug log
chuntaojun May 6, 2020
5d6a0b5
fix: fix code style
chuntaojun May 6, 2020
613a8d6
refactor: the raft port computes the rule changes
chuntaojun May 7, 2020
5208416
Merge pull request #2531 from chuntaojun/feature_consistency
chuntaojun May 8, 2020
29a6edc
refactor: fix bugs
chuntaojun May 8, 2020
79a6f45
Merge pull request #2759 from chuntaojun/feature_consistency
chuntaojun May 8, 2020
27346a9
[#2761]ProtocolManager class's getCpProtocol()/getApProtocol() method…
zongtanghu May 8, 2020
0be43f3
Merge pull request #2763 from zongtanghu/feature_1.3.0_beta
chuntaojun May 8, 2020
beaa402
[ISSUE #2765]Optimize MemberUtils class's kRandom method
wangweizZZ May 8, 2020
d69954c
Merge pull request #2766 from wangweizZZ/feature_1.3.0_beta
chuntaojun May 9, 2020
5879b03
fix: expansion and volume timing issue fixed
chuntaojun May 9, 2020
6a6725a
fix: fix expansion issues
chuntaojun May 9, 2020
5b22ddf
refactor: remove discovery-memberlookup
chuntaojun May 10, 2020
2b091f1
[#2738]add tenant legality verification.
zongtanghu May 11, 2020
1bb7613
[#2738]Put ParamUtils into origin place for tenant legality verificat…
zongtanghu May 11, 2020
e5491ec
[#2738]fix another BeatReactorTest unit test failure.
zongtanghu May 11, 2020
f71c435
[#2738]remove redundant codes.
zongtanghu May 11, 2020
0aefb6f
refactor: retain the expansion logic
chuntaojun May 11, 2020
18de638
[#2738]remove redundant codes.
zongtanghu May 11, 2020
ff36921
Merge pull request #2758 from alibaba/feature_1.3.0_beta
yanlinly May 11, 2020
0305c0d
[#2738]add tenant legality verification.
zongtanghu May 11, 2020
b7207cb
[#2738]Put ParamUtils into origin place for tenant legality verificat…
zongtanghu May 11, 2020
71ce203
[#2738]rebase and resolve conflict codes.
zongtanghu May 11, 2020
c2c752a
Merge remote-tracking branch 'origin/feature_tenant_verify' into feat…
zongtanghu May 11, 2020
99a74d7
Merge pull request #2783 from zongtanghu/feature_tenant_verify
yanlinly May 11, 2020
9f4061e
Revert "[#2738]add tenant legality verification."
yanlinly May 11, 2020
5319b27
Merge pull request #2784 from alibaba/revert-2783-feature_tenant_verify
yanlinly May 11, 2020
f46fa41
[#2738]add tenant legality verification.
zongtanghu May 11, 2020
abaf5d9
Merge pull request #2785 from zongtanghu/feature_tenant_verify_v2
yanlinly May 11, 2020
54e251d
release 1.3-beta
yanlinly May 11, 2020
82bcbd9
refactor: jRaft partial logical adjustment
chuntaojun May 13, 2020
4d4e914
fix: fixed the cluster logic for the jraft set
chuntaojun May 13, 2020
b6e5d9c
feat: open jraft-node metrics
chuntaojun May 13, 2020
59d444a
Merge langghaha-fix_2609
loadchange May 13, 2020
8f021b2
Merge branch 'langghaha-fix_2609' into develop
loadchange May 13, 2020
a68f5e2
fix: fix code style
chuntaojun May 13, 2020
52ea967
fix: cluster startup mode adjustment
chuntaojun May 14, 2020
7d233e6
Merge pull request #2806 from alibaba/feature_1.3.0_beta
yanlinly May 14, 2020
2af4c40
fix pmd problem
yanlinly May 14, 2020
86652a4
fix: fix code style
chuntaojun May 14, 2020
a37d6af
fix: fix member remove
chuntaojun May 14, 2020
a928e7e
fix: fix node remove bug
chuntaojun May 14, 2020
ed11942
Merge pull request #2809 from alibaba/feature_1.3.0_beta
chuntaojun May 15, 2020
a317c7a
refactor: jraft node removal logic optimization
chuntaojun May 15, 2020
885210a
Merge pull request #2813 from alibaba/feature_1.3.0_beta
chuntaojun May 15, 2020
afc74da
build: update version to 1.3.0-BETA
chuntaojun May 15, 2020
b10745b
update travis.yml
yanlinly May 15, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ target
.DS_Store
.factorypath
/logs
/lib
*.iml
node_modules
test/derby.log
derby.log
work
test/logs
derby.log
2 changes: 1 addition & 1 deletion address/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>nacos-all</artifactId>
<groupId>com.alibaba.nacos</groupId>
<version>1.2.1</version>
<version>1.3.0-BETA</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
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.2.1</version>
<version>1.3.0-BETA</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
240 changes: 120 additions & 120 deletions api/src/main/java/com/alibaba/nacos/api/exception/NacosException.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,125 +25,125 @@
*/
public class NacosException extends Exception {

/**
* serialVersionUID
*/
private static final long serialVersionUID = -3913902031489277776L;

private int errCode;

private String errMsg;

private Throwable causeThrowable;

public NacosException() {
}

public NacosException(int errCode, String errMsg) {
super(errMsg);
this.errCode = errCode;
this.errMsg = errMsg;
}

public NacosException(int errCode, Throwable throwable) {
super(throwable);
this.errCode = errCode;
setCauseThrowable(throwable);
}

public NacosException(int errCode, String errMsg, Throwable throwable) {
super(errMsg, throwable);
this.errCode = errCode;
this.errMsg = errMsg;
setCauseThrowable(throwable);
}

public int getErrCode() {
return errCode;
}

public String getErrMsg() {
if (!StringUtils.isBlank(this.errMsg)) {
return errMsg;
}
if (this.causeThrowable != null) {
return causeThrowable.getMessage();
}
return Constants.NULL;
}

public void setErrCode(int errCode) {
this.errCode = errCode;
}

public void setErrMsg(String errMsg) {
this.errMsg = errMsg;
}

public void setCauseThrowable(Throwable throwable) {
this.causeThrowable = getCauseThrowable(throwable);
}

private Throwable getCauseThrowable(Throwable t) {
if (t.getCause() == null) {
return t;
}
return getCauseThrowable(t.getCause());
}

@Override
public String toString() {
return "ErrCode:" + getErrCode() + ", ErrMsg:" + getErrMsg();
}

/**
* client error code
* -400 -503 throw exception to user
*/
/**
* invalid param(参数错误)
*/
public static final int CLIENT_INVALID_PARAM = -400;
/**
* over client threshold(超过server端的限流阈值)
*/
public static final int CLIENT_OVER_THRESHOLD = -503;

/**
* server error code
* 400 403 throw exception to user
* 500 502 503 change ip and retry
*/

/**
* invalid param(参数错误)
*/
public static final int INVALID_PARAM = 400;
/**
* no right(鉴权失败)
*/
public static final int NO_RIGHT = 403;
/**
* not found
*/
public static final int NOT_FOUND = 404;
/**
* conflict(写并发冲突)
*/
public static final int CONFLICT = 409;
/**
* server error(server异常,如超时)
*/
public static final int SERVER_ERROR = 500;
/**
* bad gateway(路由异常,如nginx后面的Server挂掉)
*/
public static final int BAD_GATEWAY = 502;
/**
* over threshold(超过server端的限流阈值)
*/
public static final int OVER_THRESHOLD = 503;

public static final int RESOURCE_NOT_FOUND = -404;
/**
* serialVersionUID
*/
private static final long serialVersionUID = -3913902031489277776L;

private int errCode;

private String errMsg;

private Throwable causeThrowable;

public NacosException() {
}

public NacosException(int errCode, String errMsg) {
super(errMsg);
this.errCode = errCode;
this.errMsg = errMsg;
}

public NacosException(int errCode, Throwable throwable) {
super(throwable);
this.errCode = errCode;
setCauseThrowable(throwable);
}

public NacosException(int errCode, String errMsg, Throwable throwable) {
super(errMsg, throwable);
this.errCode = errCode;
this.errMsg = errMsg;
setCauseThrowable(throwable);
}

public int getErrCode() {
return errCode;
}

public String getErrMsg() {
if (!StringUtils.isBlank(this.errMsg)) {
return errMsg;
}
if (this.causeThrowable != null) {
return causeThrowable.getMessage();
}
return Constants.NULL;
}

public void setErrCode(int errCode) {
this.errCode = errCode;
}

public void setErrMsg(String errMsg) {
this.errMsg = errMsg;
}

public void setCauseThrowable(Throwable throwable) {
this.causeThrowable = getCauseThrowable(throwable);
}

private Throwable getCauseThrowable(Throwable t) {
if (t.getCause() == null) {
return t;
}
return getCauseThrowable(t.getCause());
}

@Override
public String toString() {
return "ErrCode:" + getErrCode() + ", ErrMsg:" + getErrMsg();
}

/**
* client error code
* -400 -503 throw exception to user
*/
/**
* invalid param(参数错误)
*/
public static final int CLIENT_INVALID_PARAM = -400;
/**
* over client threshold(超过server端的限流阈值)
*/
public static final int CLIENT_OVER_THRESHOLD = -503;

/**
* server error code
* 400 403 throw exception to user
* 500 502 503 change ip and retry
*/

/**
* invalid param(参数错误)
*/
public static final int INVALID_PARAM = 400;
/**
* no right(鉴权失败)
*/
public static final int NO_RIGHT = 403;
/**
* not found
*/
public static final int NOT_FOUND = 404;
/**
* conflict(写并发冲突)
*/
public static final int CONFLICT = 409;
/**
* server error(server异常,如超时)
*/
public static final int SERVER_ERROR = 500;
/**
* bad gateway(路由异常,如nginx后面的Server挂掉)
*/
public static final int BAD_GATEWAY = 502;
/**
* over threshold(超过server端的限流阈值)
*/
public static final int OVER_THRESHOLD = 503;

public static final int RESOURCE_NOT_FOUND = -404;

}
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ public boolean equals(Object obj) {
}

Instance host = (Instance) obj;

return strEquals(toString(), host.toString());
return strEquals(host.toString(), toString());
}

@Override
Expand Down
6 changes: 3 additions & 3 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.2.1</version>
<version>1.3.0-BETA</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -129,8 +129,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>6</source>
<target>6</target>
<source>7</source>
<target>7</target>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.alibaba.nacos.client.config.utils.ParamUtils;
import com.alibaba.nacos.client.utils.LogUtils;
import com.alibaba.nacos.client.utils.ParamUtil;
import com.alibaba.nacos.client.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;

Expand Down Expand Up @@ -70,6 +71,7 @@ public class NacosConfigService implements ConfigService {
private ConfigFilterChainManager configFilterChainManager = new ConfigFilterChainManager();

public NacosConfigService(Properties properties) throws NacosException {
ValidatorUtils.checkInitParam(properties);
String encodeTmp = properties.getProperty(PropertyKeyConst.ENCODE);
if (StringUtils.isBlank(encodeTmp)) {
encode = Constants.ENCODE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ public HttpResult httpDelete(String path, List<String> headers, List<String> par
return result;
}
} catch (ConnectException ce) {
ce.printStackTrace();
LOGGER.error("[NACOS ConnectException httpDelete] currentServerAddr:{}, err : {}", serverListMgr.getCurrentServerAddr(), ce.getMessage());
} catch (SocketTimeoutException stoe) {
stoe.printStackTrace();
LOGGER.error("[NACOS SocketTimeoutException httpDelete] currentServerAddr:{}, err : {}", serverListMgr.getCurrentServerAddr(), stoe.getMessage());
} catch (IOException ioe) {
LOGGER.error("[NACOS IOException httpDelete] currentServerAddr: " + serverListMgr.getCurrentServerAddr(), ioe);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.alibaba.nacos.client.config.filter.impl.ConfigFilterChainManager;
import com.alibaba.nacos.client.config.filter.impl.ConfigResponse;
import com.alibaba.nacos.client.config.listener.impl.AbstractConfigChangeListener;
import com.alibaba.nacos.client.config.utils.MD5;
import com.alibaba.nacos.common.utils.MD5Utils;
import com.alibaba.nacos.client.utils.LogUtils;
import com.alibaba.nacos.client.utils.TenantUtil;
import org.slf4j.Logger;
Expand Down Expand Up @@ -242,7 +242,7 @@ public void run() {
}

static public String getMd5String(String config) {
return (null == config) ? Constants.NULL : MD5.getInstance().getMD5String(config);
return (null == config) ? Constants.NULL : MD5Utils.md5Hex(config, Constants.ENCODE);
}

private String loadCacheContentFromDiskLocal(String name, String dataId, String group, String tenant) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.alibaba.nacos.client.config.http.HttpAgent;
import com.alibaba.nacos.client.config.impl.HttpSimpleClient.HttpResult;
import com.alibaba.nacos.client.config.utils.ContentUtils;
import com.alibaba.nacos.client.config.utils.MD5;
import com.alibaba.nacos.common.utils.MD5Utils;
import com.alibaba.nacos.client.monitor.MetricsMonitor;
import com.alibaba.nacos.client.utils.LogUtils;
import com.alibaba.nacos.client.utils.ParamUtil;
Expand Down Expand Up @@ -279,7 +279,7 @@ private void checkLocalConfig(CacheData cacheData) {
// 没有 -> 有
if (!cacheData.isUseLocalConfigInfo() && path.exists()) {
String content = LocalConfigInfoProcessor.getFailover(agent.getName(), dataId, group, tenant);
String md5 = MD5.getInstance().getMD5String(content);
String md5 = MD5Utils.md5Hex(content, Constants.ENCODE);
cacheData.setUseLocalConfigInfo(true);
cacheData.setLocalConfigInfoVersion(path.lastModified());
cacheData.setContent(content);
Expand All @@ -301,7 +301,7 @@ private void checkLocalConfig(CacheData cacheData) {
if (cacheData.isUseLocalConfigInfo() && path.exists()
&& cacheData.getLocalConfigInfoVersion() != path.lastModified()) {
String content = LocalConfigInfoProcessor.getFailover(agent.getName(), dataId, group, tenant);
String md5 = MD5.getInstance().getMD5String(content);
String md5 = MD5Utils.md5Hex(content, Constants.ENCODE);
cacheData.setUseLocalConfigInfo(true);
cacheData.setLocalConfigInfoVersion(path.lastModified());
cacheData.setContent(content);
Expand Down
Loading