Skip to content
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
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ TSP is a Time Series Patterns search engine. It is a backend system behind the [

TSP is a distributed compute system implemented in Modern Scala. For more information, refer to [Documentation](https://clover-group.github.io/tsp/).

## Build
To compile TSP you need to have [github.token](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token) (requires the ```read:package``` grant) set in ~/.gitconfig :
```
[github]
token = TOKEN_DATA
```

## Profiling

![YourKit logo](https://www.yourkit.com/images/yklogo.png)
Expand Down
29 changes: 10 additions & 19 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dockerUsername in Docker := Some("clovergrp")
dockerUpdateLatest := true
dockerAlias in Docker := dockerAlias.value.withTag(dockerAlias.value.tag.map(_.replace("+", "_")))

// Flink currently does not work with Scala 2.12.8+
scalaVersion in ThisBuild := "2.12.10"
resolvers in ThisBuild ++= Seq(
"Apache Development Snapshot Repository" at "https://repository.apache.org/content/repositories/snapshots/",
Expand Down Expand Up @@ -139,16 +138,16 @@ case "git.properties" => MergeStrategy.first
lazy val runTask = taskKey[Unit]("App runner")

//runTask := {
// (http/runMain ${TSP_LAUNCHER:-ru.itclover.tsp.http.Launcher} ${TSP_LAUNCHER_ARGS:-flink-local})
// (http/runMain ${TSP_LAUNCHER:-ru.itclover.tsp.http.Launcher} ${TSP_LAUNCHER_ARGS:-spark-local})
//}

lazy val root = (project in file("."))
.enablePlugins(GitVersioning, JavaAppPackaging, UniversalPlugin)

.settings(commonSettings)
.settings(githubRelease := Utils.defaultGithubRelease.evaluated)
.aggregate(core, config, http, flink, spark, dsl, itValid)
.dependsOn(core, config, http, flink, spark, dsl, itValid)
.aggregate(core, config, http, spark, dsl, itValid)
.dependsOn(core, config, http, spark, dsl, itValid)

lazy val core = project.in(file("core"))
.settings(commonSettings)
Expand All @@ -162,26 +161,18 @@ lazy val config = project.in(file("config"))
.settings(commonSettings)
.settings(
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion,
"flinkVersion" -> Version.flink, "sparkVersion" -> Version.spark),
"sparkVersion" -> Version.spark),
buildInfoPackage := "ru.itclover.tsp"
)
.dependsOn(core)

lazy val flink = project.in(file("flink"))
.settings(commonSettings)
.settings(
libraryDependencies ++= Library.flink ++ Library.scalaTest ++ Library.dbDrivers ++ Library.redisson ++ Library.logging,
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-core" % "2.10.0"
)
.dependsOn(core, config, dsl)

lazy val http = project.in(file("http"))
.settings(commonSettings)
.settings(
libraryDependencies ++= Library.scalaTest ++ Library.flink ++ Library.akka ++
libraryDependencies ++= Library.scalaTest ++ Library.akka ++
Library.akkaHttp ++ Library.sparkDeps ++ Library.logging
)
.dependsOn(core, config, flink, spark, dsl)
.dependsOn(core, config, spark, dsl)

lazy val dsl = project.in(file("dsl"))
.settings(commonSettings)
Expand All @@ -193,23 +184,23 @@ lazy val dsl = project.in(file("dsl"))
lazy val spark = project.in(file("spark"))
.settings(commonSettings)
.settings(
libraryDependencies ++= Library.scalaTest ++ Library.sparkDeps ++ Library.logging,
libraryDependencies ++= Library.scalaTest ++ Library.dbDrivers ++ Library.sparkDeps ++ Library.logging,
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-core" % "2.10.0"
)
.dependsOn(core, config, dsl)

lazy val itValid = project.in(file("integration/correctness"))
.settings(commonSettings)
.settings(
libraryDependencies ++= Library.flink ++ Library.scalaTest ++ Library.dbDrivers ++ Library.testContainers ++ Library.logging,
libraryDependencies ++= Library.scalaTest ++ Library.dbDrivers ++ Library.testContainers ++ Library.logging,
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.0"
)
.dependsOn(core, flink, http, config)
.dependsOn(core, http, config)

lazy val itPerf = project.in(file("integration/performance"))
.settings(commonSettings)
.settings(
libraryDependencies ++= Library.flink ++ Library.scalaTest ++ Library.dbDrivers ++ Library.testContainers ++ Library.logging
libraryDependencies ++= Library.scalaTest ++ Library.dbDrivers ++ Library.testContainers ++ Library.logging
)
.dependsOn(itValid)

Expand Down
6 changes: 0 additions & 6 deletions core/src/main/scala/ru/itclover/tsp/core/Incident.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ case class Incident(
patternId: Int,
maxWindowMs: Long,
segment: Segment,
@deprecated("Unused and scheduled to be removed in 0.17", since = "TSP 0.16")
forwardedFields: Seq[(String, String)],
patternUnit: Int,
patternSubunit: Int,
@deprecated("Unused and scheduled to be removed in 0.17", since = "TSP 0.16")
patternPayload: Seq[(String, String)]
) extends Product
with Serializable

Expand All @@ -39,10 +35,8 @@ object IncidentInstances {
b.patternId,
b.maxWindowMs,
Segment(from, to),
b.forwardedFields,
b.patternUnit,
b.patternSubunit,
b.patternPayload
)
}
}
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/scala/ru/itclover/tsp/core/RawPattern.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ package ru.itclover.tsp.core
case class RawPattern(
id: Int,
sourceCode: String,
payload: Option[Map[String, String]] = None,
subunit: Option[Int] = None,
forwardedFields: Option[Seq[Symbol]] = None
) extends Serializable
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,17 @@ class FoundedPatternTest extends WordSpec with Matchers {
patternId = 1,
maxWindowMs = 1000,
segment = firstTestSegment,
forwardedFields = Seq(("test1", "1"), ("test2", "2")),
patternUnit = 13,
patternSubunit = 42,
patternPayload = Seq(("test3", "3"), ("test4", "4"))
)

val secondIncident = Incident(
id = "second",
patternId = 2,
maxWindowMs = 4000,
segment = secondTestSegment,
forwardedFields = Seq(("test1", "1"), ("test2", "2")),
patternUnit = 13,
patternSubunit = 42,
patternPayload = Seq(("test3", "3"), ("test4", "4"))
)

val expectedIncident = Incident(
Expand All @@ -52,10 +48,8 @@ class FoundedPatternTest extends WordSpec with Matchers {
from = Time(1000),
to = Time(4000)
),
forwardedFields = Seq(("test1", "1"), ("test2", "2")),
patternUnit = 13,
patternSubunit = 42,
patternPayload = Seq(("test3", "3"), ("test4", "4"))
)

val actualIncident = IncidentInstances.semigroup.combine(firstIncident, secondIncident)
Expand Down
17 changes: 0 additions & 17 deletions flink/src/main/java/ru/itclover/tsp/DebugTsViolationHandler.java

This file was deleted.

Loading