You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kyuubi.apache.org by GitBox <gi...@apache.org> on 2021/11/19 01:27:59 UTC
[GitHub] [incubator-kyuubi] hddong commented on issue #1392: [Umbrella] Support service discovery through etcd
hddong commented on issue #1392:
URL: https://github.com/apache/incubator-kyuubi/issues/1392#issuecomment-973644283
Sure.
## The modules:
```
kyuubi-ha
- kyuubi-ha-common
- kyuubi-ha-zookeeper
- kyuubi-ha-etcd
```
## Implementation
There are mainly two classes, `ServiceDiscovery` and `ZooKeeperClientProvider`, for other modules to use.
1. `ServiceDiscovery`
- use a new class `AbstractInstanceClient` instead of `zkClient`
![image](https://user-images.githubusercontent.com/17537134/142390603-34316812-e8eb-4541-8710-a5fc2b0a1394.png)
- Move static functions in `ServiceDiscovery` to `DiscoveryClient`
![image](https://user-images.githubusercontent.com/17537134/142521520-64f092a4-e882-48bb-a605-fd377079c9fe.png)
`DiscoveryClient` contains discovery api( E.g `createServiceNodeAndGetPath`, `getServiceNodesInfo`) and client api (E.g `getChildren`, `delete`).
2. `ZooKeeperClientProvider`
Abstract as `DiscoveryClientProvider`
![image](https://user-images.githubusercontent.com/17537134/142527191-d37870aa-40ef-42dc-a9af-be1d4b93c17b.png)
## Usages
In other modules, original:
```scala
withZkClient(conf) { framework =>
createServiceNodeAndGetPath(conf, framework, uniqueNamespace, "localhost:10000")
framework.delete().forPath(nodePath)
}
```
we can change to:
```scala
withDiscoveryClient(conf) { framework =>
framework.createServiceNodeAndGetPath(conf, uniqueNamespace, "localhost:10000")
framework.delete(nodePath)
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org