kafka-storm-stater研究

kafka集群安装
中文介绍
项目地址
下载后解压到/usr/local/spark/sbtproject
进入解压目录执行测试

sbt test
sbt run

This command launches kafkastormdemo. This demo starts in-memory instances of ZooKeeper, Kafka, and Storm. It then runs a demo Storm topology that connects to and reads from the Kafka instance.
停止运行
To stop the demo application you must kill orCtrl-C the process in the terminal.

  1. 编译代码
$ ./sbt clean compile

If you want to only (re)generate Java classes from Avro schemas:

$ ./sbt avro:generate

Generated Java sources are stored under target/scala-*/src_managed/main/compiled_avro/.

  1. 运行测试
$ ./sbt clean test
  1. Creating code coverage reports
$ ./sbt clean scoverage:test
  1. 打包代码
$ ./sbt clean package

>>> Generates `target/scala-2.10/kafka-storm-starter_2.10-0.2.0-SNAPSHOT.jar`

To create a fat jar, which includes any dependencies of kafka-storm-starter:

$ ./sbt assembly

>>> Generates `target/scala-2.10/kafka-storm-starter-assembly-0.2.0-SNAPSHOT.jar`

Note: By default, assembly by itself will NOT run any tests. If you want to run tests before assembly, chain sbt commands in sequence, e.g. ./sbt test assembly. See assembly.sbt` for details why we do this.

  1. 创建scaladoc/javadoc jar
$ ./sbt packageDoc

>>> Generates `target/scala-2.10/kafka-storm-starter_2.10-0.2.0-SNAPSHOT-javadoc.jar`
  1. 创建源代码jar
$ ./sbt packageSrc

>>> Generates `target/scala-2.10/kafka-storm-starter_2.10-0.2.0-SNAPSHOT-sources.jar`
  1. 创建APIdocs
$ ./sbt packageSrc

>>> Generates `target/scala-2.10/kafka-storm-starter_2.10-0.2.0-SNAPSHOT-sources.jar`

IDE支持

  1. 建立IDEA项目文件
$ ./sbt gen-idea

You can then open kafka-storm-starter as a project in IDEA via File > Open… and selecting the top-level directory of kafka-storm-starter.
有一个bug需要注意
Until this bug is fixed upstream you can use the following workaround, which you must perform everytime you run ./sbt gen-idea:

1。 In IntelliJ IDEA open the project structure for kafka-storm-starter via File > Project Structure….
2 。Under Project settings on the left-hand side select Modules.
3。 Select the Sources tab on the right-hand side.
4 。Remove the problematic target/scala-2.10/src_managed/main/compiled_avro/com entry from the Source Folders listing (the source folders are colored in light-blue). Note the trailing …/com, which comes from com.miguno.avro.Tweet in the twitter.avsc Avro schema.
5 。Click Ok.
参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值