public Void deployTopology(Topology topology, String asUser) throws Exception { TopologyContext ctx = managedTransaction.executeFunction(() -> getTopologyContext(topology, asUser)); LOG.debug("Deploying topology {}", topology); while (ctx.getState() != TopologyStates.TOPOLOGY_STATE_DEPLOYED) { managedTransaction.executeConsumer((topologyContext) -> { LOG.debug("Current state {}", topologyContext.getStateName()); topologyContext.deploy(); }, ctx); } return null; }
@Override public void setCurrentAction(String description) { com.hortonworks.streamline.streams.catalog.topology.state.TopologyState catalogState = new com.hortonworks.streamline.streams.catalog.topology.state.TopologyState(); catalogState.setName(getStateName()); catalogState.setTopologyId(topology.getId()); catalogState.setDescription(description); LOG.debug("Topology id: {}, state: {}", topology.getId(), catalogState); topologyActionsService.getCatalogService().addOrUpdateTopologyState(topology.getId(), catalogState); } }