diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..043acfa5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +*.class +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# Simple Build Tool +# http://www.scala-sbt.org/release/docs/Getting-Started/Directories.html#configuring-version-control + +dist/* +target/ +lib_managed/ +src_managed/ +project/boot/ +project/plugins/project/ +.history +.cache +.lib/ +output/ diff --git a/bin/eventsim b/bin/eventsim index 95bb8421..ce110239 100755 --- a/bin/eventsim +++ b/bin/eventsim @@ -1,2 +1,2 @@ #! /bin/bash -java -XX:+AggressiveOpts -XX:+UseG1GC -XX:+UseStringDeduplication -Xmx8G -jar target/scala-2.11/eventsim-assembly-2.0.jar $* +java -XX:+AggressiveOpts -XX:+UseG1GC -XX:+UseStringDeduplication -Xmx8G -jar target/scala-2.12/eventsim-assembly-2.0.jar $* diff --git a/build.sbt b/build.sbt index bb8dfb7a..b965d66f 100644 --- a/build.sbt +++ b/build.sbt @@ -2,26 +2,17 @@ name := "eventsim" version := "2.0" -scalaVersion := "2.11.6" - -// resolvers += Resolver.url("confluent", url("http://packages.confluent.io/maven")) - -libraryDependencies += "org.apache.avro" % "avro" % "1.7.7" - -libraryDependencies += "org.apache.commons" % "commons-math3" % "3.6" - -libraryDependencies += "de.jollyday" % "jollyday" % "0.5.1" - -libraryDependencies += "org.rogach" % "scallop_2.11" % "0.9.5" - -libraryDependencies += "com.fasterxml.jackson.core" % "jackson-core" % "2.7.0" - -libraryDependencies += "com.fasterxml.jackson.core" % "jackson-databind" % "2.7.0" - -libraryDependencies += "org.apache.kafka" % "kafka-clients" % "0.9.0.0" - -libraryDependencies += "org.scala-lang.modules" % "scala-parser-combinators_2.11" % "1.0.4" +scalaVersion := "2.12.4" + +libraryDependencies ++= Seq( + "org.apache.avro" % "avro" % "1.7.7", + "org.apache.commons" % "commons-math3" % "3.6", + "de.jollyday" % "jollyday" % "0.5.1", + "org.rogach" %% "scallop" % "3.1.1", + "com.fasterxml.jackson.core" % "jackson-core" % "2.7.0", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.7.0", + "org.apache.kafka" % "kafka-clients" % "0.9.0.0", + "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4" +) // libraryDependencies += "io.confluent" % "kafka-avro-serializer" % "2.0.0" - -seq( sbtavro.SbtAvro.avroSettings : _*) \ No newline at end of file diff --git a/project/assembly.sbt b/project/assembly.sbt index 7fa83d11..15a88b09 100644 --- a/project/assembly.sbt +++ b/project/assembly.sbt @@ -1 +1 @@ -addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.1") \ No newline at end of file +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5") diff --git a/project/build.properties b/project/build.properties new file mode 100644 index 00000000..b7dd3cb2 --- /dev/null +++ b/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.0.2 diff --git a/project/build.sbt b/project/build.sbt index 843ce5b8..edef8d96 100644 --- a/project/build.sbt +++ b/project/build.sbt @@ -1,3 +1,2 @@ -resolvers += "sbt-plugin-releases" at "http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases" -addSbtPlugin("com.cavorite" % "sbt-avro" % "0.3.2") \ No newline at end of file +addSbtPlugin("com.cavorite" % "sbt-avro-1-8" % "1.1.3") diff --git a/src/main/scala/io/confluent/eventsim/Main.scala b/src/main/scala/io/confluent/eventsim/Main.scala index 6ab6e157..6a5622f6 100644 --- a/src/main/scala/io/confluent/eventsim/Main.scala +++ b/src/main/scala/io/confluent/eventsim/Main.scala @@ -76,6 +76,7 @@ object Main extends App { val useAvro = toggle("useAvro", default = Some(false), descrYes = "output data as Avro", descrNo = "output data as JSON") + verify() } val startTime = if (ConfFromOptions.startTimeArg.isSupplied) { @@ -211,4 +212,3 @@ object Main extends App { this.generateEvents() } - diff --git a/src/main/scala/io/confluent/eventsim/TimeUtilities.scala b/src/main/scala/io/confluent/eventsim/TimeUtilities.scala index 1c80cb09..57df1f04 100644 --- a/src/main/scala/io/confluent/eventsim/TimeUtilities.scala +++ b/src/main/scala/io/confluent/eventsim/TimeUtilities.scala @@ -3,7 +3,7 @@ package io.confluent.eventsim import java.time.temporal.{ChronoField, ChronoUnit} import java.time.{DayOfWeek, Duration, LocalDate, LocalDateTime} -import de.jollyday.HolidayManager +import de.jollyday.{HolidayCalendar,HolidayManager} import io.confluent.eventsim.Constants._ import io.confluent.eventsim.config.ConfigFromFile import org.apache.commons.math3.random.MersenneTwister @@ -13,7 +13,7 @@ object TimeUtilities { // def dateTimeToLocalDate(dt: Instant): LocalDate = LocalDate.from(Instant.ofEpochMilli(dt.getMillis())) // first implementation: US only - val holidays = HolidayManager.getInstance() + val holidays = HolidayManager.getInstance(HolidayCalendar.UNITED_STATES) def isHoliday(ld: LocalDate): Boolean = holidays.isHoliday(ld)