Search in sources :

Example 41 with TopologyBuilder

use of org.apache.heron.api.topology.TopologyBuilder in project heron by twitter.

the class SimulatorRunner method run.

/**
 * Runs the computation
 * @param name The name of the topology
 * @param config Any config that is passed to the topology
 * @param builder The builder used to keep track of the sources.
 */
public void run(String name, Config config, Builder builder) {
    BuilderImpl bldr = (BuilderImpl) builder;
    TopologyBuilder topologyBuilder = bldr.build();
    Simulator simulator = new Simulator();
    simulator.submitTopology(name, config.getHeronConfig(), topologyBuilder.createTopology());
}
Also used : BuilderImpl(org.apache.heron.streamlet.impl.BuilderImpl) TopologyBuilder(org.apache.heron.api.topology.TopologyBuilder)

Aggregations

TopologyBuilder (org.apache.heron.api.topology.TopologyBuilder)41 Config (org.apache.heron.api.Config)19 Test (org.junit.Test)15 HashMap (java.util.HashMap)8 Fields (org.apache.heron.api.tuple.Fields)6 Simulator (org.apache.heron.simulator.Simulator)6 TestWordSpout (org.apache.heron.examples.api.spout.TestWordSpout)5 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)5 Duration (java.time.Duration)4 HashSet (java.util.HashSet)4 Map (java.util.Map)4 Arrays (java.util.Arrays)3 Collection (java.util.Collection)3 List (java.util.List)3 Set (java.util.Set)3 Consumer (java.util.function.Consumer)3 Function (java.util.function.Function)3 HeronTopology (org.apache.heron.api.HeronTopology)3 ShuffleStreamGrouping (org.apache.heron.api.grouping.ShuffleStreamGrouping)3 Utils (org.apache.heron.api.utils.Utils)3