@Transactional
  protected  LogicalRequest processAndPersistTopologyRequest(BaseClusterRequest request, ClusterTopology topology, Long logicalRequestId)
    throws InvalidTopologyException, AmbariException {
    PersistedTopologyRequest persistedRequest = persistedState.persistTopologyRequest(request);

    LogicalRequest logicalRequest = createLogicalRequest(persistedRequest, topology, logicalRequestId);

    return logicalRequest;
  }
Creates and persists a {@see PersistedTopologyRequest} and a {@see LogicalRequest} for the provided request and topology.
@param request {@see ProvisionClusterRequest} or {@see ScaleClusterRequest} to create a logical request for.
@param topology Cluster topology
@param logicalRequestId The Id for the created logical request
@return Logical request created.
ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java