public void removeMpack(MpackEntity mpackEntity, StackEntity stackEntity) throws IOException {
    if (versionDefinitions != null) {
      versionDefinitions.clear();
    }
    boolean stackDelete = mpackManager.removeMpack(mpackEntity, stackEntity);

    if (stackDelete) {
      stackManager.removeStack(stackEntity);
    }
  }
Remove Mpack from the mpackMap and stackMap which is used to power the Mpack and Stack APIs.
Stack should be removed from stackMap only if it points to the mpack that is being removed.
@param mpackEntity
@param stackEntity
@throws IOException
ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java