s4rToDeploy = tmpS4R;
}
}
final String uri = s4rToDeploy.toURI().toString();
ZNRecord record = new ZNRecord(String.valueOf(System.currentTimeMillis()));
record.putSimpleField(DistributedDeploymentManager.S4R_URI, uri);
record.putSimpleField("name", deployArgs.appName);
String deployedAppPath = "/s4/clusters/" + deployArgs.clusterName + "/app/s4App";
if (zkClient.exists(deployedAppPath)) {
ZNRecord readData = zkClient.readData(deployedAppPath);
logger.error("Cannot deploy app [{}], because app [{}] is already deployed", deployArgs.appName,
readData.getSimpleField("name"));
System.exit(1);
}
zkClient.create("/s4/clusters/" + deployArgs.clusterName + "/app/s4App", record, CreateMode.PERSISTENT);
logger.info(