Commit Graph

1106 Commits

Author SHA1 Message Date
brotherlu-xcq
27b0a0cd8a
[ISSUE #6643] Add unit tests for package com.alibaba.nacos.naming.core.v2.service. (#6644) 2021-08-13 09:47:00 +08:00
brotherlu-xcq
025bee74c9
[ISSUE #6535] throw the NacosException in 2.x to keep same with 1.x when Service doesn't exist. (#6597)
* [ISSUE #6535] throw the service not find exception in Nacos 2.x when service no exist.

* [ISSUE #6535] remove the unnecessary variable.
2021-08-10 09:41:17 +08:00
MajorHe1
0b15090bab
[ISSUE #6572] add client info for OperatorController metrics interface (#6576)
* [ISSUE #6572] add client info for OperatorController metrics interface

* [ISSUE #6572] move PERSISTENT_SUFFIX to ClientConstants
2021-08-09 09:52:32 +08:00
MajorHe1
765646db43
[ISSUE #6581] fix json deserialization error of ServiceController subscribers interface (#6582) 2021-08-06 09:46:08 +08:00
ZZQ的
ea864c8c5a
Remove pom dependency (#6561) 2021-08-05 09:35:49 +08:00
brotherlu-xcq
787e161fa9
[ISSUE #6543] Add unit tests for package com.alibaba.nacos.naming.core.*. (#6547)
* [ISSUE #6543] add the unit test of CatalogServiceV2Impl.

* [ISSUE #6543] add unit test of InstanceOperatorClientImpl, HealthOperatorV1ImplTest, HealthOperatorV2ImplTest.

* [ISSUE #6543] add unit test of ServiceOperatorV2Impl.
2021-08-04 09:53:21 +08:00
Roger3581321
2ff8da4832
add final to modify the utility class (#6511) 2021-08-02 09:42:13 +08:00
ZZQ的
a729001ec5
[Reduce dependence]>[Sets] Replace "google.common.collect.*" API with… (#6445)
* [Reduce dependence]>[Sets] Replace "google.common.collect.*" API with jdk API

* delete empty line separator
2021-07-30 16:32:38 +08:00
ZZQ的
9beaacbc54
[Reduce dependence]>[Maps] Replace "google.common.collect.*" API with jdk API (#6443) 2021-07-29 10:46:22 +08:00
杨翊 SionYang
7f567d19c9
remove unused class (#6475) 2021-07-27 19:18:41 +08:00
ZZQ的
47c6706a63
[Reduce dependence]>[Lists] Replace "google.common.collect.*" API wit… (#6404)
* [Reduce dependence]>[Lists] Replace "google.common.collect.*" API with jdk API

* use elements.size to init the array length

* Replace IllegalArgumentException with NullPointerException

* Refactor CollectionUtilsTest#list()

* Add exception message

* update annotation

* update unit test method name
2021-07-27 13:47:41 +08:00
杨翊 SionYang
a5cc7178fc
[ISSUE#6403] the expired time of naming client can be configured. (#6422)
* add AbstractDynamicConfig

* Add ClientConfig

* use ClientConfig to remove expired client.

* For checkstyle

* Update application.properties
2021-07-23 14:03:46 +08:00
brotherlu-xcq
8077ce02a4
[ISSUE #5520] Add unit tests for package com.alibaba.nacos.naming.core.v2.cleaner in nacos2.0. (#6401)
* [ISSUE #5520] add unit test for EmptyServiceAutoCleaner.

* [ISSUE #5520] add unit test for EmptyServiceAutoCleanerV2.
2021-07-22 10:15:21 +08:00
brotherlu-xcq
a64f5b592b
[ISSUE #5519] Add unit tests to package com.alibaba.nacos.naming.controllers in nacos 2.0. (#6414)
* [ISSUE #5519] complete CatalogControllerTest.

* [ISSUE #5519] add unit test in controllers, not include deprecated method.

* [ISSUE #5519] fix ci issue.
2021-07-22 09:58:12 +08:00
brotherlu-xcq
784cc82d9e
[ISSUE #6365] Implement the built-in Selector in Nacos 1.x and add unit test. (#6383)
* [ISSUE #6301] implement the CmdbSelectorContextBuilder and move the 1.x LabelSelector logic to CmdbLabelSelector and add unit test.

* [ISSUE #6301] remove the unused method.

* [ISSUE #6301] fix ci issue.
2021-07-20 10:33:58 +08:00
Pixy Yuan
22393e4456
[ISSUE #6386] Stop v1 distro verification when cluster upgraded to v2. (#6387) 2021-07-19 16:42:34 +08:00
brotherlu-xcq
bb987d05f5
[ISSUE #6356] Define the Selector workflow and add unit test. (#6357)
* [ISSUE #6301] Define the workflow of Selector.

* [ISSUE #6301] Add unit test for SelectorManager.

* [ISSUE #6301] fix ci issue.

* [ISSUE #6301] test Selector with serial.

* [ISSUE #6301] fix javadoc.
2021-07-16 11:31:33 +08:00
杨翊 SionYang
44a1d02922
Fix instance metadata will not be removed for ip port client. (#6332) 2021-07-12 14:32:15 +08:00
hunjipo
cdc276e829
To slightly improve performance, this commit switches to StringBuilder.append(char) instead of StringBuilder.append(String) whenever we append a single character to a StringBuilder. (#6300) 2021-07-12 13:51:14 +08:00
孙继峰
f326a0c543
[ISSUE #5095] Add unit test for ClassUtils (#6327)
* fix typo

* add unit test for ClassUtils
2021-07-12 09:45:35 +08:00
ZZQ的
98e1e72ed9
[issue #6284][naming module] replace *commons.lang3*.*Utils to com.al… (#6291)
* [issue #6284][naming module] replace *commons.lang3*.*Utils to com.alibaba.nacos.common.utils.*Utils

* add StringUtils.split() function

* Replace NumberUtils.isNumber()  -> NumberUtils.isDigits()
2021-07-12 09:16:57 +08:00
杨翊 SionYang
5e545c8d37
[ISSUE#6272] Refactor Instance builder to build and handler request from http. (#6298)
* Add InstanceBuilder and IdGenerator

* Add new builder for http request and client beat

* Use new builder to build api instance.

* Modified according review comment.
2021-07-07 17:01:40 +08:00
shalk(xiao kun)
c973566db9
[ISSUE #6188]add ut for com.alibaba.nacos.naming.cluster (#6279)
* add ut for  com.alibaba.nacos.naming.cluster

* fix ut
2021-07-07 10:02:01 +08:00
杨翊 SionYang
5c375afe81
Add SPI for ClientBeatExtensionHandler (#6250) 2021-07-02 17:17:24 +08:00
孙继峰
f36556657f
[ISSUE #6197] Use java.util.Objects instead of com.alibaba.nacos.common.utils.Objects (#6218) 2021-07-01 11:32:34 +08:00
杨翊 SionYang
eb2644fd37
Add SPI for upgrade checker. (#6217)
* Add SPI for upgrade checker.

* For checkstyle
2021-07-01 11:20:41 +08:00
赵延
3fd77bc7e0
If the client already disconnect, ignore this request to avoid NPE. (#6175)
* if the client already disconnect, ignore this request to avoid npe.

* unify code with DistroClientDataProcessor.

* print warn info when client already disconnect.

* transfer client check logic to method.

* if client is not ephemeral, is illegal.
2021-06-30 10:15:06 +08:00
杨翊 SionYang
f2676bc6ca
[ISSUE#6129] Add ServerConfigChangeEvent when config file changed. (#6130)
* Add ServerConfigChangeEvent when config file changed.

* Upgrade config after notify ServerConfigChangeEvent
2021-06-22 14:39:37 +08:00
Pixy Yuan
ea803a85ae
[ISSUE #6109] Using configuration to register upgrade helpers as conditional beans. (#6115) 2021-06-22 14:07:57 +08:00
杨翊 SionYang
4a474ce30a
For #6116. Refactor ClientManager and make register client and schedule checkTask is atomic. (#6118) 2021-06-22 09:49:59 +08:00
杨翊 SionYang
463a29f082
Develop fix ci (#6092)
* Fix github CI

* Add github IT
2021-06-17 15:15:54 +08:00
zhox
1b18f2c3ca
[code quality][nacos-address]improve the code of ServiceManager.java (#5919)
* [code quality][nacos-address]improve the code of ServiceManager.java

* remove unused import

* 1 fix with ServiceManager.java

* 1 fix with ServiceManager.java
2021-06-16 10:24:36 +08:00
杨翊 SionYang
6ca9c25a68
Fix Unit test in nacos naming module (#6031) 2021-06-15 14:00:17 +08:00
李晓双 Li Xiao Shuang
43f4d5d927
improve the code quality for naming (#6008) 2021-06-09 10:05:23 +08:00
Cherish 蔡
c025dc2c18
Feat resource parser group (#5889)
* feat(#5888): ResourceParser groupName change the splicing method.

* feat(#5888): add UT for NamingResourceParser and ConfigResourceParser
2021-06-09 09:48:18 +08:00
杨翊 SionYang
ae39b9502a
[ISSUE#5921] Adapt some Naming API after upgrading to v2.x. (#5972)
* Fix #5921, Adapt some Naming API after upgrading to v2.x.

* Fix pmd
2021-06-07 16:37:01 +08:00
李晓双 Li Xiao Shuang
90cb967763
improve the code quality for naming misc (#5944) 2021-06-07 14:30:24 +08:00
杨翊 SionYang
1d5a6605ee
[ISSUE#5918] Refactor event publisher in naming module to fix event without orders. (#5930)
* Rollback #5778.

* Add method to register custom sharded event publisher

* Make naming module event use custom sharded publisher
2021-06-03 12:53:29 +08:00
李晓双 Li Xiao Shuang
7a7f267ee9
improve the code quality for naming healthcheck (#5932) 2021-06-03 11:31:39 +08:00
李晓双 Li Xiao Shuang
e199a5ee64
[ISSUE #5774] improve the code quality for naming core (#5914)
* mprove the code quality for naming core

* fix build
2021-06-03 09:59:52 +08:00
Pixy Yuan
07f38a4763
[ISSUE #5927] Init health check status when loading snapshot of persistent instances. (#5928) 2021-06-03 09:35:01 +08:00
杨翊 SionYang
09c7293085
Stop do sync when sync is no need. (#5882) 2021-05-28 14:08:25 +08:00
孙继峰
15c71831e7
[ISSUE #5765] fix localhost not match ip (#5852)
* rename IPUitl to InternetAddressUtil

* move isDomain to InternetAddressUtil

* [ISSUE #5765] fix localhost not match ip

* fix typo

* delete the verification IP, follow the single responsibility principle
2021-05-27 19:01:39 +08:00
tianqingzhao
3b3de662c5
Optimize code that all checks for empty service. (#5869)
* Optimize code that all checks for empty service.

* Add Agreement License.
2021-05-27 18:10:55 +08:00
Pixy Yuan
ebd6322e7e
[ISSUE #5872] Downgrade checker only focus on changing members. (#5873) 2021-05-27 17:44:30 +08:00
Pixy Yuan
34ed52192a
[ISSUE #5870] Prevent instance ephemeral value used by DoubleWrite. (#5871)
* Fix client beat task skip interceptors unexpectedly

* Refactor transform instance and service/cluster between v1/v2 model.

* [ISSUE #5870] Prevent instance ephemeral value used by DoubleWrite.
2021-05-27 17:41:38 +08:00
tianqingzhao
a233563e82
Optimize code that checks for empty service. (#5840) 2021-05-26 10:07:19 +08:00
tianqingzhao
5e40b78500
Remove any extra curly brace suffixes from the log (#5810) 2021-05-24 14:03:05 +08:00
Pixy Yuan
5c7730737a
[ISSUE #5798] Fix upgraded server cannot downgrade and upgrade again. (#5800)
* [ISSUE #5798] Fix upgraded server cannot downgrade and upgrade again.

* Fix NPE when delete ServiceMetadata of an non-exist service.
2021-05-21 11:06:49 +08:00
Pixy Yuan
93fd771271
[ISSUE #5782] Fix removal of instances when DoubleWrite removing service. (#5793) 2021-05-20 11:12:03 +08:00
Pixy Yuan
c858139329
[ISSUE #5775] Persist the cluster upgrade states to disk. (#5792) 2021-05-20 11:11:07 +08:00
李晓双 Li Xiao Shuang
35c8035861
[ISSUE #5774] improve the code quality for controllers (#5784)
* improve the code quality for controllers

* improve the code quality for controllers
2021-05-20 11:05:54 +08:00
李晓双 Li Xiao Shuang
022fb6ac68
improve the code quality for consistency (#5783) 2021-05-20 11:04:56 +08:00
李晓双 Li Xiao Shuang
08db47ce84
magic number (#5781) 2021-05-20 09:51:52 +08:00
FlyingLambrog
5e80d12932
Add unit tests for class naming.core.ClusterOperatorV2Impl (#5763) 2021-05-18 19:52:47 +08:00
Pixy Yuan
4655dded44
[ISSUE #5767] Cleanup data of v1 after disable DoubleWrite. (#5772) 2021-05-18 19:48:07 +08:00
Pixy Yuan
160ed5b360
[ISSUE #5756] Support to specify ephemeral value for createService (#5757)
* [ISSUE #5756] Support to specify ephemeral value for `UpgradeOpsController.createService` .

* [ISSUE #5756] Fix PathVariable is not supported by DistroFilter.
2021-05-17 20:19:43 +08:00
haoyann
536da8214c
remove duplicate client expire check (#5751) 2021-05-17 10:10:54 +08:00
FlyingLambrog
5cb3b6db20
Add unit tests for package com.alibaba.nacos.naming.core.v2.cleaner (#5750) 2021-05-17 10:08:54 +08:00
xiaoheng1
2783167bd3
fix #5724 Extract constants in JacksonSerializer (#5725) 2021-05-17 09:48:46 +08:00
Pixy Yuan
2b076faa63
[ISSUE #5718] Add some APIs for upgrade ops. (#5719)
* [ISSUE #5718] Add some APIs for upgrade ops.

* [ISSUE #5718] Optimize textual field output of metrics API.
2021-05-17 09:47:03 +08:00
xiaoheng1
b33134cf50
Extract constants in HealthController (#5717)
* fix #5715 Extract constants in HealthController

* fix #5715 Extract constants in HealthController

* add license
2021-05-17 09:44:23 +08:00
李晓双 Li Xiao Shuang
fdaf1d9cd9
add unit test for SpiImplPushExecutorHolder (#5716) 2021-05-17 09:42:48 +08:00
李晓双 Li Xiao Shuang
2bc782ee9c
add unit test for ServiceChangeEvent (#5714) 2021-05-17 09:42:10 +08:00
李晓双 Li Xiao Shuang
1974cf01b3
fix magic number (#5709) 2021-05-14 14:46:59 +08:00
KomachiSion
cf5a171ac5 Merge remote-tracking branch 'upstream/develop' into feature_support_grpc_core
# Conflicts:
#	NOTICE
#	api/pom.xml
#	common/src/main/java/com/alibaba/nacos/common/notify/DefaultPublisher.java
#	config/src/main/java/com/alibaba/nacos/config/server/service/LongPollingService.java
#	naming/src/test/java/com/alibaba/nacos/naming/consistency/persistent/impl/NamingSnapshotOperationTest.java
#	naming/src/test/java/com/alibaba/nacos/naming/core/DomainsManagerTest.java
#	naming/src/test/java/com/alibaba/nacos/naming/healthcheck/ClientBeatCheckTaskTest.java
#	pom.xml
#	test/src/test/java/com/alibaba/nacos/test/core/JacksonUtils.java
2021-05-14 11:04:52 +08:00
Pixy Yuan
98aae398f8
[ISSUE #5692] Make service removal sensed by double write. (#5706)
* [ISSUE #5692] Add double write task sensing removal of v2 service.

* [ISSUE #5692] Add double write task sensing removal of v1 service.

* [ISSUE #5692] Make async checker of services sensing removal of v1 service.
2021-05-14 09:54:52 +08:00
mingyang feng
64601e0581
Fixes logical judgment expression #5683 (#5685)
* One aspect of code quality is to have better expressions.

* Update ClientBeatProcessor.java

* Update ClientBeatProcessor.java
2021-05-14 09:39:36 +08:00
杨翊 SionYang
d929c2e328
Add monitor about Distro (#5686) 2021-05-12 16:42:37 +08:00
Pixy Yuan
b6d96b69c7
Fix service group name when upgrading. (#5674)
* [ISSUE #5671] Prefer serviceV2.groupName using groupName in serviceV1.name

* [ISSUE #5671] Add groupName to service when creating by v1 operator
2021-05-11 20:41:18 +08:00
JackSun-Developer
af0f01d21b
[#5600] The class com.alibaba.nacos.naming.core.DistroMapperTest lacks Unit Test. (#5605) 2021-05-10 11:44:41 +08:00
FlyingLambrog
af0c2f5fcb
Add unit test for class naming.consistency.persistent.impl.NamingKvStorage (#5568) 2021-05-10 11:43:51 +08:00
JackSun-Developer
5395237062
[#5581] The class DataStore lacks a lot of Unit Tests. (#5582) 2021-05-10 11:10:56 +08:00
李晓双 Li Xiao Shuang
16e80ec91f
add unit test for v2 index (#5563) 2021-05-10 10:53:15 +08:00
李晓双 Li Xiao Shuang
0541ba8deb
[ISSUE #5522] add unit test for MetadataOperation (#5608)
* add unit test for MetadataOperation

* update method name
2021-05-10 10:47:28 +08:00
李晓双 Li Xiao Shuang
b478166d1c
add unit test for NamingMetadataManager (#5609) 2021-05-10 10:47:09 +08:00
李晓双 Li Xiao Shuang
7f924b58f1
add unit test for NamingMetadataOperateService (#5610) 2021-05-10 10:46:52 +08:00
李晓双 Li Xiao Shuang
8fa60671e9
add unit test for ServiceMetadata (#5611) 2021-05-10 10:46:29 +08:00
李晓双 Li Xiao Shuang
b70549d6e3
add unit test for ServiceMetadataSnapshotOperation (#5613) 2021-05-10 10:46:13 +08:00
李晓双 Li Xiao Shuang
4bc80436da
add unit test for ServiceMetadataProcessor (#5614) 2021-05-10 10:45:06 +08:00
孙继峰
818d37b71c
delete duplicated dependency (#5622) 2021-05-10 10:43:58 +08:00
JackSun-Developer
52278a4849
[#5554] Fix Unit Test for com.alibaba.nacos.naming.core.DomainsManager.java (#5555) 2021-04-30 18:06:29 +08:00
JackSun-Developer
1b1975a2fd
[#5551] Fix Unit Test for com.alibaba.nacos.naming.healthcheck.ClientBeatCheckTask (#5552) 2021-04-30 18:06:12 +08:00
JackSun-Developer
ca7e4cc780
[#5549] Fix Unit test for NamingSnapshotOperationTest.java (#5550) 2021-04-30 18:05:45 +08:00
JackSun-Developer
7d110e665e
[#5545] naming/src/test/java/com/alibaba/nacos/naming/consistency/persistent/ClusterVersionJudgementTest.java unit tests cannot pass, and have bad code style. (#5546) 2021-04-30 15:48:50 +08:00
KomachiSion
2847373fd0 Solve conflict 2021-04-27 16:19:56 +08:00
KomachiSion
92da848375 Merge remote-tracking branch 'upstream/develop' into merge-1.X-to-2.0
# Conflicts:
#	client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java
#	client/src/main/java/com/alibaba/nacos/client/config/impl/CacheData.java
#	client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java
#	client/src/main/java/com/alibaba/nacos/client/naming/core/PushReceiver.java
#	console/src/main/resources/static/css/main.css
#	console/src/main/resources/static/js/main.js
#	naming/src/main/java/com/alibaba/nacos/naming/core/SubscribeManager.java
#	naming/src/test/java/com/alibaba/nacos/naming/core/SubscribeManagerTest.java
#	test/src/test/java/com/alibaba/nacos/test/BaseTest.java
2021-04-27 15:57:24 +08:00
KomachiSion
bd8ac55386 rollback subscribers push data immediately to protect push frequent. 2021-04-27 15:38:26 +08:00
李晓双 Li Xiao Shuang
6c20d35af8
add unit test for PersistentConsistencyServiceDelegateImpl (#5491)
* add unit test for PersistentConsistencyServiceDelegateImpl

* add unit test for PersistentConsistencyServiceDelegateImpl

* add unit test for PersistentConsistencyServiceDelegateImpl
2021-04-27 10:12:02 +08:00
杨翊 SionYang
71a0037f50
Refactor Distro Config as singleton and replace GlobalConfig (#5486)
* Refactor Distro Config as singleton and replace GlobalConfig

* Use configed timeout for distro sync and verify

* Fix IT error.
2021-04-25 16:50:10 +08:00
杨翊 SionYang
267d67190b
Some enhancement for logs and ability. (#5482) 2021-04-25 13:08:24 +08:00
JackSun-Developer
ee8f636db1
[#5467] com.alibaba.nacos.naming.consistency.DelegateConsistencyServiceImpl lacks a lot of Unit Tests. (#5468) 2021-04-23 19:14:37 +08:00
brothelul
6c270cb3ac
[ISSUE #5078] set default pageSize to 10000 for getting all the subscribers in other server node. (#5424)
* hardcode to get all the subscribers by set the pageSize to 10000

* change the default pageSize from 10000 to 1000

* change the param of getSubscriber to support the pageNo and pageSize
2021-04-23 09:52:04 +08:00
Pixy Yuan
758b8b3942
[ISSUE #5442] change state to UP when received status form old version server (#5445)
* [ISSUE #5442] change state to UP when received status form old version server

* [ISSUE #5442] Optimize server status received logic
2021-04-22 16:39:19 +08:00
MajorHe1
0a4f7f5e75
[ISSUE #5361] check isUseGrpcFeatures() when subscribe service using GRPC (#5411)
* [ISSUE #5361] check isUseGrpcFeatures() when subscribe service using GRPC

* [ISSUE #5361] add a GrpcRequestFilter to check isUseGrpcFeatures() when using GRPC protocol

* [ISSUE #5361] add a judgement whether request instance of AbstractNamingRequest

* [ISSUE #5361] reformat code using nacos-code-style-for-idea.xml
2021-04-22 10:12:57 +08:00
杨翊 SionYang
4c1b879d00
For #5419, Fix Nacos 2.0 client auth may invalid for non public namespace. (#5422) 2021-04-20 19:29:59 +08:00
杨翊 SionYang
3a4c8efb14
For #5404, Fix frequently udp push for client 1.X (#5413) 2021-04-20 09:57:14 +08:00
杨翊 SionYang
73eea9c0bb
Use ThreadUtil and EnvUtil replace Runtime.availableProcessor (#5388) 2021-04-16 17:32:14 +08:00
MajorHe1
ec2528f475
[ISSUE #5361] check isUseGrpcFeatures() when register instance using GRPC protocol (#5365)
* [ISSUE #5361] check isUseGrpcFeatures() when register instance using GRPC protocol

* [ISSUE #5361] change hint message when register instance failed using GRPC
2021-04-16 10:34:58 +08:00
JackSun-Developer
02ebe0190e
[#5350] In version 1.4.1, modify the Server is Down prompt to the specific reason for the machine failure and send it to the user (#5360) 2021-04-14 10:02:49 +08:00