Search in sources :

Example 1 with FluxShellSpout

use of org.apache.storm.flux.wrappers.spouts.FluxShellSpout in project storm by apache.

the class SimpleTopology method getTopology.

public StormTopology getTopology(Map<String, Object> config) {
    TopologyBuilder builder = new TopologyBuilder();
    // spouts
    FluxShellSpout spout = new FluxShellSpout(new String[] { "node", "randomsentence.js" }, new String[] { "word" });
    builder.setSpout("sentence-spout", spout, 1);
    // bolts
    builder.setBolt("log-bolt", new LogInfoBolt(), 1).shuffleGrouping("sentence-spout");
    return builder.createTopology();
}
Also used : LogInfoBolt(org.apache.storm.flux.wrappers.bolts.LogInfoBolt) TopologyBuilder(org.apache.storm.topology.TopologyBuilder) FluxShellSpout(org.apache.storm.flux.wrappers.spouts.FluxShellSpout)

Example 2 with FluxShellSpout

use of org.apache.storm.flux.wrappers.spouts.FluxShellSpout in project storm by apache.

the class SimpleTopologySource method getTopology.

@Override
public StormTopology getTopology(Map<String, Object> config) {
    TopologyBuilder builder = new TopologyBuilder();
    // spouts
    FluxShellSpout spout = new FluxShellSpout(new String[] { "node", "randomsentence.js" }, new String[] { "word" });
    builder.setSpout("sentence-spout", spout, 1);
    // bolts
    builder.setBolt("log-bolt", new LogInfoBolt(), 1).shuffleGrouping("sentence-spout");
    return builder.createTopology();
}
Also used : LogInfoBolt(org.apache.storm.flux.wrappers.bolts.LogInfoBolt) TopologyBuilder(org.apache.storm.topology.TopologyBuilder) FluxShellSpout(org.apache.storm.flux.wrappers.spouts.FluxShellSpout)

Example 3 with FluxShellSpout

use of org.apache.storm.flux.wrappers.spouts.FluxShellSpout in project storm by apache.

the class SimpleTopologyWithConfigParam method getTopology.

public StormTopology getTopology(Config config) {
    TopologyBuilder builder = new TopologyBuilder();
    // spouts
    FluxShellSpout spout = new FluxShellSpout(new String[] { "node", "randomsentence.js" }, new String[] { "word" });
    builder.setSpout("sentence-spout", spout, 1);
    // bolts
    builder.setBolt("log-bolt", new LogInfoBolt(), 1).shuffleGrouping("sentence-spout");
    return builder.createTopology();
}
Also used : LogInfoBolt(org.apache.storm.flux.wrappers.bolts.LogInfoBolt) TopologyBuilder(org.apache.storm.topology.TopologyBuilder) FluxShellSpout(org.apache.storm.flux.wrappers.spouts.FluxShellSpout)

Aggregations

LogInfoBolt (org.apache.storm.flux.wrappers.bolts.LogInfoBolt)3 FluxShellSpout (org.apache.storm.flux.wrappers.spouts.FluxShellSpout)3 TopologyBuilder (org.apache.storm.topology.TopologyBuilder)3