You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by md...@apache.org on 2022/11/14 20:34:10 UTC
[incubator-pekko-persistence-jdbc] branch main updated (9d0cb56 -> c69b406)
This is an automated email from the ASF dual-hosted git repository.
mdedetrich pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-pekko-persistence-jdbc.git
from 9d0cb56 upgrade cache-action (#2)
new 38ca3e0 Update scalafmt
new 61465f9 Add .gitattributes to enforce unix line endings
new c69b406 format source with scalafmt, #3
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.gitattributes | 5 ++
.scalafmt.conf | 63 ++++++++++++++--------
build.sbt | 4 +-
.../akka/persistence/jdbc/AkkaSerialization.scala | 1 -
.../akka/persistence/jdbc/db/SlickExtension.scala | 2 +-
.../jdbc/journal/JdbcAsyncWriteJournal.scala | 2 +-
.../jdbc/journal/dao/JournalQueries.scala | 2 +-
.../jdbc/snapshot/dao/DefaultSnapshotDao.scala | 8 +--
.../persistence/jdbc/util/InputStreamOps.scala | 2 +-
.../jdbc/query/EventsByPersistenceIdTest.scala | 1 -
.../persistence/jdbc/query/EventsByTagTest.scala | 1 -
.../persistence/jdbc/query/QueryTestSpec.scala | 6 +--
12 files changed, 58 insertions(+), 39 deletions(-)
create mode 100644 .gitattributes
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org
[incubator-pekko-persistence-jdbc] 02/03: Add .gitattributes to enforce unix line endings
Posted by md...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mdedetrich pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-pekko-persistence-jdbc.git
commit 61465f9eb8c6d3aad1ece41605b0a444dfddbfd8
Author: Matthew de Detrich <ma...@aiven.io>
AuthorDate: Mon Nov 14 21:16:27 2022 +0100
Add .gitattributes to enforce unix line endings
---
.gitattributes | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..9dde9b9
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,5 @@
+# Activate line ending normalization, setting eol will make the behavior match core.autocrlf = input
+* text=auto eol=lf
+# Force batch scripts to always use CRLF line endings
+*.{cmd,[cC][mM][dD]} text eol=crlf
+*.{bat,[bB][aA][tT]} text eol=crlf
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org
[incubator-pekko-persistence-jdbc] 03/03: format source with scalafmt, #3
Posted by md...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mdedetrich pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-pekko-persistence-jdbc.git
commit c69b4062b3530798e43287cc75a74ade11955b53
Author: Auto Format <nobody>
AuthorDate: Mon Nov 14 21:19:10 2022 +0100
format source with scalafmt, #3
---
build.sbt | 4 ++--
core/src/main/scala/akka/persistence/jdbc/AkkaSerialization.scala | 1 -
core/src/main/scala/akka/persistence/jdbc/db/SlickExtension.scala | 2 +-
.../akka/persistence/jdbc/journal/JdbcAsyncWriteJournal.scala | 2 +-
.../scala/akka/persistence/jdbc/journal/dao/JournalQueries.scala | 2 +-
.../akka/persistence/jdbc/snapshot/dao/DefaultSnapshotDao.scala | 8 ++++----
.../main/scala/akka/persistence/jdbc/util/InputStreamOps.scala | 2 +-
.../akka/persistence/jdbc/query/EventsByPersistenceIdTest.scala | 1 -
.../test/scala/akka/persistence/jdbc/query/EventsByTagTest.scala | 1 -
.../test/scala/akka/persistence/jdbc/query/QueryTestSpec.scala | 6 ++----
10 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/build.sbt b/build.sbt
index ea632df..e6635bc 100644
--- a/build.sbt
+++ b/build.sbt
@@ -44,7 +44,7 @@ lazy val docs = project
makeSite := makeSite.dependsOn(LocalRootProject / ScalaUnidoc / doc).value,
previewPath := (Paradox / siteSubdirName).value,
Preprocess / siteSubdirName := s"api/akka-persistence-jdbc/${if (isSnapshot.value) "snapshot"
- else version.value}",
+ else version.value}",
Preprocess / sourceDirectory := (LocalRootProject / ScalaUnidoc / unidoc / target).value,
Paradox / siteSubdirName := s"docs/akka-persistence-jdbc/${if (isSnapshot.value) "snapshot" else version.value}",
Compile / paradoxProperties ++= Map(
@@ -54,7 +54,7 @@ lazy val docs = project
"akka.version" -> Dependencies.AkkaVersion,
"slick.version" -> Dependencies.SlickVersion,
"extref.github.base_url" -> s"https://github.com/akka/akka-persistence-jdbc/blob/${if (isSnapshot.value) "master"
- else "v" + version.value}/%s",
+ else "v" + version.value}/%s",
// Slick
"extref.slick.base_url" -> s"https://scala-slick.org/doc/${Dependencies.SlickVersion}/%s",
// Akka
diff --git a/core/src/main/scala/akka/persistence/jdbc/AkkaSerialization.scala b/core/src/main/scala/akka/persistence/jdbc/AkkaSerialization.scala
index 2030999..c327042 100644
--- a/core/src/main/scala/akka/persistence/jdbc/AkkaSerialization.scala
+++ b/core/src/main/scala/akka/persistence/jdbc/AkkaSerialization.scala
@@ -31,7 +31,6 @@ object AkkaSerialization {
def fromRow(serialization: Serialization)(row: JournalAkkaSerializationRow): Try[(PersistentRepr, Long)] = {
serialization.deserialize(row.eventPayload, row.eventSerId, row.eventSerManifest).flatMap { payload =>
-
val metadata = for {
mPayload <- row.metaPayload
mSerId <- row.metaSerId
diff --git a/core/src/main/scala/akka/persistence/jdbc/db/SlickExtension.scala b/core/src/main/scala/akka/persistence/jdbc/db/SlickExtension.scala
index 3581542..8127228 100644
--- a/core/src/main/scala/akka/persistence/jdbc/db/SlickExtension.scala
+++ b/core/src/main/scala/akka/persistence/jdbc/db/SlickExtension.scala
@@ -66,7 +66,7 @@ class DefaultSlickDatabaseProvider(system: ActorSystem) extends SlickDatabasePro
case (key, notAnObject) =>
throw new RuntimeException(
s"""Expected "akka-persistence-jdbc.shared-databases.$key" to be a config ConfigObject, but got ${notAnObject
- .valueType()} (${notAnObject.getClass})""")
+ .valueType()} (${notAnObject.getClass})""")
}
.toMap
diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/JdbcAsyncWriteJournal.scala b/core/src/main/scala/akka/persistence/jdbc/journal/JdbcAsyncWriteJournal.scala
index 4f844f3..c0441a7 100644
--- a/core/src/main/scala/akka/persistence/jdbc/journal/JdbcAsyncWriteJournal.scala
+++ b/core/src/main/scala/akka/persistence/jdbc/journal/JdbcAsyncWriteJournal.scala
@@ -73,7 +73,7 @@ class JdbcAsyncWriteJournal(config: Config) extends AsyncWriteJournal {
case upgraded: JournalDaoWithUpdates => upgraded
case _ =>
throw new IllegalStateException(s"The ${journalDao.getClass} does NOT implement [JournalDaoWithUpdates], " +
- s"which is required to perform updates of events! Please configure a valid update capable DAO (e.g. the default [ByteArrayJournalDao].")
+ s"which is required to perform updates of events! Please configure a valid update capable DAO (e.g. the default [ByteArrayJournalDao].")
}
// readHighestSequence must be performed after pending write for a persistenceId
diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalQueries.scala b/core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalQueries.scala
index 892fbd8..4335692 100644
--- a/core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalQueries.scala
+++ b/core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalQueries.scala
@@ -24,7 +24,7 @@ class JournalQueries(
private val TagTableC = Compiled(TagTable)
def writeJournalRows(xs: Seq[(JournalAkkaSerializationRow, Set[String])])(implicit ec: ExecutionContext) = {
- val sorted = xs.sortBy((event => event._1.sequenceNumber))
+ val sorted = xs.sortBy(event => event._1.sequenceNumber)
if (sorted.exists(_._2.nonEmpty)) {
// only if there are any tags
val (events, tags) = sorted.unzip
diff --git a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/DefaultSnapshotDao.scala b/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/DefaultSnapshotDao.scala
index 502b41c..600bd58 100644
--- a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/DefaultSnapshotDao.scala
+++ b/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/DefaultSnapshotDao.scala
@@ -105,15 +105,15 @@ class DefaultSnapshotDao(
.map(_ => ())(ExecutionContexts.parasitic)
override def deleteAllSnapshots(persistenceId: String): Future[Unit] =
- db.run(queries.selectAll(persistenceId).delete).map(_ => ())((ExecutionContexts.parasitic))
+ db.run(queries.selectAll(persistenceId).delete).map(_ => ())(ExecutionContexts.parasitic)
override def deleteUpToMaxSequenceNr(persistenceId: String, maxSequenceNr: Long): Future[Unit] =
db.run(queries.selectByPersistenceIdUpToMaxSequenceNr((persistenceId, maxSequenceNr)).delete)
- .map(_ => ())((ExecutionContexts.parasitic))
+ .map(_ => ())(ExecutionContexts.parasitic)
override def deleteUpToMaxTimestamp(persistenceId: String, maxTimestamp: Long): Future[Unit] =
db.run(queries.selectByPersistenceIdUpToMaxTimestamp((persistenceId, maxTimestamp)).delete)
- .map(_ => ())((ExecutionContexts.parasitic))
+ .map(_ => ())(ExecutionContexts.parasitic)
override def deleteUpToMaxSequenceNrAndMaxTimestamp(
persistenceId: String,
@@ -123,5 +123,5 @@ class DefaultSnapshotDao(
queries
.selectByPersistenceIdUpToMaxSequenceNrAndMaxTimestamp((persistenceId, maxSequenceNr, maxTimestamp))
.delete)
- .map(_ => ())((ExecutionContexts.parasitic))
+ .map(_ => ())(ExecutionContexts.parasitic)
}
diff --git a/core/src/main/scala/akka/persistence/jdbc/util/InputStreamOps.scala b/core/src/main/scala/akka/persistence/jdbc/util/InputStreamOps.scala
index b38a37a..03a708d 100644
--- a/core/src/main/scala/akka/persistence/jdbc/util/InputStreamOps.scala
+++ b/core/src/main/scala/akka/persistence/jdbc/util/InputStreamOps.scala
@@ -19,7 +19,7 @@ object InputStreamOps {
* - https://stackoverflow.com/users/2619133/oliverkn
*/
val bos: ByteArrayOutputStream = new ByteArrayOutputStream
- val buffer: Array[Byte] = new Array[Byte](0xffff)
+ val buffer: Array[Byte] = new Array[Byte](0xFFFF)
var len: Int = is.read(buffer)
while (len != -1) {
bos.write(buffer, 0, len)
diff --git a/core/src/test/scala/akka/persistence/jdbc/query/EventsByPersistenceIdTest.scala b/core/src/test/scala/akka/persistence/jdbc/query/EventsByPersistenceIdTest.scala
index fa7043a..3d63437 100644
--- a/core/src/test/scala/akka/persistence/jdbc/query/EventsByPersistenceIdTest.scala
+++ b/core/src/test/scala/akka/persistence/jdbc/query/EventsByPersistenceIdTest.scala
@@ -173,7 +173,6 @@ abstract class EventsByPersistenceIdTest(config: String) extends QueryTestSpec(c
val journalOps = new ScalaJdbcReadJournalOperations(system)
val testStartTime = System.currentTimeMillis()
withTestActors(replyToMessages = true) { (actor1, actor2, actor3) =>
-
(actor1 ? withTags(1, "number")).futureValue
(actor2 ? withTags(2, "number")).futureValue
(actor3 ? withTags(3, "number")).futureValue
diff --git a/core/src/test/scala/akka/persistence/jdbc/query/EventsByTagTest.scala b/core/src/test/scala/akka/persistence/jdbc/query/EventsByTagTest.scala
index 239e3f6..0c14055 100644
--- a/core/src/test/scala/akka/persistence/jdbc/query/EventsByTagTest.scala
+++ b/core/src/test/scala/akka/persistence/jdbc/query/EventsByTagTest.scala
@@ -127,7 +127,6 @@ abstract class EventsByTagTest(config: String) extends QueryTestSpec(config, con
val testStartTime = System.currentTimeMillis()
val journalOps = new ScalaJdbcReadJournalOperations(system)
withTestActors(replyToMessages = true) { (actor1, actor2, actor3) =>
-
(actor1 ? withTags(1, "number")).futureValue
(actor2 ? withTags(2, "number")).futureValue
(actor3 ? withTags(3, "number")).futureValue
diff --git a/core/src/test/scala/akka/persistence/jdbc/query/QueryTestSpec.scala b/core/src/test/scala/akka/persistence/jdbc/query/QueryTestSpec.scala
index 307b86c..42ccf9e 100644
--- a/core/src/test/scala/akka/persistence/jdbc/query/QueryTestSpec.scala
+++ b/core/src/test/scala/akka/persistence/jdbc/query/QueryTestSpec.scala
@@ -287,10 +287,8 @@ abstract class QueryTestSpec(config: String, configOverrides: Map[String, Config
}
def pendingIfOracleWithLegacy(): Unit = {
- if (
- profile == slick.jdbc.OracleProfile && readJournalConfig.pluginConfig.dao == classOf[
- akka.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao].getName
- )
+ if (profile == slick.jdbc.OracleProfile && readJournalConfig.pluginConfig.dao == classOf[
+ akka.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao].getName)
pending // TODO https://github.com/akka/akka-persistence-jdbc/issues/673
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org
[incubator-pekko-persistence-jdbc] 01/03: Update scalafmt
Posted by md...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mdedetrich pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-pekko-persistence-jdbc.git
commit 38ca3e02e5b186a51754e391ab2eedefa28f88b5
Author: Matthew de Detrich <ma...@aiven.io>
AuthorDate: Mon Nov 14 21:13:16 2022 +0100
Update scalafmt
---
.scalafmt.conf | 63 ++++++++++++++++++++++++++++++++++++++--------------------
1 file changed, 41 insertions(+), 22 deletions(-)
diff --git a/.scalafmt.conf b/.scalafmt.conf
index f4b627c..27514fe 100644
--- a/.scalafmt.conf
+++ b/.scalafmt.conf
@@ -1,22 +1,40 @@
-version = 3.0.8
-
-style = defaultWithAlign
-
-docstrings.style = Asterisk
-docstrings.wrap = no
-indentOperator.preset = spray
-maxColumn = 120
-rewrite.rules = [RedundantParens, SortImports, AvoidInfix]
-unindentTopLevelOperators = true
-align.tokens = [{code = "=>", owner = "Case"}]
-align.openParenDefnSite = false
-align.openParenCallSite = false
-optIn.breakChainOnFirstMethodDot = false
-optIn.configStyleArguments = false
-danglingParentheses.defnSite = false
-danglingParentheses.callSite = false
-spaces.inImportCurlyBraces = true
-rewrite.neverInfix.excludeFilters = [
+version = 3.6.1
+runner.dialect = scala213
+project.git = true
+style = defaultWithAlign
+docstrings.style = Asterisk
+docstrings.wrap = false
+indentOperator.preset = spray
+maxColumn = 120
+lineEndings = preserve
+rewrite.rules = [RedundantParens, SortImports, AvoidInfix]
+indentOperator.exemptScope = all
+align.preset = some
+align.tokens."+" = [
+ {
+ code = "~>"
+ owners = [
+ { regex = "Term.ApplyInfix" }
+ ]
+ }
+]
+literals.hexDigits = upper
+literals.hexPrefix = lower
+binPack.unsafeCallSite = always
+binPack.unsafeDefnSite = always
+binPack.indentCallSiteSingleArg = false
+binPack.indentCallSiteOnce = true
+newlines.avoidForSimpleOverflow = [slc]
+newlines.source = keep
+newlines.beforeMultiline = keep
+align.openParenDefnSite = false
+align.openParenCallSite = false
+align.allowOverflow = true
+optIn.breakChainOnFirstMethodDot = false
+optIn.configStyleArguments = false
+danglingParentheses.preset = false
+spaces.inImportCurlyBraces = true
+rewrite.neverInfix.excludeFilters = [
and
min
max
@@ -46,11 +64,12 @@ rewrite.neverInfix.excludeFilters = [
allElementsOf
inOrderElementsOf
theSameElementsAs
+ theSameElementsInOrderAs
]
-rewriteTokens = {
+rewriteTokens = {
"⇒": "=>"
"→": "->"
"←": "<-"
}
-newlines.afterCurlyLambda = preserve
-newlines.implicitParamListModifierPrefer = before
+project.layout = StandardConvention
+
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org