From 0a6f8443ce6b6f53df565e35822ab178e03e4f96 Mon Sep 17 00:00:00 2001 From: Luciano Resende Date: Mon, 1 Aug 2016 19:21:24 +0300 Subject: [PATCH] [BAHIR-31] Add basic documentation for ZeroMQ connector --- streaming-zeromq/README.md | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 streaming-zeromq/README.md diff --git a/streaming-zeromq/README.md b/streaming-zeromq/README.md new file mode 100644 index 00000000..6a8a069a --- /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 + + org.apache.bahir + spark-streaming-zeromq_2.11 + 2.0.0 + +``` + +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 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