Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Commit 1f06a88

Browse files
Merge pull request #14 from intenthq/upgrade-dependencies
Upgrade all dependencies, restructure project, bump to 1.4.0.
2 parents f9942ff + 9ad1f55 commit 1f06a88

File tree

21 files changed

+136
-161
lines changed

21 files changed

+136
-161
lines changed

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ language: scala
22
before_install:
33
- sudo apt-get update -qq
44
- sudo apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev
5-
- wget http://www.us.apache.org/dist/thrift/0.9.2/thrift-0.9.2.tar.gz
6-
- tar xfz thrift-0.9.2.tar.gz && mv thrift-0.9.2 .thrift-0.9.2
7-
- cd .thrift-0.9.2 && ./configure --with-java --without-c_glib --without-cpp --without-csharp --without-python --without-ruby --without-haskell --without-perl --without-php --without-erlang --without-go --without-d --without-nodejs --without-lua && make && sudo make install && cd -
5+
- wget http://www.us.apache.org/dist/thrift/0.9.3/thrift-0.9.3.tar.gz
6+
- tar xfz thrift-0.9.3.tar.gz && mv thrift-0.9.3 .thrift-0.9.3
7+
- cd .thrift-0.9.3 && ./configure --with-java --without-c_glib --without-cpp --without-csharp --without-python --without-ruby --without-haskell --without-perl --without-php --without-erlang --without-go --without-d --without-nodejs --without-lua && make && sudo make install && cd -
88
scala:
99
- 2.11.7
1010
script:
11-
- sbt ++2.11.7 test
12-
- sbt ++2.10.5 test
11+
- sbt ++2.11.8 test
12+
- sbt ++2.10.6 test
1313
cache:
1414
directories:
15-
- ~/.thrift-0.9.2
15+
- ~/.thrift-0.9.3
1616
- ~/.ivy2
1717
- ~/.sbt

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 Intent HQ
3+
Copyright (c) 2015-2017 Intent HQ
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,29 @@ The following top level dependencies are published in Maven central:
1212

1313
**Thrift support**:
1414
```
15-
"com.intenthq.pucket" %% "pucket-thrift" % "1.3.0"
15+
"com.intenthq.pucket" %% "pucket-thrift" % "1.4.0"
1616
```
1717

1818
**Avro support**:
1919
```
20-
"com.intenthq.pucket" %% "pucket-avro" % "1.3.0"
20+
"com.intenthq.pucket" %% "pucket-avro" % "1.4.0"
2121
```
2222

2323
**Spark connectors**:
2424
```
25-
"com.intenthq.pucket" %% "pucket-spark" % "1.3.0"
25+
"com.intenthq.pucket" %% "pucket-spark" % "1.4.0"
2626
```
2727

2828
**MapReduce integration**:
2929
```
30-
"com.intenthq.pucket" %% "pucket-mapreduce" % "1.3.0"
30+
"com.intenthq.pucket" %% "pucket-mapreduce" % "1.4.0"
3131
```
3232

3333
These dependencies should be combined depending on your usages; for example if you use Thrift and Spark then use the following:
3434

3535
```
36-
"com.intenthq.pucket" %% "pucket-thrift" % "1.3.0"
37-
"com.intenthq.pucket" %% "pucket-spark" % "1.3.0"
36+
"com.intenthq.pucket" %% "pucket-thrift" % "1.4.0"
37+
"com.intenthq.pucket" %% "pucket-spark" % "1.4.0"
3838
```
3939

4040

avro/src/main/scala/com/intenthq/pucket/avro/AvroPucket.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.intenthq.pucket.avro
22

3+
import scala.language.higherKinds
4+
35
import com.intenthq.pucket.avro.writer.AvroWriter
46
import com.intenthq.pucket.reader.Reader
57
import com.intenthq.pucket.util.PucketPartitioner

build.sbt

Lines changed: 63 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import com.github.bigtoast.sbtthrift.ThriftPlugin
22
import sbt.ExclusionRule
3-
import com.typesafe.sbt.SbtGit.{GitKeys => git}
3+
import com.typesafe.sbt.SbtGit.GitKeys._
44

5-
val specs2Ver = "3.6.4"
5+
val specs2Ver = "3.8.6"
66
val parquetVer = "1.8.1"
77
val hadoopVer = "2.7.3"
8-
val sparkVer = "2.0.0"
9-
val circeVersion = "0.5.1"
8+
val sparkVer = "2.1.0"
9+
val circeVersion = "0.7.0"
10+
val scalazVersion = "7.2.9"
1011

1112
val pomInfo = (
1213
<url>https://github.com/intenthq/pucket</url>
@@ -29,11 +30,9 @@ val pomInfo = (
2930
</developers>
3031
)
3132

32-
def excludeServlet(deps: Seq[ModuleID]) = deps.map(_.exclude("javax.servlet", "servlet-api"))
33-
3433
lazy val commonSettings = Seq(
3534
organization := "com.intenthq.pucket",
36-
version := "1.3.0",
35+
version := "1.4.0",
3736
scalaVersion := "2.11.8",
3837
publishArtifact in Test := false,
3938
pomIncludeRepository := { _ => false },
@@ -47,21 +46,25 @@ lazy val commonSettings = Seq(
4746
pomExtra := pomInfo,
4847
resolvers += Opts.resolver.mavenLocalFile,
4948
autoAPIMappings := true,
50-
libraryDependencies ++= excludeServlet(Seq(
51-
"org.scalaz" %% "scalaz-core" % "7.1.3",
52-
"org.mortbay.jetty" % "servlet-api" % "3.0.20100224" % "provided",
53-
"org.apache.hadoop" % "hadoop-common" % hadoopVer % "provided",
54-
"org.apache.hadoop" % "hadoop-mapreduce-client-core" % hadoopVer % "provided",
55-
"org.apache.parquet" % "parquet-column" % parquetVer,
56-
"org.apache.parquet" % "parquet-hadoop" % parquetVer
57-
)),
5849
libraryDependencies ++= Seq(
59-
"io.circe" %% "circe-core",
60-
"io.circe" %% "circe-generic",
61-
"io.circe" %% "circe-parser"
62-
).map(_ % circeVersion),
63-
dependencyOverrides += "org.slf4j" % "slf4j-log4j12" % "1.7.12",
64-
dependencyOverrides += "org.slf4j" % "slf4j-api" % "1.7.12",
50+
"org.apache.hadoop" % "hadoop-common" % hadoopVer % "provided,test",
51+
"org.slf4j" % "slf4j-api" % "1.7.24" % "test",
52+
"org.slf4j" % "jcl-over-slf4j" % "1.7.24" % "test",
53+
"org.slf4j" % "jul-to-slf4j" % "1.7.24" % "test",
54+
"org.slf4j" % "log4j-over-slf4j" % "1.7.24" % "test",
55+
"ch.qos.logback" % "logback-classic" % "1.2.1" % "test"
56+
),
57+
excludeDependencies ++= Seq(
58+
// Our logging strategy is to use Logback (logback-classic) which provides
59+
// an SLF4J compatible API. We then import as many SLF4J bridges we can
60+
// so that every logging library effectively works with our Logback based
61+
// logging. Thus, anything outside of this needs to be excluded.
62+
SbtExclusionRule(organization = "commons-logging"),
63+
SbtExclusionRule(organization = "log4j", name = "log4j"),
64+
SbtExclusionRule(organization = "org.slf4j", name = "slf4j-simple"),
65+
SbtExclusionRule(organization = "org.slf4j", name = "slf4j-log4j12"),
66+
SbtExclusionRule(organization = "org.slf4j", name = "slf4j-jdk14")
67+
),
6568
resolvers ++= Seq(
6669
Resolver.typesafeRepo("releases"),
6770
Resolver.sonatypeRepo("public"),
@@ -72,98 +75,79 @@ lazy val commonSettings = Seq(
7275
)
7376
)
7477

75-
7678
lazy val core = (project in file("core")).
7779
settings(commonSettings: _*).
7880
settings(
7981
name := "pucket-core",
8082
libraryDependencies ++= Seq(
81-
"org.apache.commons" % "commons-lang3" % "3.4",
83+
"org.scalaz" %% "scalaz-core" % scalazVersion,
84+
"org.apache.commons" % "commons-lang3" % "3.5",
85+
"io.circe" %% "circe-core" % circeVersion,
86+
"io.circe" %% "circe-generic" % circeVersion,
87+
"io.circe" %% "circe-parser" % circeVersion,
88+
"org.apache.parquet" % "parquet-hadoop" % parquetVer,
89+
8290
"org.specs2" %% "specs2-core" % specs2Ver % "test",
8391
"org.specs2" %% "specs2-scalacheck" % specs2Ver % "test"
8492
)
8593
)
8694

87-
lazy val test = (project in file("test")).
95+
lazy val mapreduce = (project in file("mapreduce")).
8896
settings(commonSettings: _*).
8997
settings(
90-
name := "pucket-test",
91-
libraryDependencies ++= excludeServlet(Seq(
92-
"org.slf4j" % "jul-to-slf4j" % "1.7.12",
93-
"org.specs2" %% "specs2-core" % specs2Ver,
94-
"org.specs2" %% "specs2-scalacheck" % specs2Ver,
95-
"org.typelevel" %% "scalaz-specs2" % "0.4.0",
96-
"org.scalaz" %% "scalaz-scalacheck-binding" % "7.1.3",
97-
"org.apache.hadoop" % "hadoop-mapreduce-client-jobclient" % hadoopVer,
98-
"org.apache.hadoop" % "hadoop-common" % hadoopVer,
99-
"org.apache.hadoop" % "hadoop-mapreduce-client-core" % hadoopVer,
100-
"org.apache.spark" %% "spark-core" % sparkVer excludeAll(
101-
ExclusionRule(organization = "org.slf4j"),
102-
ExclusionRule(organization = "log4j"),
103-
ExclusionRule(organization = "org.scala-lang"),
104-
ExclusionRule(organization = "javax.servlet", name = "servlet-api")
105-
)
106-
))
107-
).dependsOn(core, mapreduce, spark)
98+
name := "pucket-mapreduce",
99+
libraryDependencies ++= Seq(
100+
"org.apache.hadoop" % "hadoop-mapreduce-client-jobclient" % hadoopVer % "provided,test",
101+
"org.specs2" %% "specs2-core" % specs2Ver % "test",
102+
"org.specs2" %% "specs2-scalacheck" % specs2Ver % "test"
103+
)
104+
).dependsOn(core % "compile->compile;test->test")
105+
106+
lazy val spark = (project in file("spark")).
107+
settings(commonSettings: _*).
108+
settings(
109+
name := "pucket-spark",
110+
libraryDependencies ++= Seq(
111+
"org.apache.spark" %% "spark-core" % sparkVer % "provided,test",
112+
"org.specs2" %% "specs2-core" % specs2Ver % "test",
113+
"org.typelevel" %% "scalaz-specs2" % "0.5.0" % "test"
114+
)
115+
).dependsOn(core % "compile->compile;test->test", mapreduce % "compile->compile;test->test")
108116

109117
lazy val thrift = (project in file("thrift")).
110118
settings(ThriftPlugin.thriftSettings: _*).
111119
settings(commonSettings: _*).
112120
settings(
113121
name := "pucket-thrift",
114122
libraryDependencies ++= Seq(
115-
"org.apache.thrift" % "libthrift" % "0.9.2",
123+
"org.apache.thrift" % "libthrift" % "0.9.3",
116124
"org.apache.parquet" % "parquet-thrift" % parquetVer
117125
)
118-
).dependsOn(core, test % "test->compile")
126+
).dependsOn(core % "compile->compile;test->test", mapreduce % "test->test", spark % "test->test")
119127

120128

121129
lazy val avro = (project in file("avro")).
122-
settings(sbtavro.SbtAvro.avroSettings : _*).
130+
enablePlugins(SbtAvro).
123131
settings(commonSettings: _*).
124132
settings(
125133
name := "pucket-avro",
126-
libraryDependencies ++= excludeServlet(Seq(
134+
libraryDependencies ++= Seq(
127135
"org.apache.avro" % "avro" % "1.7.7",
128136
"org.apache.avro" % "avro-compiler" % "1.7.7",
129137
"org.apache.parquet" % "parquet-avro" % parquetVer,
130-
"com.twitter" %% "chill-avro" % "0.7.0" % "test"
131-
))
132-
).dependsOn(core, test % "test->compile")
133-
134-
135-
lazy val mapreduce = (project in file("mapreduce")).
136-
settings(commonSettings: _*).
137-
settings(
138-
name := "pucket-mapreduce",
139-
libraryDependencies ++= excludeServlet(Seq(
140-
"org.apache.hadoop" % "hadoop-mapreduce-client-jobclient" % hadoopVer % "provided"
141-
))
142-
).dependsOn(core)
143-
144-
lazy val spark = (project in file("spark")).
145-
settings(commonSettings: _*).
146-
settings(
147-
name := "pucket-spark",
148-
libraryDependencies ++= excludeServlet(Seq(
149-
"org.apache.spark" %% "spark-core" % sparkVer % "provided" excludeAll(
150-
ExclusionRule(organization = "org.slf4j"),
151-
ExclusionRule(organization = "log4j"),
152-
ExclusionRule(organization = "org.scala-lang"),
153-
ExclusionRule(organization = "org.scalatest"),
154-
ExclusionRule(organization = "javax.servlet", name = "servlet-api")
155-
)
156-
))
157-
).dependsOn(core, mapreduce)
138+
"com.twitter" %% "chill-avro" % "0.8.4" % "test"
139+
)
140+
).dependsOn(core % "compile->compile;test->test", mapreduce % "test->test", spark % "test->test")
158141

159142
lazy val pucket = (project in file(".")).
160143
settings(commonSettings: _*).
161-
settings(unidocSettings: _*).
162-
settings(site.settings ++ ghpages.settings: _*).
144+
enablePlugins(ScalaUnidocPlugin, GhpagesPlugin).
163145
settings(
164146
name := "pucket",
165147
publishArtifact := false,
166148
publishTo := Some(Resolver.file("Unused transient repository", file("target/unusedrepo"))),
167-
site.addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), "latest/api"),
168-
git.gitRemoteRepo := "[email protected]:intenthq/pucket.git"
169-
).aggregate(core, test, thrift, avro, mapreduce, spark)
149+
gitRemoteRepo := "[email protected]:intenthq/pucket.git",
150+
siteSubdirName in ScalaUnidoc := "latest/api",
151+
addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), siteSubdirName in ScalaUnidoc),
152+
ghpagesNoJekyll := true
153+
).aggregate(core, thrift, avro, mapreduce, spark)

core/src/main/scala/com/intenthq/pucket/Pucket.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.intenthq.pucket
22

3+
import scala.language.higherKinds
34
import java.util.UUID
45

56
import com.intenthq.pucket.reader.Reader
@@ -243,4 +244,3 @@ object Pucket {
243244
_ <- \/.fromTryCatchNonFatal(input.close())
244245
} yield metadata
245246
}
246-

core/src/test/resources/logback.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<configuration debug="true">
2+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
3+
<encoder>
4+
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
5+
</encoder>
6+
</appender>
7+
8+
<root level="ERROR">
9+
<appender-ref ref="STDOUT" />
10+
</root>
11+
</configuration>

test/src/main/scala/com/intenthq/pucket/TestLogging.scala renamed to core/src/test/scala/com/intenthq/pucket/TestLogging.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ trait TestLogging {
99
SLF4JBridgeHandler.removeHandlersForRootLogger()
1010
LogManager.getLogManager.reset()
1111
SLF4JBridgeHandler.install()
12-
Logger.getLogger("global").setLevel(Level.OFF)
1312
Class.forName(classOf[Log].getName)
1413
val parquetLogger = Logger.getLogger("parquet")
1514
parquetLogger.getHandlers.foreach(parquetLogger.removeHandler)

0 commit comments

Comments
 (0)