[BAHIR-31] Add basic documentation for ZeroMQ connector
Project: http://git-wip-us.apache.org/repos/asf/bahir/repo Commit: http://git-wip-us.apache.org/repos/asf/bahir/commit/29d8c762 Tree: http://git-wip-us.apache.org/repos/asf/bahir/tree/29d8c762 Diff: http://git-wip-us.apache.org/repos/asf/bahir/diff/29d8c762 Branch: refs/heads/master Commit: 29d8c7622cf9663e295d7616ae1e1b089fe80da9 Parents: c78af70 Author: Luciano Resende <[email protected]> Authored: Mon Aug 1 19:21:24 2016 +0300 Committer: Luciano Resende <[email protected]> Committed: Wed Aug 3 22:11:57 2016 +0300 ---------------------------------------------------------------------- streaming-zeromq/README.md | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bahir/blob/29d8c762/streaming-zeromq/README.md ---------------------------------------------------------------------- diff --git a/streaming-zeromq/README.md b/streaming-zeromq/README.md new file mode 100644 index 0000000..6a8a069 --- /dev/null +++ b/streaming-zeromq/README.md @@ -0,0 +1,49 @@ + +A library for reading data from [ZeroMQ](http://zeromq.org/) using Spark Streaming. + +## Linking + +Using SBT: + +``` +libraryDependencies += "org.apache.bahir" %% "spark-streaming-zeromq" % "2.0.0" +``` + +Using Maven: + +```xml +<dependency> + <groupId>org.apache.bahir</groupId> + <artifactId>spark-streaming-zeromq_2.11</artifactId> + <version>2.0.0</version> +</dependency> +``` + +This library can also be added to Spark jobs launched through `spark-shell` or `spark-submit` by using the `--packages` command line option. +For example, to include it when starting the spark shell: + +``` +$ bin/spark-shell --packages org.apache.bahir:spark-streaming_zeromq_2.11:2.0.0 +``` + +Unlike using `--jars`, using `--packages` ensures that this library and its dependencies will be added to the classpath. +The `--packages` argument can also be used with `bin/spark-submit`. + +This library is cross-published for Scala 2.10 and Scala 2.11, so users should replace the proper Scala version (2.10 or 2.11) in the commands listed above. + +## Examples + + +### Scala API + +```Scala +val lines = ZeroMQUtils.createStream(ssc, ...) +``` + +### Java API + +```Java +JavaDStream<String> lines = ZeroMQUtils.createStream(jssc, ...); +``` + +See end-to-end examples at ([ZeroMQ Examples](https://github.com/apache/bahir/tree/master/streaming-zeromq/examples) \ No newline at end of file
