Search in sources :

Example 1 with ITopologyActionNotifierPlugin

use of org.apache.storm.nimbus.ITopologyActionNotifierPlugin in project storm by apache.

the class Nimbus method createTopologyActionNotifier.

private static ITopologyActionNotifierPlugin createTopologyActionNotifier(Map<String, Object> conf) {
    String clazz = (String) conf.get(DaemonConfig.NIMBUS_TOPOLOGY_ACTION_NOTIFIER_PLUGIN);
    ITopologyActionNotifierPlugin ret = null;
    if (clazz != null && !clazz.isEmpty()) {
        ret = ReflectionUtils.newInstance(clazz);
        try {
            ret.prepare(conf);
        } catch (Exception e) {
            LOG.warn("Ignoring exception, Could not initialize {}", clazz, e);
            ret = null;
        }
    }
    return ret;
}
Also used : ITopologyActionNotifierPlugin(org.apache.storm.nimbus.ITopologyActionNotifierPlugin) WrappedAuthorizationException(org.apache.storm.utils.WrappedAuthorizationException) IOException(java.io.IOException) IllegalStateException(org.apache.storm.generated.IllegalStateException) AlreadyAliveException(org.apache.storm.generated.AlreadyAliveException) WrappedNotAliveException(org.apache.storm.utils.WrappedNotAliveException) WrappedInvalidTopologyException(org.apache.storm.utils.WrappedInvalidTopologyException) AuthorizationException(org.apache.storm.generated.AuthorizationException) NotAliveException(org.apache.storm.generated.NotAliveException) WrappedAlreadyAliveException(org.apache.storm.utils.WrappedAlreadyAliveException) InterruptedIOException(java.io.InterruptedIOException) KeyAlreadyExistsException(org.apache.storm.generated.KeyAlreadyExistsException) TException(org.apache.storm.thrift.TException) WrappedIllegalStateException(org.apache.storm.utils.WrappedIllegalStateException) KeyNotFoundException(org.apache.storm.generated.KeyNotFoundException) InvalidTopologyException(org.apache.storm.generated.InvalidTopologyException) BindException(java.net.BindException)

Example 2 with ITopologyActionNotifierPlugin

use of org.apache.storm.nimbus.ITopologyActionNotifierPlugin in project storm by apache.

the class Nimbus method shutdown.

@SuppressWarnings("deprecation")
@Override
public void shutdown() {
    shutdownCalls.mark();
    try {
        LOG.info("Shutting down master");
        timer.close();
        stormClusterState.disconnect();
        downloaders.cleanup();
        uploaders.cleanup();
        blobDownloaders.cleanup();
        blobUploaders.cleanup();
        blobListers.cleanup();
        scheduler.cleanup();
        blobStore.shutdown();
        leaderElector.close();
        assignmentsDistributer.close();
        ITopologyActionNotifierPlugin actionNotifier = nimbusTopologyActionNotifier;
        if (actionNotifier != null) {
            actionNotifier.cleanup();
        }
        zkClient.close();
        if (metricsStore != null) {
            metricsStore.close();
        }
        clusterMetricSet.setActive(false);
        LOG.info("Shut down master");
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : ITopologyActionNotifierPlugin(org.apache.storm.nimbus.ITopologyActionNotifierPlugin) WrappedAuthorizationException(org.apache.storm.utils.WrappedAuthorizationException) IOException(java.io.IOException) IllegalStateException(org.apache.storm.generated.IllegalStateException) AlreadyAliveException(org.apache.storm.generated.AlreadyAliveException) WrappedNotAliveException(org.apache.storm.utils.WrappedNotAliveException) WrappedInvalidTopologyException(org.apache.storm.utils.WrappedInvalidTopologyException) AuthorizationException(org.apache.storm.generated.AuthorizationException) NotAliveException(org.apache.storm.generated.NotAliveException) WrappedAlreadyAliveException(org.apache.storm.utils.WrappedAlreadyAliveException) InterruptedIOException(java.io.InterruptedIOException) KeyAlreadyExistsException(org.apache.storm.generated.KeyAlreadyExistsException) TException(org.apache.storm.thrift.TException) WrappedIllegalStateException(org.apache.storm.utils.WrappedIllegalStateException) KeyNotFoundException(org.apache.storm.generated.KeyNotFoundException) InvalidTopologyException(org.apache.storm.generated.InvalidTopologyException) BindException(java.net.BindException)

Aggregations

IOException (java.io.IOException)2 InterruptedIOException (java.io.InterruptedIOException)2 BindException (java.net.BindException)2 AlreadyAliveException (org.apache.storm.generated.AlreadyAliveException)2 AuthorizationException (org.apache.storm.generated.AuthorizationException)2 IllegalStateException (org.apache.storm.generated.IllegalStateException)2 InvalidTopologyException (org.apache.storm.generated.InvalidTopologyException)2 KeyAlreadyExistsException (org.apache.storm.generated.KeyAlreadyExistsException)2 KeyNotFoundException (org.apache.storm.generated.KeyNotFoundException)2 NotAliveException (org.apache.storm.generated.NotAliveException)2 ITopologyActionNotifierPlugin (org.apache.storm.nimbus.ITopologyActionNotifierPlugin)2 TException (org.apache.storm.thrift.TException)2 WrappedAlreadyAliveException (org.apache.storm.utils.WrappedAlreadyAliveException)2 WrappedAuthorizationException (org.apache.storm.utils.WrappedAuthorizationException)2 WrappedIllegalStateException (org.apache.storm.utils.WrappedIllegalStateException)2 WrappedInvalidTopologyException (org.apache.storm.utils.WrappedInvalidTopologyException)2 WrappedNotAliveException (org.apache.storm.utils.WrappedNotAliveException)2