org.apache.storm.topology

## Class ConfigurableTopology

- java.lang.Object
- - org.apache.storm.topology.ConfigurableTopology

- Direct Known Subclasses:
    AnchoredWordCount, ExclamationTopology, LambdaTopology, RollingTopWords, SkewedRollingTopWords, WordCountTopology

      public abstract class ConfigurableTopology
      extends Object

  Extensions of this class takes a reference to one or more configuration files. The main() method should call ConfigurableTopology.start() and it must instantiate a TopologyBuilder in the run() method.

      {
         public class MyTopology extends ConfigurableTopology {

        public static void main(String[] args) throws Exception {
            ConfigurableTopology.start(new MyTopology(), args);
        }

        @Override
        protected int run(String[] args) {
            TopologyBuilder builder = new TopologyBuilder();

            // build topology as usual

            return submit("crawl", conf, builder);
        }
      }

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Config` | `conf`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConfigurableTopology()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Config` | `getConf()`
    `static Config` | `loadConf(String resource, Config conf)`
    `protected abstract int` | `run(String[] args)`
    `static void` | `start(ConfigurableTopology topology, String[] args)`
    `protected int` | `submit(Config conf, TopologyBuilder builder)` Submits the topology with the name taken from the configuration.
    `protected int` | `submit(String name, Config conf, TopologyBuilder builder)` Submits the topology under a specific name.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### conf

          protected Config conf

  - ### Constructor Detail

    - #### ConfigurableTopology

          public ConfigurableTopology()

  - ### Method Detail

    - #### start

          public static void start(ConfigurableTopology topology,
                                   String[] args)

    - #### loadConf

          public static Config loadConf(String resource,
                                        Config conf)
                                 throws FileNotFoundException

      Throws:
        `FileNotFoundException`

    - #### getConf

          protected Config getConf()

    - #### run

          protected abstract int run(String[] args)
                              throws Exception

      Throws:
        `Exception`

    - #### submit

          protected int submit(Config conf,
                               TopologyBuilder builder)

      Submits the topology with the name taken from the configuration.

    - #### submit

          protected int submit(String name,
                               Config conf,
                               TopologyBuilder builder)

      Submits the topology under a specific name.

Copyright © 2019 The Apache Software Foundation. All rights reserved.