Search in sources :

Example 1 with IgnoreTransactionRollbackException

use of com.hortonworks.registries.storage.exception.IgnoreTransactionRollbackException in project streamline by hortonworks.

the class TopologyStates method doKill.

private static void doKill(TopologyContext context) throws Exception {
    try {
        context.setCurrentAction("Killing topology");
        invokeKill(context);
        context.setState(TOPOLOGY_STATE_INITIAL);
        context.setCurrentAction("Topology killed");
    } catch (TopologyNotAliveException ex) {
        LOG.warn("Got TopologyNotAliveException while trying to kill topology, " + "probably the topology was killed externally.");
        context.setState(TOPOLOGY_STATE_INITIAL);
        context.setCurrentAction("Setting topology to initial state since its not alive in the cluster");
    } catch (Exception ex) {
        LOG.error("Error while trying to kill the topology", ex);
        context.setCurrentAction("Killing the topology failed due to: " + ex);
        throw new IgnoreTransactionRollbackException(ex);
    }
}
Also used : TopologyNotAliveException(com.hortonworks.streamline.streams.exception.TopologyNotAliveException) IgnoreTransactionRollbackException(com.hortonworks.registries.storage.exception.IgnoreTransactionRollbackException) TopologyNotAliveException(com.hortonworks.streamline.streams.exception.TopologyNotAliveException) IgnoreTransactionRollbackException(com.hortonworks.registries.storage.exception.IgnoreTransactionRollbackException)

Aggregations

IgnoreTransactionRollbackException (com.hortonworks.registries.storage.exception.IgnoreTransactionRollbackException)1 TopologyNotAliveException (com.hortonworks.streamline.streams.exception.TopologyNotAliveException)1