Skip to content

Commit

Permalink
Merge branch 'release/0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
miguno committed May 27, 2014
2 parents f6519f0 + 63bbff7 commit 4bcd303
Show file tree
Hide file tree
Showing 41 changed files with 3,635 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
*.class
*.log

# sbt specific
dist/*
target/
lib_managed/
src_managed/
project/boot/
project/plugins/project/

# Kafka
logs/*
2 changes: 2 additions & 0 deletions .sbtopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-J-Xmx512m
-Djava.awt.headless=true
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 0.1.0 (May 27, 2014)

* Initial release. Integrates Kafka 0.8.1.1 with Storm 0.9.1-incubating.
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright © 2014 Michael G. Noll

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
804 changes: 804 additions & 0 deletions README.md

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions assembly.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import AssemblyKeys._

assemblySettings

// Any customized settings must be written here, i.e. after 'assemblySettings' above.
// See https://github.com/sbt/sbt-assembly for available parameters.

// Include "provided" dependencies back to run/test tasks' classpath.
// See:
// https://github.com/sbt/sbt-assembly#-provided-configuration
// http://stackoverflow.com/a/21803413/3827
//
// In our case, the Storm dependency must be set to "provided (cf. `build.sbt`) because, when deploying and launching
// our Storm topology code "for real" to a distributed Storm cluster, Storm wants us to exclude the Storm dependencies
// (jars) as they are provided [no pun intended] by the Storm cluster.
run in Compile <<= Defaults.runTask(fullClasspath in Compile, mainClass in (Compile, run), runner in (Compile, run))
89 changes: 89 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
organization := "com.miguno.kafkastorm"

name := "kafka-storm-starter"

scalaVersion := "2.10.4"

seq(sbtavro.SbtAvro.avroSettings : _*)

// Configure the desired Avro version. sbt-avro automatically injects a libraryDependency.
(version in avroConfig) := "1.7.6"

// Look for *.avsc etc. files in src/test/avro
(sourceDirectory in avroConfig) <<= (sourceDirectory in Compile)(_ / "avro")

(stringType in avroConfig) := "String"

// https://github.com/jrudolph/sbt-dependency-graph
net.virtualvoid.sbt.graph.Plugin.graphSettings

resolvers ++= Seq(
"typesafe-repository" at "http://repo.typesafe.com/typesafe/releases/",
"clojars-repository" at "https://clojars.org/repo",
// For retrieving Kafka release artifacts directly from Apache. The artifacts are also available via Maven Central.
"Apache releases" at "https://repository.apache.org/content/repositories/releases/"
)

libraryDependencies ++= Seq(
"com.twitter" %% "bijection-core" % "0.6.2",
"com.twitter" %% "bijection-avro" % "0.6.2",
// Chill uses Kryo 2.21, which is not fully compatible with 2.17 (used by Storm).
// We must exclude the newer Kryo version, otherwise we run into the problem described at
// https://github.com/thinkaurelius/titan/issues/301.
//
// TODO: Once Storm 0.9.2 is released we can update our dependencies to use Chill as-is (without excludes) because
// Storm then uses Kryo 2.21 (via Carbonite 1.3.3) just like Chill does.
"com.twitter" %% "chill" % "0.3.6"
exclude("com.esotericsoftware.kryo", "kryo"),
"com.twitter" % "chill-avro" % "0.3.6"
exclude("com.esotericsoftware.kryo", "kryo"),
"com.twitter" %% "chill-bijection" % "0.3.6"
exclude("com.esotericsoftware.kryo", "kryo"),
// The excludes of jms, jmxtools and jmxri are required as per https://issues.apache.org/jira/browse/KAFKA-974.
// The exclude of slf4j-simple is because it overlaps with our use of logback with slf4j facade; without the exclude
// we get slf4j warnings and logback's configuration is not picked up.
"org.apache.kafka" % "kafka_2.10" % "0.8.1.1"
exclude("javax.jms", "jms")
exclude("com.sun.jdmk", "jmxtools")
exclude("com.sun.jmx", "jmxri")
exclude("org.slf4j", "slf4j-simple"),
"org.apache.storm" % "storm-core" % "0.9.1-incubating" % "provided"
exclude("org.slf4j", "log4j-over-slf4j"),
// We exclude curator-framework because storm-kafka-0.8-plus recently switched from curator 1.0.1 to 1.3.3, which
// pulls in a newer version of ZooKeeper with which Storm 0.9.1 is not yet compatible.
//
// TODO: Remove the exclude once Storm 0.9.2 is released, because that version depends on a newer version (3.4.x) of
// ZooKeeper.
"com.miguno" %% "storm-kafka-0.8-plus" % "0.5.0-SNAPSHOT"
exclude("com.netflix.curator", "curator-framework"),
"com.netflix.curator" % "curator-test" % "1.0.1",
"com.101tec" % "zkclient" % "0.4",
// Logback with slf4j facade
"ch.qos.logback" % "logback-classic" % "1.1.2",
"ch.qos.logback" % "logback-core" % "1.1.2",
"org.slf4j" % "slf4j-api" % "1.7.7",
// Test dependencies
"org.scalatest" %% "scalatest" % "2.1.6" % "test",
"org.mockito" % "mockito-all" % "1.9.5" % "test"
)

// Required IntelliJ workaround. This tells `sbt gen-idea` to include scala-reflect as a compile dependency (and not
// merely as a test dependency), which we need for TypeTag usage.
libraryDependencies <+= (scalaVersion)("org.scala-lang" % "scala-reflect" % _)

scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")

publishArtifact in Test := false

parallelExecution in Test := false

// Write test results to file in JUnit XML format
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-u", "target/test-reports/junitxml")

// Write test results to console/stdout
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-o")

// See https://github.com/scoverage/scalac-scoverage-plugin
ScoverageSbtPlugin.instrumentSettings

mainClass in (Compile,run) := Some("com.miguno.kafkastorm.storm.KafkaStormDemo")
Binary file added images/IntelliJ-IDEA-Avro-bug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/IntelliJ-IDEA-Avro-bug_400x216.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions project/assembly.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2")
1 change: 1 addition & 0 deletions project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=0.13.2
2 changes: 2 additions & 0 deletions project/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// https://github.com/sbt/sbt-release
addSbtPlugin("com.github.gseitz" % "sbt-release" % "0.8.3")
20 changes: 20 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
resolvers ++= Seq(
"sbt-plugin-releases-repo" at "http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases",
"sbt-idea-repository" at "http://mpeltonen.github.io/maven/"
)

// https://github.com/mpeltonen/sbt-idea
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0")

// https://github.com/typesafehub/sbteclipse
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.5.0")

// https://github.com/cavorite/sbt-avro
addSbtPlugin("com.cavorite" % "sbt-avro" % "0.3.2")

// https://github.com/jrudolph/sbt-dependency-graph
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.7.4")

// See https://github.com/scoverage/scalac-scoverage-plugin
// and https://github.com/scoverage/sbt-scoverage
addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "0.98.2")
Loading

0 comments on commit 4bcd303

Please sign in to comment.