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

Updates to latest Scala, SBT, etc. #1

Open
wants to merge 2 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
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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/
2 changes: 1 addition & 1 deletion bin/eventsim
Original file line number Diff line number Diff line change
@@ -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 $*
33 changes: 12 additions & 21 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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 : _*)
2 changes: 1 addition & 1 deletion project/assembly.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.1")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5")
1 change: 1 addition & 0 deletions project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.0.2
3 changes: 1 addition & 2 deletions project/build.sbt
Original file line number Diff line number Diff line change
@@ -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")
addSbtPlugin("com.cavorite" % "sbt-avro-1-8" % "1.1.3")
2 changes: 1 addition & 1 deletion src/main/scala/io/confluent/eventsim/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -211,4 +212,3 @@ object Main extends App {
this.generateEvents()

}

4 changes: 2 additions & 2 deletions src/main/scala/io/confluent/eventsim/TimeUtilities.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down