Skip to content

Commit 06a9487

Browse files
Merge pull request #1 from jtgrabowski/master
add projects for maven, gradle and sbt for java and scala
2 parents 286dda2 + c78beca commit 06a9487

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+744
-153
lines changed

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
SparkBuildExamples*
2-
gradle*
3-
*/.gradle
41
*/build
52
*/target
6-
*/gradle
73
.gradle
4+
.idea
5+
metastore_db
6+
derby.log

GradleVsDSE/build.gradle

Lines changed: 0 additions & 20 deletions
This file was deleted.

GradleVsDSE/src

Lines changed: 0 additions & 1 deletion
This file was deleted.

GradleVsOSS/build.gradle

Lines changed: 0 additions & 14 deletions
This file was deleted.

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Example projects for using DSE Analytics
2+
3+
These are template projects that illustrate how to build Spark Application written in Java or Scala with
4+
Maven, SBT or Gradle. Navigate to project that implements simple write-to-/read-from-Cassandra
5+
application with language and build tool of your choice.
6+
7+
## Dependencies
8+
9+
Compiling Spark Applications depends on `Apache Spark` and optionally on `Spark Cassandra Connector`
10+
jars. Projects `dse` and `oss` show two different ways of supplying these dependencies.
11+
Both projects are built and executed with similar commands.
12+
13+
### DSE
14+
15+
If you are planning to execute your Spark Application on a DSE cluster, you can use `dse` project
16+
template which will automatically download (and use during compilation) all jars available in DSE cluster.
17+
Please mind DSE version specified in build file, it should should match the one in your cluster.
18+
19+
### OSS
20+
21+
If you are planning to execute your Spark Application against Open Source Apache Spark and Open Source
22+
Apache Cassandra, use `oss` project template where all dependencies have to be specified manually in
23+
build files. Please mind dependencies versions, these should match the ones in your execution environment.
24+
25+
For additional info about version compatibility please refer to
26+
[Version Compatibility Table](https://github.com/datastax/spark-cassandra-connector#version-compatibility)
27+
28+
### Additional dependencies
29+
30+
Prepared projects use extra plugins so additional dependencies can be included with your
31+
application's jar. All you need to do is add dependencies in build configuration file.
32+
33+
## Building & running
34+
35+
### Sbt
36+
37+
```
38+
sbt clean assembly
39+
dse spark-submit --class com.datastax.spark.example.scala.WriteRead target/scala-2.10/writeRead-assembly-0.1.jar
40+
```
41+
42+
### Gradle
43+
44+
```
45+
gradle clean jar
46+
dse spark-submit --class com.datastax.spark.example.scala.WriteRead build/libs/writeRead-0.1.jar
47+
```
48+
49+
### Maven
50+
51+
```
52+
mvn clean package
53+
dse spark-submit --class com.datastax.spark.example.scala.WriteRead target/writeRead-0.1-dep.jar
54+
```
55+
56+
57+

SbtAssemblyVsDSE/.gitignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

SbtAssemblyVsDSE/README

Lines changed: 0 additions & 15 deletions
This file was deleted.

SbtAssemblyVsDSE/build.sbt

Lines changed: 0 additions & 31 deletions
This file was deleted.

SbtAssemblyVsDSE/project/assembly.sbt

Lines changed: 0 additions & 1 deletion
This file was deleted.

SbtAssemblyVsDSE/src

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)