本文整理汇总了Java中com.github.sakserv.minicluster.impl.StormLocalCluster类的典型用法代码示例。如果您正苦于以下问题:Java StormLocalCluster类的具体用法?Java StormLocalCluster怎么用?Java StormLocalCluster使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StormLocalCluster类属于com.github.sakserv.minicluster.impl包,在下文中一共展示了StormLocalCluster类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import com.github.sakserv.minicluster.impl.StormLocalCluster; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
// Parse the properties file
propertyParser = new PropertyParser();
propertyParser.parsePropsFile(PROP_FILE);
// Start Zookeeper
zookeeperLocalCluster = new ZookeeperLocalCluster.Builder()
.setPort(Integer.parseInt(propertyParser.getProperty(ConfigVars.ZOOKEEPER_PORT_KEY)))
.setTempDir(propertyParser.getProperty(ConfigVars.ZOOKEEPER_TEMP_DIR_KEY))
.setZookeeperConnectionString(propertyParser.getProperty(ConfigVars.ZOOKEEPER_CONNECTION_STRING_KEY))
.build();
zookeeperLocalCluster.start();
// Start Kafka
kafkaLocalBroker = new KafkaLocalBroker.Builder()
.setKafkaHostname(propertyParser.getProperty(ConfigVars.KAFKA_HOSTNAME_KEY))
.setKafkaPort(Integer.parseInt(propertyParser.getProperty(ConfigVars.KAFKA_PORT_KEY)))
.setKafkaBrokerId(Integer.parseInt(propertyParser.getProperty(ConfigVars.KAFKA_TEST_BROKER_ID_KEY)))
.setKafkaProperties(new Properties())
.setKafkaTempDir(propertyParser.getProperty(ConfigVars.KAFKA_TEST_TEMP_DIR_KEY))
.setZookeeperConnectionString(propertyParser.getProperty(ConfigVars.ZOOKEEPER_CONNECTION_STRING_KEY))
.build();
kafkaLocalBroker.start();
// Start MongoDB
mongodbLocalServer = new MongodbLocalServer.Builder()
.setIp(propertyParser.getProperty(ConfigVars.MONGO_IP_KEY))
.setPort(Integer.parseInt(propertyParser.getProperty(ConfigVars.MONGO_PORT_KEY)))
.build();
mongodbLocalServer.start();
// Start Storm
stormLocalCluster = new StormLocalCluster.Builder()
.setZookeeperHost(propertyParser.getProperty(ConfigVars.ZOOKEEPER_HOSTNAME_KEY))
.setZookeeperPort(Long.parseLong(propertyParser.getProperty(ConfigVars.ZOOKEEPER_PORT_KEY)))
.setEnableDebug(Boolean.parseBoolean(propertyParser.getProperty(ConfigVars.STORM_ENABLE_DEBUG_KEY)))
.setNumWorkers(Integer.parseInt(propertyParser.getProperty(ConfigVars.STORM_NUM_WORKERS_KEY)))
.setStormConfig(new Config())
.build();
stormLocalCluster.start();
}