@Override
    public void execute() throws KeeperException, InterruptedException {
        final WorkerSignature signature = (WorkerSignature) zookeeper.getObject(ZookeeperStrings
                .workerSignaturePath(workerId), false, null);
        final WorkerSystemInfo systemInfo = (WorkerSystemInfo) zookeeper.getObject(ZookeeperStrings
                .workerSystemInfoPath(workerId), false, null);
        if (event == null || event.getType() == EventType.NodeCreated) {
            master.joinWorkerServer(signature, systemInfo);
            if (event != null) {
                // We have to re-register the watcher again.
                if (zookeeper.exists(ZookeeperStrings.workerHeartPath(workerId), this) == null) {
                    master.leaveWorkerServer(signature);
                }
            }
        } else if (event.getType() == EventType.NodeDeleted) {
            master.leaveWorkerServer(signature);
        }
    }