String zkMasterPath = _zkConf.getZkPath(PathDef.MASTER);
cleanupOldMasterData(masterName, zkMasterPath);
boolean isMaster;
try {
createEphemeral(master, zkMasterPath, new MasterMetaData(masterName, System.currentTimeMillis()));
isMaster = true;
LOG.info(masterName + " started as master");
} catch (ZkNodeExistsException e) {
registerDataListener(master, new IZkDataListener() {
@Override