-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refs/heads/v3.0-develop' into summer-ospp#12028-sync-de…
…velop # Conflicts: # auth/src/test/java/com/alibaba/nacos/auth/config/AuthConfigsTest.java # config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigServletInner.java # config/src/main/java/com/alibaba/nacos/config/server/remote/ConfigPublishRequestHandler.java # config/src/main/java/com/alibaba/nacos/config/server/remote/ConfigQueryRequestHandler.java # config/src/main/java/com/alibaba/nacos/config/server/service/ConfigOperationService.java # config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpChangeConfigWorker.java # config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpConfigHandler.java # config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpService.java # config/src/main/java/com/alibaba/nacos/config/server/service/dump/processor/DumpAllProcessor.java # config/src/main/java/com/alibaba/nacos/config/server/service/merge/MergeDatumService.java # config/src/test/java/com/alibaba/nacos/config/server/controller/v2/ConfigControllerV2Test.java # console/pom.xml # console/src/main/java/com/alibaba/nacos/console/config/ConsoleConfig.java # core/src/main/java/com/alibaba/nacos/core/auth/AuthFilter.java # core/src/main/java/com/alibaba/nacos/core/cluster/ServerMemberManager.java # core/src/main/java/com/alibaba/nacos/core/listener/StartingApplicationListener.java # core/src/main/resources/META-INF/logback/nacos.xml # core/src/test/java/com/alibaba/nacos/core/auth/AuthFilterTest.java # core/src/test/java/com/alibaba/nacos/core/cluster/ServerMemberManagerTest.java # distribution/conf/nacos-logback.xml # plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/NacosAuthConfig.java # plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/NacosAuthManager.java # plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/authenticate/AuthenticationManagerDelegator.java # plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/filter/JwtAuthenticationTokenFilter.java # pom.xml # prometheus/src/main/java/com/alibaba/nacos/prometheus/conf/PrometheusSecurityConfiguration.java
- Loading branch information
Showing
619 changed files
with
34,027 additions
and
11,660 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
api/src/main/java/com/alibaba/nacos/api/lock/LockService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* Copyright 1999-2023 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.lock; | ||
|
||
import com.alibaba.nacos.api.exception.NacosException; | ||
import com.alibaba.nacos.api.lock.model.LockInstance; | ||
|
||
import java.util.Properties; | ||
|
||
/** | ||
* Nacos Lock Process. | ||
* | ||
* <p>lock => {@link LockService#lock(LockInstance)} -> {@link LockInstance#lock(LockService)} -> | ||
* {@link LockService#remoteTryLock(LockInstance)} <br/> unLock => {@link LockService#unLock(LockInstance)} -> | ||
* {@link LockInstance#unLock(LockService)} -> {@link LockService#remoteReleaseLock(LockInstance)} | ||
* | ||
* @author [email protected] | ||
* @date 2023/8/24 19:49 | ||
*/ | ||
public interface LockService { | ||
|
||
/** | ||
* Real lock method expose to user to acquire the lock.<br/> It will call {@link LockInstance#lock(LockService)} | ||
* <br/> | ||
* | ||
* @param instance instance | ||
* @return Boolean | ||
* @throws NacosException NacosException | ||
*/ | ||
Boolean lock(LockInstance instance) throws NacosException; | ||
|
||
/** | ||
* Real lock method expose to user to release the lock.<br/> It will call {@link LockInstance#unLock(LockService)} | ||
* <br/> | ||
* | ||
* @param instance instance | ||
* @return Boolean | ||
* @throws NacosException NacosException | ||
*/ | ||
Boolean unLock(LockInstance instance) throws NacosException; | ||
|
||
/** | ||
* use grpc request to try lock. | ||
* | ||
* @param instance instance | ||
* @return Boolean | ||
* @throws NacosException NacosException | ||
*/ | ||
Boolean remoteTryLock(LockInstance instance) throws NacosException; | ||
|
||
/** | ||
* use grpc request to release lock. | ||
* | ||
* @param instance instance | ||
* @return Boolean | ||
* @throws NacosException NacosException | ||
*/ | ||
Boolean remoteReleaseLock(LockInstance instance) throws NacosException; | ||
|
||
/** | ||
* get properties. | ||
* | ||
* @return Properties | ||
*/ | ||
Properties getProperties(); | ||
} |
48 changes: 48 additions & 0 deletions
48
api/src/main/java/com/alibaba/nacos/api/lock/NacosLockFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright 1999-2023 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.lock; | ||
|
||
import com.alibaba.nacos.api.exception.NacosException; | ||
|
||
import java.lang.reflect.Constructor; | ||
import java.util.Properties; | ||
|
||
/** | ||
* lock Factory. | ||
* | ||
* @author [email protected] | ||
* @date 2023/8/25 0:40 | ||
*/ | ||
public class NacosLockFactory { | ||
|
||
/** | ||
* Create a new lock service. | ||
* | ||
* @param properties lock service properties | ||
* @return new lock service | ||
* @throws NacosException nacos exception | ||
*/ | ||
public static LockService createLockService(Properties properties) throws NacosException { | ||
try { | ||
Class<?> driverImplClass = Class.forName("com.alibaba.nacos.client.lock.NacosLockService"); | ||
Constructor constructor = driverImplClass.getConstructor(Properties.class); | ||
return (LockService) constructor.newInstance(properties); | ||
} catch (Throwable e) { | ||
throw new NacosException(NacosException.CLIENT_INVALID_PARAM, e); | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
api/src/main/java/com/alibaba/nacos/api/lock/common/LockConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright 1999-2023 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.lock.common; | ||
|
||
/** | ||
* lock constant. | ||
* | ||
* @author [email protected] | ||
* @date 2023/8/23 15:53 | ||
*/ | ||
public class LockConstants { | ||
|
||
public static final String NACOS_LOCK_TYPE = "NACOS_LOCK"; | ||
} |
31 changes: 31 additions & 0 deletions
31
api/src/main/java/com/alibaba/nacos/api/lock/constant/PropertyConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright 1999-2023 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.lock.constant; | ||
|
||
/** | ||
* lock properties constants. | ||
* @author [email protected] | ||
* @description PropertyConstants | ||
* @date 2023/6/28 17:38 | ||
*/ | ||
public class PropertyConstants { | ||
public static final String LOCK_REQUEST_TIMEOUT = "lockRequestTimeout"; | ||
|
||
public static final String LOCK_DEFAULT_WAIT_TIME = "nacos.lock.default_wait_time"; | ||
|
||
public static final Long LOCK_DEFAULT_WAIT_SECOND = 10_000L; | ||
} |
Oops, something went wrong.