public void addCluster(String clusterName)
throws AmbariException {
loadClustersAndHosts();
if (clusters.containsKey(clusterName)) {
throw new DuplicateResourceException("Attempted to create a Cluster which already exists"
+ ", clusterName=" + clusterName);
}
w.lock();
try {
if (clusters.containsKey(clusterName)) {
throw new DuplicateResourceException("Attempted to create a Cluster which already exists"
+ ", clusterName=" + clusterName);
}
// retrieve new cluster id
// add cluster id -> cluster mapping into clustersById
ClusterEntity clusterEntity = new ClusterEntity();