Skip to content
This repository was archived by the owner on Nov 24, 2021. It is now read-only.

Commit 935f018

Browse files
committed
Bump akka http version and simplify dependencies
Moves the json parsing out of the common package so all projects don't need the spray json parsing. Bump akka http version. This is an addition to the memory leak fix, in the previous fix old akka versions were still being included on the classpath
1 parent 1bcbacb commit 935f018

File tree

7 files changed

+10
-33
lines changed

7 files changed

+10
-33
lines changed

alert-engine/src/main/scala/io/phdata/pulse/alertengine/AlertEngineImpl.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package io.phdata.pulse.alertengine
1818

1919
import com.typesafe.scalalogging.LazyLogging
2020
import io.phdata.pulse.alertengine.notification.NotificationServices
21-
import io.phdata.pulse.common.{ JsonSupport, SolrService }
21+
import io.phdata.pulse.common.{ SolrService }
2222

2323
/**
2424
* The Alert Engine will
@@ -31,7 +31,6 @@ import io.phdata.pulse.common.{ JsonSupport, SolrService }
3131
*/
3232
class AlertEngineImpl(solrService: SolrService, notificatonServices: NotificationServices)
3333
extends AlertEngine
34-
with JsonSupport
3534
with LazyLogging {
3635

3736
def run(applications: List[Application], silencedApplications: List[String]): Unit = {

build.sbt

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ lazy val dependencies =
6969
val scalaTest = "org.scalatest" %% "scalatest" % scalaTestVersion % Test
7070
val scalaDockerTest = "com.whisk" %% "docker-testkit-scalatest" % dockerTestKitVersion % Test
7171
val spotifyDockerTest = "com.whisk" %% "docker-testkit-impl-spotify" % dockerTestKitVersion % Test
72-
val slf4jLogging = "org.slf4j" % "slf4j-log4j12" % "1.7.5" % Test
72+
val slf4jLogging = "org.slf4j" % "slf4j-log4j12" % "1.7.5"
7373

7474
val kudu = "org.apache.kudu" % "kudu-client" % kuduVersion
7575
val kuduTestUtils = "org.apache.kudu" % "kudu-test-utils" % kuduVersion % Test
@@ -86,10 +86,10 @@ lazy val dependencies =
8686
val apacheKafka = "org.apache.kafka" % "kafka_2.11" % "0.10.2-kafka-2.2.0" % Provided
8787

8888
// Http depends
89+
val akkaActor = "com.typesafe.akka" %% "akka-actor" % akkaActorVersion
90+
val akkaStream = "com.typesafe.akka" %% "akka-stream" % akkaActorVersion
8991
val akkaHttp = "com.typesafe.akka" %% "akka-http" % akkaHttpVersion
9092
val akkaHttpSprayJson = "com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpVersion
91-
val akkaCors = "ch.megard" %% "akka-http-cors" % akkaCorsVersion
92-
val akka = "com.typesafe.akka" %% "akka-actor" % akkaVersion
9393

9494
val akkaTestKit = "com.typesafe.akka" %% "akka-testkit" % "2.4.20" % Test
9595
val akkaHttpTest = "com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % Test
@@ -127,7 +127,7 @@ lazy val dependencies =
127127
val cli = Seq(scallop, scalaYaml)
128128
val all = common ++ cli ++ Seq(scalaDockerTest, spotifyDockerTest)
129129

130-
val http = Seq(akkaHttp, akkaHttpSprayJson, akkaCors, akkaTestKit, akkaHttpTest)
130+
val http = Seq(akkaHttp, akkaHttpSprayJson, akkaTestKit, akkaHttpTest, akkaActor, akkaStream)
131131

132132
val mocking = Seq(mockito, powermock, powerMockApi, powerMockJunit)
133133
}
@@ -172,8 +172,7 @@ lazy val `log-collector` = project
172172
dependencies.kudu,
173173
dependencies.kuduBinary,
174174
dependencies.kuduTestUtils
175-
) ++ dependencies.solr ++ dependencies.common,
176-
dependencyOverrides += dependencies.akka
175+
) ++ dependencies.solr ++ dependencies.common
177176
)
178177
.dependsOn(common)
179178
.dependsOn(solrModule)
@@ -198,15 +197,14 @@ lazy val `alert-engine` = project
198197
settings,
199198
libraryDependencies ++= dependencies.common ++ dependencies.solr ++ Seq(dependencies.javaMail) ++ Seq(
200199
dependencies.scalaYaml,
201-
dependencies.sprayJson,
202200
dependencies.scallop) ++ dependencies.mocking
203201
)
204202
.dependsOn(common)
205203
.dependsOn(solrModule)
206204
.dependsOn(solrModule % "test->test")
207205

208206
lazy val `common` = project
209-
.settings(name := "common", settings, libraryDependencies ++= dependencies.common :+ dependencies.akkaHttpSprayJson)
207+
.settings(name := "common", settings, libraryDependencies ++= dependencies.common)
210208

211209
lazy val `solr4` = project
212210
.settings(
@@ -247,9 +245,8 @@ val scalaTestVersion = "3.0.8"
247245
val dockerTestKitVersion = "0.9.5"
248246
val solrj4Version = "4.10.3-cdh5.12.1"
249247
val solrj7Version = "7.4.0-cdh6.1.1"
250-
val akkaVersion = "2.5.8"
251-
val akkaHttpVersion = "10.0.15"
252-
val akkaCorsVersion = "0.2.2"
248+
val akkaActorVersion = "2.5.23"
249+
val akkaHttpVersion = "10.1.10"
253250
val sprayJsonVersion = "1.3.5"
254251
val sparkVersion = "2.2.0.cloudera1"
255252
val log4jVersion = "1.2.17"

common/src/main/scala/io/phdata/pulse/common/JsonSupport.scala renamed to log-collector/src/main/scala/io/phdata/pulse/logcollector/JsonSupport.scala

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
1-
/*
2-
* Copyright 2018 phData Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
package io.phdata.pulse.common
1+
package io.phdata.pulse.logcollector
172

183
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
194
import io.phdata.pulse.common.domain.{ LogEvent, TimeseriesEvent, TimeseriesRequest }

log-collector/src/main/scala/io/phdata/pulse/logcollector/LogCollectorRoutes.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import akka.http.scaladsl.common.EntityStreamingSupport
2020
import akka.http.scaladsl.model.{ ContentTypes, HttpEntity, StatusCodes }
2121
import akka.http.scaladsl.server.Directives._
2222
import com.typesafe.scalalogging.LazyLogging
23-
import io.phdata.pulse.common.JsonSupport
2423
import io.phdata.pulse.common.domain.{ LogEvent, TimeseriesRequest }
2524

2625
/**

log-collector/src/main/scala/io/phdata/pulse/logcollector/PulseKafkaConsumer.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import java.util.{ Collections, Properties }
2020

2121
import org.apache.kafka.clients.consumer.KafkaConsumer
2222
import com.typesafe.scalalogging.LazyLogging
23-
import io.phdata.pulse.common.JsonSupport
2423
import spray.json.JsonParser.ParsingException
2524

2625
import scala.collection.JavaConverters._

log-collector/src/test/scala/io/phdata/pulse/logcollector/LogCollectorRoutesTest.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import akka.http.scaladsl.marshalling.Marshal
2121
import akka.http.scaladsl.model.{ ContentTypes, HttpEntity, MessageEntity, StatusCodes }
2222
import akka.http.scaladsl.server.Route
2323
import akka.http.scaladsl.testkit.ScalatestRouteTest
24-
import io.phdata.pulse.common.JsonSupport
2524
import io.phdata.pulse.common.domain.{ LogEvent, TimeseriesEvent, TimeseriesRequest }
2625
import io.phdata.pulse.solr.BaseSolrCloudTest
2726
import org.mockito.Mockito.verify

log-collector/src/test/scala/io/phdata/pulse/logcollector/PulseKafkaConsumerTest.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import java.sql.Timestamp
2020
import java.text.SimpleDateFormat
2121
import java.util.Properties
2222

23-
import io.phdata.pulse.common.JsonSupport
2423
import io.phdata.pulse.logcollector.utils.{ KafkaMiniCluster, ZooKafkaConfig }
2524
import io.phdata.pulse.solr.{ BaseSolrCloudTest }
2625
import org.apache.kafka.clients.consumer.ConsumerConfig

0 commit comments

Comments
 (0)