Browse Source

[Improvement][Worker] Rename workerZKPath to workerRegistryPath (#16144)

upstream-dev
Cancai Cai 5 months ago committed by GitHub
parent
commit
8e53f2fdcb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/registry/WorkerRegistryClient.java

9
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/registry/WorkerRegistryClient.java

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

Loading…
Cancel
Save