|
|
|
@ -97,11 +97,12 @@ public class WorkerRegistryClient implements AutoCloseable {
|
|
|
|
|
workerHeartBeat = workerHeartBeatTask.getHeartBeat(); |
|
|
|
|
Thread.sleep(SLEEP_TIME_MILLIS); |
|
|
|
|
} |
|
|
|
|
String workerZKPath = workerConfig.getWorkerRegistryPath(); |
|
|
|
|
String workerRegistryPath = workerConfig.getWorkerRegistryPath(); |
|
|
|
|
// remove before persist
|
|
|
|
|
registryClient.remove(workerZKPath); |
|
|
|
|
registryClient.persistEphemeral(workerZKPath, JSONUtils.toJsonString(workerHeartBeat)); |
|
|
|
|
log.info("Worker node: {} registry to ZK {} successfully", workerConfig.getWorkerAddress(), workerZKPath); |
|
|
|
|
registryClient.remove(workerRegistryPath); |
|
|
|
|
registryClient.persistEphemeral(workerRegistryPath, JSONUtils.toJsonString(workerHeartBeat)); |
|
|
|
|
log.info("Worker node: {} registry to registry center {} successfully", workerConfig.getWorkerAddress(), |
|
|
|
|
workerRegistryPath); |
|
|
|
|
|
|
|
|
|
while (!registryClient.checkNodeExists(workerConfig.getWorkerAddress(), RegistryNodeType.WORKER)) { |
|
|
|
|
ThreadUtils.sleep(SLEEP_TIME_MILLIS); |
|
|
|
|