Search in sources :

Example 1 with VerifyMetaDataBolt

use of org.apache.flink.storm.tests.operators.VerifyMetaDataBolt in project flink by apache.

the class StormMetaDataITCase method testProgram.

@Override
protected void testProgram() throws Exception {
    final TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout(spoutId, new MetaDataSpout(), 2);
    builder.setBolt(boltId1, new VerifyMetaDataBolt(), 2).localOrShuffleGrouping(spoutId, MetaDataSpout.STREAM_ID);
    builder.setBolt(boltId2, new VerifyMetaDataBolt()).shuffleGrouping(boltId1, VerifyMetaDataBolt.STREAM_ID);
    final FlinkLocalCluster cluster = FlinkLocalCluster.getLocalCluster();
    cluster.submitTopology(topologyId, null, FlinkTopology.createTopology(builder));
    // run topology for 5 seconds
    Utils.sleep(5 * 1000);
    cluster.shutdown();
    Assert.assertFalse(VerifyMetaDataBolt.errorOccured);
}
Also used : MetaDataSpout(org.apache.flink.storm.tests.operators.MetaDataSpout) TopologyBuilder(org.apache.storm.topology.TopologyBuilder) FlinkLocalCluster(org.apache.flink.storm.api.FlinkLocalCluster) VerifyMetaDataBolt(org.apache.flink.storm.tests.operators.VerifyMetaDataBolt)

Aggregations

FlinkLocalCluster (org.apache.flink.storm.api.FlinkLocalCluster)1 MetaDataSpout (org.apache.flink.storm.tests.operators.MetaDataSpout)1 VerifyMetaDataBolt (org.apache.flink.storm.tests.operators.VerifyMetaDataBolt)1 TopologyBuilder (org.apache.storm.topology.TopologyBuilder)1