Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examplerefresh #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions aerojoin-example/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import scala.util.Properties

name := "aerojoin-example"

version := "1.2.0"

scalaVersion := "2.12.11"
def sysPropOrDefault(propName:String,default:String):String = Option(System.getProperty(propName)).getOrElse(default)

val sparkVer = sysPropOrDefault("version","2.4.4")
val hadoopVer = "2.7.3"
val asClientVer = "4.4.13"
val asSparkConnectorVer = "2.3.0"
val sparkHome = Properties.envOrElse("SPARK_HOME", "/opt/spark")


libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % sparkVer % "provided",
"org.apache.spark" %% "spark-sql" % sparkVer ,
"org.apache.hadoop" % "hadoop-common" % hadoopVer ,
"org.apache.hadoop" % "hadoop-mapreduce-client-core" % hadoopVer % Provided,
"com.aerospike" %% "aerospike-spark" % "provided" from s"file://${sparkHome}/jars/aerospike-spark-assembly-${asSparkConnectorVer}.jar",
"com.aerospike" % "aerospike-client" % asClientVer,

)
resolvers ++= Seq("Local Maven" at Path.userHome.asFile.toURI.toURL + ".m2/repository")
resolvers += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository"
publishTo := Some(Resolver.file("file", new File(Path.userHome.absolutePath+"/.m2/repository")))
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.aerospike.spark

import com.typesafe.scalalogging.slf4j.LazyLogging
import org.apache.spark.SparkConf
import org.apache.spark.sql.types.{IntegerType, StringType, StructField, StructType}
import org.apache.spark.sql.{Row, SaveMode, SparkSession}
Expand All @@ -11,12 +10,12 @@ import org.apache.spark.sql.{Row, SaveMode, SparkSession}
*
* Prereqs: A working Aerospike Connect for Spark and an Aerospike server running on default port on localhost with at least 1 namespace named "Business"
*/
object aeroJoinExample extends LazyLogging with Serializable {
object aeroJoinExample extends Serializable {
val conf: SparkConf = new SparkConf()
.setAppName("AeroJoin")
.set("aerospike.seedhost", "localhost")
.set("aerospike.port", "3000")
.set("aerospike.namespace", "Business")
.set("aerospike.namespace", "test")

val session: SparkSession = SparkSession.builder()
.config(conf)
Expand Down
86 changes: 0 additions & 86 deletions build.sbt

This file was deleted.

1 change: 0 additions & 1 deletion project/assembly.sbt

This file was deleted.