You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2021/05/14 14:06:35 UTC
[shardingsphere] branch master updated: Update pom of governance
(#10342)
This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 8ea7a7d Update pom of governance (#10342)
8ea7a7d is described below
commit 8ea7a7d09abbf6924286bbca24443d54fb3f8a4d
Author: Liang Zhang <te...@163.com>
AuthorDate: Fri May 14 22:05:50 2021 +0800
Update pom of governance (#10342)
* Update EtcdRepository
* Update pom
* Update pom
* Refactor RegistryCenterRepositoryFacade
---
pom.xml | 15 ++++++++++++++
.../repository/RegistryCenterRepositoryFacade.java | 4 ++--
.../pom.xml | 11 ----------
.../governance/repository/etcd/EtcdRepository.java | 24 +++++++++++-----------
.../pom.xml | 1 +
.../zookeeper/CuratorZookeeperRepository.java | 2 +-
6 files changed, 31 insertions(+), 26 deletions(-)
diff --git a/pom.xml b/pom.xml
index ff3908a..f749676 100644
--- a/pom.xml
+++ b/pom.xml
@@ -312,6 +312,21 @@
<version>${curator.version}</version>
</dependency>
<dependency>
+ <groupId>io.etcd</groupId>
+ <artifactId>jetcd-core</artifactId>
+ <version>${jetcd.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.google.android</groupId>
+ <artifactId>annotations</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${springframework.version}</version>
diff --git a/shardingsphere-governance/shardingsphere-governance-core/src/main/java/org/apache/shardingsphere/governance/core/facade/repository/RegistryCenterRepositoryFacade.java b/shardingsphere-governance/shardingsphere-governance-core/src/main/java/org/apache/shardingsphere/governance/core/facade/repository/RegistryCenterRepositoryFacade.java
index 7e8f7ce..714fbe3 100644
--- a/shardingsphere-governance/shardingsphere-governance-core/src/main/java/org/apache/shardingsphere/governance/core/facade/repository/RegistryCenterRepositoryFacade.java
+++ b/shardingsphere-governance/shardingsphere-governance-core/src/main/java/org/apache/shardingsphere/governance/core/facade/repository/RegistryCenterRepositoryFacade.java
@@ -38,10 +38,10 @@ public final class RegistryCenterRepositoryFacade implements AutoCloseable {
private final RegistryCenterRepository registryCenterRepository;
public RegistryCenterRepositoryFacade(final GovernanceConfiguration config) {
- registryCenterRepository = createGovernanceRepository(config);
+ registryCenterRepository = createRegistryCenterRepository(config);
}
- private RegistryCenterRepository createGovernanceRepository(final GovernanceConfiguration config) {
+ private RegistryCenterRepository createRegistryCenterRepository(final GovernanceConfiguration config) {
RegistryCenterConfiguration registryCenterConfig = config.getRegistryCenterConfiguration();
Preconditions.checkNotNull(registryCenterConfig, "Registry center configuration cannot be null.");
RegistryCenterRepository result = TypedSPIRegistry.getRegisteredService(RegistryCenterRepository.class, registryCenterConfig.getType(), registryCenterConfig.getProps());
diff --git a/shardingsphere-governance/shardingsphere-governance-repository/shardingsphere-governance-repository-provider/shardingsphere-governance-repository-etcd/pom.xml b/shardingsphere-governance/shardingsphere-governance-repository/shardingsphere-governance-repository-provider/shardingsphere-governance-repository-etcd/pom.xml
index 77f9cb2..beb38c8 100644
--- a/shardingsphere-governance/shardingsphere-governance-repository/shardingsphere-governance-repository-provider/shardingsphere-governance-repository-etcd/pom.xml
+++ b/shardingsphere-governance/shardingsphere-governance-repository/shardingsphere-governance-repository-provider/shardingsphere-governance-repository-etcd/pom.xml
@@ -36,17 +36,6 @@
<dependency>
<groupId>io.etcd</groupId>
<artifactId>jetcd-core</artifactId>
- <version>${jetcd.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.google.android</groupId>
- <artifactId>annotations</artifactId>
- </exclusion>
- </exclusions>
</dependency>
</dependencies>
</project>
diff --git a/shardingsphere-governance/shardingsphere-governance-repository/shardingsphere-governance-repository-provider/shardingsphere-governance-repository-etcd/src/main/java/org/apache/shardingsphere/governance/repository/etcd/EtcdRepository.java b/shardingsphere-governance/shardingsphere-governance-repository/shardingsphere-governance-repository-provider/shardingsphere-governance-repository-etcd/src/main/java/org/apache/shardingsphere/governance/repository/etcd/EtcdRepository.java
index 4489c5d..01ef3cf 100644
--- a/shardingsphere-governance/shardingsphere-governance-repository/shardingsphere-governance-repository-provider/shardingsphere-governance-repository-etcd/src/main/java/org/apache/shardingsphere/governance/repository/etcd/EtcdRepository.java
+++ b/shardingsphere-governance/shardingsphere-governance-repository/shardingsphere-governance-repository-provider/shardingsphere-governance-repository-etcd/src/main/java/org/apache/shardingsphere/governance/repository/etcd/EtcdRepository.java
@@ -46,7 +46,7 @@ import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
- * Governance repository of ETCD.
+ * Registry repository of ETCD.
*/
public final class EtcdRepository implements RegistryCenterRepository {
@@ -101,17 +101,6 @@ public final class EtcdRepository implements RegistryCenterRepository {
}
@Override
- public boolean tryLock(final String key, final long time, final TimeUnit unit) {
- // TODO
- return false;
- }
-
- @Override
- public void releaseLock(final String key) {
- // TODO
- }
-
- @Override
public void delete(final String key) {
client.getKVClient().delete(ByteSequence.from(key, StandardCharsets.UTF_8));
}
@@ -142,6 +131,17 @@ public final class EtcdRepository implements RegistryCenterRepository {
}
@Override
+ public boolean tryLock(final String key, final long time, final TimeUnit unit) {
+ // TODO
+ return false;
+ }
+
+ @Override
+ public void releaseLock(final String key) {
+ // TODO
+ }
+
+ @Override
public void close() {
client.close();
}
diff --git a/shardingsphere-governance/shardingsphere-governance-repository/shardingsphere-governance-repository-provider/shardingsphere-governance-repository-zookeeper-curator/pom.xml b/shardingsphere-governance/shardingsphere-governance-repository/shardingsphere-governance-repository-provider/shardingsphere-governance-repository-zookeeper-curator/pom.xml
index 7a41817..2272dc0 100644
--- a/shardingsphere-governance/shardingsphere-governance-repository/shardingsphere-governance-repository-provider/shardingsphere-governance-repository-zookeeper-curator/pom.xml
+++ b/shardingsphere-governance/shardingsphere-governance-repository/shardingsphere-governance-repository-provider/shardingsphere-governance-repository-zookeeper-curator/pom.xml
@@ -45,6 +45,7 @@
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
</dependency>
+
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-test</artifactId>
diff --git a/shardingsphere-governance/shardingsphere-governance-repository/shardingsphere-governance-repository-provider/shardingsphere-governance-repository-zookeeper-curator/src/main/java/org/apache/shardingsphere/governance/repository/zookeeper/CuratorZookeeperRepository.java b/shardingsphere-governance/shardingsphere-governance-repository/shardingsphere-governance-repository-provider/shardingsphere-governance-repository-zookeeper-curator/src/main/java/org/apache/shardingsphere/govern [...]
index 57f8e57..76dccb6 100644
--- a/shardingsphere-governance/shardingsphere-governance-repository/shardingsphere-governance-repository-provider/shardingsphere-governance-repository-zookeeper-curator/src/main/java/org/apache/shardingsphere/governance/repository/zookeeper/CuratorZookeeperRepository.java
+++ b/shardingsphere-governance/shardingsphere-governance-repository/shardingsphere-governance-repository-provider/shardingsphere-governance-repository-zookeeper-curator/src/main/java/org/apache/shardingsphere/governance/repository/zookeeper/CuratorZookeeperRepository.java
@@ -58,7 +58,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
/**
- * Governance repository of ZooKeeper.
+ * Registry repository of ZooKeeper.
*/
public final class CuratorZookeeperRepository implements RegistryCenterRepository {