Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
249 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 0 additions & 45 deletions
45
.../common/src/main/scala/com/snowplowanalytics/snowplow/postgres/config/Base64Encoded.scala
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
modules/common/src/main/scala/com/snowplowanalytics/snowplow/postgres/config/DBConfig.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) 2020 Snowplow Analytics Ltd. All rights reserved. | ||
* | ||
* This program is licensed to you under the Apache License Version 2.0, | ||
* and you may not use this file except in compliance with the Apache License Version 2.0. | ||
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the Apache License Version 2.0 is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under. | ||
*/ | ||
package com.snowplowanalytics.snowplow.postgres.config | ||
|
||
import DBConfig.JdbcUri | ||
|
||
case class DBConfig(host: String, | ||
port: Int, | ||
database: String, | ||
username: String, | ||
password: String, // TODO: can be EC2 store | ||
sslMode: String, | ||
schema: String) { | ||
def getJdbc: JdbcUri = | ||
JdbcUri(host, port, database, sslMode.toLowerCase().replace('_', '-')) | ||
} | ||
|
||
object DBConfig { | ||
|
||
|
||
case class JdbcUri(host: String, port: Int, database: String, sslMode: String) { | ||
override def toString = | ||
s"jdbc:postgresql://$host:$port/$database?sslmode=$sslMode" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...es/common/src/main/scala/com/snowplowanalytics/snowplow/postgres/shredding/Shredded.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright (c) 2020 Snowplow Analytics Ltd. All rights reserved. | ||
* | ||
* This program is licensed to you under the Apache License Version 2.0, | ||
* and you may not use this file except in compliance with the Apache License Version 2.0. | ||
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the Apache License Version 2.0 is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under. | ||
*/ | ||
package com.snowplowanalytics.snowplow.postgres.shredding | ||
|
||
sealed trait Shredded | ||
|
||
object Shredded { | ||
case class ShreddedSnowplow(event: Entity, entities: List[Entity]) extends Shredded | ||
case class ShreddedSelfDescribing(entity: Entity) extends Shredded | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
modules/common/src/main/scala/com/snowplowanalytics/snowplow/postgres/streaming/data.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (c) 2020 Snowplow Analytics Ltd. All rights reserved. | ||
* | ||
* This program is licensed to you under the Apache License Version 2.0, | ||
* and you may not use this file except in compliance with the Apache License Version 2.0. | ||
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the Apache License Version 2.0 is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under. | ||
*/ | ||
package com.snowplowanalytics.snowplow.postgres.streaming | ||
|
||
import com.snowplowanalytics.iglu.core.SelfDescribingData | ||
|
||
import io.circe.Json | ||
|
||
import com.snowplowanalytics.snowplow.analytics.scalasdk.Event | ||
import com.snowplowanalytics.snowplow.badrows.BadRow | ||
|
||
object data { | ||
|
||
/** Kind of data flowing through the Loader */ | ||
sealed trait Data extends Product with Serializable { | ||
def snowplow: Boolean = this match { | ||
case _: Data.Snowplow => true | ||
case _: Data.SelfDescribing => false | ||
} | ||
} | ||
|
||
object Data { | ||
case class Snowplow(data: Event) extends Data | ||
case class SelfDescribing(data: SelfDescribingData[Json]) extends Data | ||
} | ||
|
||
/** Data that for some reasons cannot be inserted into DB */ | ||
sealed trait BadData extends Throwable with Product with Serializable | ||
object BadData { | ||
/** Typical Snowplow bad row (Loader Iglu Error etc) */ | ||
case class BadEnriched(data: BadRow) extends BadData | ||
/** Non-enriched error */ | ||
case class BadJson(payload: String, error: String) extends BadData | ||
} | ||
} | ||
|
Oops, something went wrong.