• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ILocalCluster类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.storm.ILocalCluster的典型用法代码示例。如果您正苦于以下问题:Java ILocalCluster类的具体用法?Java ILocalCluster怎么用?Java ILocalCluster使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ILocalCluster类属于org.apache.storm包,在下文中一共展示了ILocalCluster类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createPirkTestJob

import org.apache.storm.ILocalCluster; //导入依赖的package包/类
private TestJob createPirkTestJob(final Config config)
{
  final SpoutConfig kafkaConfig = setUpTestKafkaSpout(config);
  return new TestJob()
  {
    StormTopology topology = PirkTopology.getPirkTopology(kafkaConfig);

    @Override
    public void run(ILocalCluster iLocalCluster) throws Exception
    {
      iLocalCluster.submitTopology("pirk_integration_test", config, topology);
      logger.info("Pausing for setup.");
      // Thread.sleep(4000);
      // KafkaProducer producer = new KafkaProducer<String,String>(createKafkaProducerConfig());
      // loadTestData(producer);
      // Thread.sleep(10000);
      while (OutputBolt.latch.getCount() == testCountDown)
      {
        Thread.sleep(1000);
      }
      testCountDown -= 1;

      logger.info("Finished...");
    }
  };
}
 
开发者ID:apache,项目名称:incubator-pirk,代码行数:27,代码来源:KafkaStormIntegrationTest.java


示例2: verifyEmittedValues

import org.apache.storm.ILocalCluster; //导入依赖的package包/类
@Test
public void verifyEmittedValues() {
	MkClusterParam clusterParam = new MkClusterParam();
	clusterParam.setSupervisors(1);

	withSimulatedTimeLocalCluster(clusterParam, new TestJob() {
		
		@Override
		public void run(ILocalCluster cluster) throws JsonProcessingException {
			
			MockedSources mockedSources = new MockedSources();
			mockedSources.addMockData(builder.getSpoutId(), new Values(SWITCH_ID));

			Config config = new Config();
			config.setDebug(true);

			CompleteTopologyParam topologyParam = new CompleteTopologyParam();
			topologyParam.setMockedSources(mockedSources);
			topologyParam.setStormConf(config);

			Map<?, ?> result = completeTopology(cluster, builder.build(), topologyParam);
			assertTrue(multiseteq(new Values(new Values(SWITCH_ID)),
					readTuples(result, builder.getSpoutId())));
			assertTrue(multiseteq(new Values(new Values(SWITCH_ID)),
					readTuples(result, builder.getConfirmationBoltId())));
		}
		
	});
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:30,代码来源:TopologyTest.java


示例3: submitTopology

import org.apache.storm.ILocalCluster; //导入依赖的package包/类
public static Config submitTopology(ILocalCluster stormCluster, String topologyName,
                                    StormTopology stormTopology) throws Exception {
    Config stormConf = new Config();
    stormConf.putAll(Utils.readDefaultConfig());
    stormConf.put("storm.cluster.mode", "local");
    stormConf.setDebug(true);
    stormConf.setMaxTaskParallelism(3);
    stormConf.put(Config.STORM_TOPOLOGY_SUBMISSION_NOTIFIER_PLUGIN,
            org.apache.atlas.storm.hook.StormAtlasHook.class.getName());

    stormCluster.submitTopology(topologyName, stormConf, stormTopology);

    Thread.sleep(10000);
    return stormConf;
}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:16,代码来源:StormTestUtil.java


示例4: testNormalizationTopology

import org.apache.storm.ILocalCluster; //导入依赖的package包/类
public void testNormalizationTopology(NormalizationProcessor normalizationProcessor) throws Exception {

        final Config config = new Config();
        config.setDebug(true);
        final String topologyName = "SplitJoinTopologyTest";
        final StormTopology topology = createTopology(normalizationProcessor);
        log.info("Created topology with name: [{}] and topology: [{}]", topologyName, topology);

        ILocalCluster localCluster = new LocalCluster();
        log.info("Submitting topology: [{}]", topologyName);
        localCluster.submitTopology(topologyName, config, topology);
        Thread.sleep(2000);
        localCluster.shutdown();
    }
 
开发者ID:hortonworks,项目名称:streamline,代码行数:15,代码来源:NormalizationTopologyTest.java


示例5: submitTopology

import org.apache.storm.ILocalCluster; //导入依赖的package包/类
protected void submitTopology() throws Exception {
    final Config config = getConfig();
    final String topologyName = "SplitJoinTopologyTest";
    final StormTopology topology = createTopology();
    log.info("Created topology with name: [{}] and topology: [{}]", topologyName, topology);

    ILocalCluster localCluster = new LocalCluster();
    log.info("Submitting topology: [{}]", topologyName);
    localCluster.submitTopology(topologyName, config, topology);

}
 
开发者ID:hortonworks,项目名称:streamline,代码行数:12,代码来源:SplitJoinTopologyTest.java


示例6: createLocalStormCluster

import org.apache.storm.ILocalCluster; //导入依赖的package包/类
public static ILocalCluster createLocalStormCluster() {
    // start a local storm cluster
    HashMap<String,Object> localClusterConf = new HashMap<>();
    localClusterConf.put("nimbus-daemon", true);
    return Testing.getLocalCluster(localClusterConf);
}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:7,代码来源:StormTestUtil.java


示例7: submitTopology

import org.apache.storm.ILocalCluster; //导入依赖的package包/类
protected void submitTopology() throws AlreadyAliveException, InvalidTopologyException {
    final Config config = getConfig();
    final String topologyName = "RulesTopologyTest";
    ILocalCluster localCluster = new LocalCluster();
    localCluster.submitTopology(topologyName, config, createTopology());
}
 
开发者ID:hortonworks,项目名称:streamline,代码行数:7,代码来源:RulesTopologyTest.java



注:本文中的org.apache.storm.ILocalCluster类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LabelMethodItem类代码示例发布时间:2022-05-23
下一篇:
Java GlobalAdvisorAdapterRegistry类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap