public abstract class ConfigurableTopology extends Object
{ 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); } }
Constructor and Description |
---|
ConfigurableTopology() |
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.
|
protected Config conf
public static void start(ConfigurableTopology topology, String[] args)
public static Config loadConf(String resource, Config conf) throws FileNotFoundException
FileNotFoundException
protected Config getConf()
protected int submit(Config conf, TopologyBuilder builder)
protected int submit(String name, Config conf, TopologyBuilder builder)
Copyright © 2023 The Apache Software Foundation. All rights reserved.