@Override
  @Transactional
  public void delete() throws AmbariException {
    clusterGlobalLock.writeLock().lock();
    try {
      refresh();
      deleteAllServices();
      deleteAllClusterConfigs();
      resetHostVersions();

      refresh(); // update one-to-many clusterServiceEntities
      removeEntities();
      allConfigs.clear();
    } finally {
      clusterGlobalLock.writeLock().unlock();
    }
  }
Deletes the specified service also removes references to it from {@link this.serviceComponentHosts}
and references to ServiceComponentHost objects that belong to the service from {@link this.serviceComponentHostsByHost}
<p>
  Note: This method must be called only with write lock acquired.
</p>
@param service the service to be deleted
@throws AmbariException
@see   ServiceComponentHost
ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java