Search in sources :

Example 1 with TException

use of org.apache.storm.thrift.TException in project metron by apache.

the class FluxTopologyComponent method startTopology.

private void startTopology(String topologyName, File topologyLoc, File templateFile, Properties properties) throws IOException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException, TException, NoSuchFieldException {
    TopologyDef topologyDef = loadYaml(topologyName, topologyLoc, templateFile, properties);
    Config conf = FluxBuilder.buildConfig(topologyDef);
    ExecutionContext context = new ExecutionContext(topologyDef, conf);
    StormTopology topology = FluxBuilder.buildTopology(context);
    Assert.assertNotNull(topology);
    topology.validate();
    try {
        stormCluster.submitTopology(topologyName, conf, topology);
    } catch (Exception nne) {
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
        }
        stormCluster.submitTopology(topologyName, conf, topology);
    }
}
Also used : TopologyDef(org.apache.storm.flux.model.TopologyDef) ExecutionContext(org.apache.storm.flux.model.ExecutionContext) Config(org.apache.storm.Config) StormTopology(org.apache.storm.generated.StormTopology) UnableToStartException(org.apache.metron.integration.UnableToStartException) IOException(java.io.IOException) TException(org.apache.storm.thrift.TException) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 UnableToStartException (org.apache.metron.integration.UnableToStartException)1 Config (org.apache.storm.Config)1 ExecutionContext (org.apache.storm.flux.model.ExecutionContext)1 TopologyDef (org.apache.storm.flux.model.TopologyDef)1 StormTopology (org.apache.storm.generated.StormTopology)1 TException (org.apache.storm.thrift.TException)1