Search in sources :

Example 1 with FlinkLocalCluster

use of org.apache.flink.storm.api.FlinkLocalCluster in project flink by apache.

the class ExclamationLocal method main.

// *************************************************************************
// PROGRAM
// *************************************************************************
public static void main(final String[] args) throws Exception {
    if (!ExclamationTopology.parseParameters(args)) {
        return;
    }
    // build Topology the Storm way
    final TopologyBuilder builder = ExclamationTopology.buildTopology();
    // execute program locally
    Config conf = new Config();
    conf.put(ExclamationBolt.EXCLAMATION_COUNT, ExclamationTopology.getExclamation());
    // only required to stabilize integration test
    conf.put(FlinkLocalCluster.SUBMIT_BLOCKING, true);
    final FlinkLocalCluster cluster = FlinkLocalCluster.getLocalCluster();
    cluster.submitTopology(topologyId, conf, FlinkTopology.createTopology(builder));
    cluster.shutdown();
}
Also used : TopologyBuilder(org.apache.storm.topology.TopologyBuilder) Config(org.apache.storm.Config) FlinkLocalCluster(org.apache.flink.storm.api.FlinkLocalCluster)

Example 2 with FlinkLocalCluster

use of org.apache.flink.storm.api.FlinkLocalCluster in project flink by apache.

the class PrintSampleStream method main.

public static void main(String[] args) throws Exception {
    if (args.length < 4) {
        System.err.println("Usage: PrintSampleStream <consumer-key> <consumer-secret> <access-token> <access-token-secret>");
        return;
    }
    String consumerKey = args[0];
    String consumerSecret = args[1];
    String accessToken = args[2];
    String accessTokenSecret = args[3];
    // keywords start with the 5th parameter
    String[] keyWords = Arrays.copyOfRange(args, 4, args.length);
    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("twitter", new TwitterSampleSpout(consumerKey, consumerSecret, accessToken, accessTokenSecret, keyWords));
    builder.setBolt("print", new PrinterBolt()).shuffleGrouping("twitter");
    Config conf = new Config();
    final FlinkLocalCluster cluster = FlinkLocalCluster.getLocalCluster();
    cluster.submitTopology("Print", conf, FlinkTopology.createTopology(builder));
    Utils.sleep(10 * 1000);
    cluster.shutdown();
}
Also used : TopologyBuilder(org.apache.storm.topology.TopologyBuilder) TwitterSampleSpout(org.apache.storm.starter.spout.TwitterSampleSpout) Config(org.apache.storm.Config) FlinkLocalCluster(org.apache.flink.storm.api.FlinkLocalCluster) PrinterBolt(org.apache.storm.starter.bolt.PrinterBolt)

Example 3 with FlinkLocalCluster

use of org.apache.flink.storm.api.FlinkLocalCluster in project flink by apache.

the class WordCountLocal method main.

// *************************************************************************
// PROGRAM
// *************************************************************************
public static void main(final String[] args) throws Exception {
    if (!WordCountTopology.parseParameters(args)) {
        return;
    }
    // build Topology the Storm way
    final TopologyBuilder builder = WordCountTopology.buildTopology();
    final FlinkLocalCluster cluster = FlinkLocalCluster.getLocalCluster();
    Config conf = new Config();
    // only required to stabilize integration test
    conf.put(FlinkLocalCluster.SUBMIT_BLOCKING, true);
    cluster.submitTopology(topologyId, conf, FlinkTopology.createTopology(builder));
    cluster.shutdown();
}
Also used : TopologyBuilder(org.apache.storm.topology.TopologyBuilder) FlinkLocalCluster(org.apache.flink.storm.api.FlinkLocalCluster) Config(org.apache.storm.Config)

Example 4 with FlinkLocalCluster

use of org.apache.flink.storm.api.FlinkLocalCluster in project flink by apache.

the class WordCountLocalByName method main.

// *************************************************************************
// PROGRAM
// *************************************************************************
public static void main(final String[] args) throws Exception {
    if (!WordCountTopology.parseParameters(args)) {
        return;
    }
    // build Topology the Storm way
    final TopologyBuilder builder = WordCountTopology.buildTopology(false);
    final FlinkLocalCluster cluster = FlinkLocalCluster.getLocalCluster();
    Config conf = new Config();
    // only required to stabilize integration test
    conf.put(FlinkLocalCluster.SUBMIT_BLOCKING, true);
    cluster.submitTopology(topologyId, conf, FlinkTopology.createTopology(builder));
    cluster.shutdown();
}
Also used : TopologyBuilder(org.apache.storm.topology.TopologyBuilder) FlinkLocalCluster(org.apache.flink.storm.api.FlinkLocalCluster) Config(org.apache.storm.Config)

Example 5 with FlinkLocalCluster

use of org.apache.flink.storm.api.FlinkLocalCluster in project flink by apache.

the class SplitStreamBoltLocal method main.

// *************************************************************************
// PROGRAM
// *************************************************************************
public static void main(final String[] args) throws Exception {
    if (!SplitBoltTopology.parseParameters(args)) {
        return;
    }
    // build Topology the Storm way
    final TopologyBuilder builder = SplitBoltTopology.buildTopology();
    final FlinkLocalCluster cluster = FlinkLocalCluster.getLocalCluster();
    cluster.submitTopology(topologyId, null, FlinkTopology.createTopology(builder));
    // run topology for 5 seconds
    Utils.sleep(5 * 1000);
    cluster.shutdown();
}
Also used : TopologyBuilder(org.apache.storm.topology.TopologyBuilder) FlinkLocalCluster(org.apache.flink.storm.api.FlinkLocalCluster)

Aggregations

FlinkLocalCluster (org.apache.flink.storm.api.FlinkLocalCluster)10 TopologyBuilder (org.apache.storm.topology.TopologyBuilder)10 Config (org.apache.storm.Config)7 BoltFileSink (org.apache.flink.storm.util.BoltFileSink)3 FiniteRandomSpout (org.apache.flink.storm.tests.operators.FiniteRandomSpout)2 PrinterBolt (org.apache.storm.starter.bolt.PrinterBolt)2 Fields (org.apache.storm.tuple.Fields)2 MergerBolt (org.apache.flink.storm.tests.operators.MergerBolt)1 MetaDataSpout (org.apache.flink.storm.tests.operators.MetaDataSpout)1 TaskIdBolt (org.apache.flink.storm.tests.operators.TaskIdBolt)1 VerifyMetaDataBolt (org.apache.flink.storm.tests.operators.VerifyMetaDataBolt)1 NullTerminatingSpout (org.apache.flink.storm.util.NullTerminatingSpout)1 TupleOutputFormatter (org.apache.flink.storm.util.TupleOutputFormatter)1 SingleJoinBolt (org.apache.storm.starter.bolt.SingleJoinBolt)1 TwitterSampleSpout (org.apache.storm.starter.spout.TwitterSampleSpout)1 FeederSpout (org.apache.storm.testing.FeederSpout)1 Values (org.apache.storm.tuple.Values)1