If i am not missing anytthing, a small bit of optimization here, can be to check if toAnnounce set already has the path then just replace the bytes in local map which will be announced to zookeeper on start