当前位置: 首页>>代码示例>>Java>>正文


Java ILocalCluster类代码示例

本文整理汇总了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;未经允许,请勿转载。