|
|
@ -19,6 +19,7 @@ package org.apache.dolphinscheduler.server.master.registry; |
|
|
|
|
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.HEARTBEAT_FOR_ZOOKEEPER_INFO_LENGTH; |
|
|
|
import static org.apache.dolphinscheduler.common.Constants.HEARTBEAT_FOR_ZOOKEEPER_INFO_LENGTH; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.common.utils.NetUtils; |
|
|
|
import org.apache.dolphinscheduler.remote.utils.Constants; |
|
|
|
import org.apache.dolphinscheduler.remote.utils.Constants; |
|
|
|
import org.apache.dolphinscheduler.server.master.config.MasterConfig; |
|
|
|
import org.apache.dolphinscheduler.server.master.config.MasterConfig; |
|
|
|
import org.apache.dolphinscheduler.server.registry.ZookeeperRegistryCenter; |
|
|
|
import org.apache.dolphinscheduler.server.registry.ZookeeperRegistryCenter; |
|
|
@ -59,7 +60,7 @@ public class MasterRegistryTest { |
|
|
|
masterRegistry.registry(); |
|
|
|
masterRegistry.registry(); |
|
|
|
String masterPath = zookeeperRegistryCenter.getMasterPath(); |
|
|
|
String masterPath = zookeeperRegistryCenter.getMasterPath(); |
|
|
|
TimeUnit.SECONDS.sleep(masterConfig.getMasterHeartbeatInterval() + 2); //wait heartbeat info write into zk node
|
|
|
|
TimeUnit.SECONDS.sleep(masterConfig.getMasterHeartbeatInterval() + 2); //wait heartbeat info write into zk node
|
|
|
|
String masterNodePath = masterPath + "/" + (Constants.LOCAL_ADDRESS + ":" + masterConfig.getListenPort()); |
|
|
|
String masterNodePath = masterPath + "/" + (NetUtils.getAddr(Constants.LOCAL_ADDRESS, masterConfig.getListenPort())); |
|
|
|
String heartbeat = zookeeperRegistryCenter.getZookeeperCachedOperator().get(masterNodePath); |
|
|
|
String heartbeat = zookeeperRegistryCenter.getZookeeperCachedOperator().get(masterNodePath); |
|
|
|
Assert.assertEquals(HEARTBEAT_FOR_ZOOKEEPER_INFO_LENGTH, heartbeat.split(",").length); |
|
|
|
Assert.assertEquals(HEARTBEAT_FOR_ZOOKEEPER_INFO_LENGTH, heartbeat.split(",").length); |
|
|
|
masterRegistry.unRegistry(); |
|
|
|
masterRegistry.unRegistry(); |
|
|
|