Search in sources :

Example 21 with LaunchEnvironment

use of org.openkilda.wfm.LaunchEnvironment in project open-kilda by telstra.

the class AbstractTopologyTest method getLaunchEnvironment.

/**
 * Uses /resources/test_topology.yaml config file to create launch environment.
 */
private LaunchEnvironment getLaunchEnvironment(int firstBoltParallelism, int firstBoltNumTasks) throws IOException, CmdLineException, ConfigurationException {
    makeConfigFile();
    Properties properties = new Properties();
    properties.put(FIRST_BOLT_NAME_PROPERTY, FIRST_BOLT_NAME);
    properties.put(TOPOLOGY_PARALLELISM_PROPERTY, String.valueOf(TOPOLOGY_PARALLELISM));
    properties.put(FIRST_BOLT_PARALLELISM_PROPERTY, String.valueOf(firstBoltParallelism));
    properties.put(FIRST_BOLT_NUM_TASKS_PROPERTY, String.valueOf(firstBoltNumTasks));
    properties.put(SECOND_BOLT_NAME_PROPERTY, SECOND_BOLT_NAME);
    properties.put(SECOND_BOLT_PARALLELISM_PROPERTY, String.valueOf(SECOND_BOLT_PARALLELISM));
    LaunchEnvironment env = makeLaunchEnvironment();
    env.setupOverlay(properties);
    return env;
}
Also used : LaunchEnvironment(org.openkilda.wfm.LaunchEnvironment) Properties(java.util.Properties)

Example 22 with LaunchEnvironment

use of org.openkilda.wfm.LaunchEnvironment in project open-kilda by telstra.

the class RerouteTopology method main.

/**
 * Launches and sets up the workflow manager environment.
 *
 * @param args the command-line arguments.
 */
public static void main(String[] args) {
    try {
        LaunchEnvironment env = new LaunchEnvironment(args);
        new RerouteTopology(env).setup();
    } catch (Exception e) {
        System.exit(handleLaunchException(e));
    }
}
Also used : LaunchEnvironment(org.openkilda.wfm.LaunchEnvironment)

Example 23 with LaunchEnvironment

use of org.openkilda.wfm.LaunchEnvironment in project open-kilda by telstra.

the class PortStateTopology method main.

/**
 * Entry point for local run of the topology.
 */
public static void main(String[] args) {
    try {
        LaunchEnvironment env = new LaunchEnvironment(args);
        (new PortStateTopology(env)).setup();
    } catch (Exception e) {
        System.exit(handleLaunchException(e));
    }
}
Also used : LaunchEnvironment(org.openkilda.wfm.LaunchEnvironment)

Example 24 with LaunchEnvironment

use of org.openkilda.wfm.LaunchEnvironment in project open-kilda by telstra.

the class IslLatencyTopologyTest method setupOnce.

@BeforeClass
public static void setupOnce() throws Exception {
    Properties configOverlay = getZooKeeperProperties(ISL_LATENCY_TOPOLOGY_TEST_ZOOKEEPER_PORT, ROOT_NODE);
    configOverlay.putAll(getKafkaProperties(ISL_LATENCY_TOPOLOGY_TEST_KAFKA_PORT));
    configOverlay.setProperty("opentsdb.metric.prefix", METRIC_PREFIX);
    AbstractStormTest.startZooKafka(configOverlay);
    setStartSignal(ISL_LATENCY_TOPOLOGY_TEST_ZOOKEEPER_PORT, ROOT_NODE, COMPONENT_NAME, RUN_ID);
    AbstractStormTest.startStorm(COMPONENT_NAME, RUN_ID);
    LaunchEnvironment launchEnvironment = makeLaunchEnvironment();
    launchEnvironment.setupOverlay(configOverlay);
    persistenceManager = InMemoryGraphPersistenceManager.newInstance();
    persistenceManager.install();
    IslLatencyTopology islLatencyTopology = new IslLatencyTopology(launchEnvironment, persistenceManager);
    islLatencyTopologyConfig = islLatencyTopology.getConfig();
    StormTopology stormTopology = islLatencyTopology.createTopology();
    Config config = stormConfig();
    cluster.submitTopology(IslLatencyTopologyTest.class.getSimpleName(), config, stormTopology);
    otsdbConsumer = new TestKafkaConsumer(islLatencyTopologyConfig.getKafkaOtsdbTopic(), kafkaConsumerProperties(UUID.randomUUID().toString(), COMPONENT_NAME, RUN_ID));
    otsdbConsumer.start();
    switchRepository = persistenceManager.getRepositoryFactory().createSwitchRepository();
    islRepository = persistenceManager.getRepositoryFactory().createIslRepository();
    sleep(TOPOLOGY_START_TIMEOUT);
}
Also used : TestKafkaConsumer(org.openkilda.wfm.topology.TestKafkaConsumer) Config(org.apache.storm.Config) StormTopology(org.apache.storm.generated.StormTopology) LaunchEnvironment(org.openkilda.wfm.LaunchEnvironment) Properties(java.util.Properties) BeforeClass(org.junit.BeforeClass)

Example 25 with LaunchEnvironment

use of org.openkilda.wfm.LaunchEnvironment in project open-kilda by telstra.

the class NetworkTopology method main.

/**
 * Discovery topology uploader.
 */
public static void main(String[] args) {
    try {
        LaunchEnvironment env = new LaunchEnvironment(args);
        (new NetworkTopology(env)).setup();
    } catch (Exception e) {
        System.exit(handleLaunchException(e));
    }
}
Also used : LaunchEnvironment(org.openkilda.wfm.LaunchEnvironment)

Aggregations

LaunchEnvironment (org.openkilda.wfm.LaunchEnvironment)25 ConfigurationException (org.openkilda.wfm.ConfigurationException)8 Properties (java.util.Properties)3 Config (org.apache.storm.Config)2 StormTopology (org.apache.storm.generated.StormTopology)2 BeforeClass (org.junit.BeforeClass)2 StreamNameCollisionException (org.openkilda.wfm.StreamNameCollisionException)2 TestKafkaConsumer (org.openkilda.wfm.topology.TestKafkaConsumer)2 NameCollisionException (org.openkilda.wfm.NameCollisionException)1 ConfigurationException (org.openkilda.wfm.error.ConfigurationException)1