This is an automated email from the ASF dual-hosted git repository.

hepin pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/incubator-pekko-persistence-cassandra.git


The following commit(s) were added to refs/heads/main by this push:
     new 66cb0e2  Unwrap single string interpolation syntax
66cb0e2 is described below

commit 66cb0e2ba424ed3ca79acccf227fcec03f680c90
Author: Matthew de Detrich <[email protected]>
AuthorDate: Sat May 27 14:07:15 2023 +0200

    Unwrap single string interpolation syntax
---
 .../cassandra/query/EventsByTagStage.scala           |  2 +-
 .../query/MissingTaggedEventException.scala          |  2 +-
 .../snapshot/CassandraSnapshotStatements.scala       | 20 ++++++++++----------
 .../pekko/persistence/cassandra/CassandraSpec.scala  |  2 +-
 .../cassandra/EventsByTagMigrationSpec.scala         |  2 +-
 .../cassandra/EventsByTagRecoverySpec.scala          |  8 ++++----
 project/CopyrightHeader.scala                        |  2 +-
 7 files changed, 19 insertions(+), 19 deletions(-)

diff --git 
a/core/src/main/scala/org/apache/pekko/persistence/cassandra/query/EventsByTagStage.scala
 
b/core/src/main/scala/org/apache/pekko/persistence/cassandra/query/EventsByTagStage.scala
index 0f78274..06605ed 100644
--- 
a/core/src/main/scala/org/apache/pekko/persistence/cassandra/query/EventsByTagStage.scala
+++ 
b/core/src/main/scala/org/apache/pekko/persistence/cassandra/query/EventsByTagStage.scala
@@ -147,7 +147,7 @@ import scala.util.{ Failure, Success, Try }
     // don't include buffered in the toString
     override def toString =
       s"LookingForMissing{min=$minOffset maxOffset=$maxOffset bucket=$bucket " 
+
-      s"queryPrevious=$queryPrevious searchingFor=${remainingMissing} " +
+      s"queryPrevious=$queryPrevious searchingFor=$remainingMissing " +
       s"missing=$remainingMissing deadline=$deadline gapDetected=$gapDetected"
   }
 
diff --git 
a/core/src/main/scala/org/apache/pekko/persistence/cassandra/query/MissingTaggedEventException.scala
 
b/core/src/main/scala/org/apache/pekko/persistence/cassandra/query/MissingTaggedEventException.scala
index c2c8012..8c3724c 100644
--- 
a/core/src/main/scala/org/apache/pekko/persistence/cassandra/query/MissingTaggedEventException.scala
+++ 
b/core/src/main/scala/org/apache/pekko/persistence/cassandra/query/MissingTaggedEventException.scala
@@ -34,4 +34,4 @@ final class MissingTaggedEventException(
     val missing: Map[String, Set[Long]],
     val minOffset: UUID,
     val maxOffset: UUID)
-    extends RuntimeException(s"Unable to find tagged events for tag [$tag]: 
${missing}")
+    extends RuntimeException(s"Unable to find tagged events for tag [$tag]: 
$missing")
diff --git 
a/core/src/main/scala/org/apache/pekko/persistence/cassandra/snapshot/CassandraSnapshotStatements.scala
 
b/core/src/main/scala/org/apache/pekko/persistence/cassandra/snapshot/CassandraSnapshotStatements.scala
index 4685534..a597595 100644
--- 
a/core/src/main/scala/org/apache/pekko/persistence/cassandra/snapshot/CassandraSnapshotStatements.scala
+++ 
b/core/src/main/scala/org/apache/pekko/persistence/cassandra/snapshot/CassandraSnapshotStatements.scala
@@ -40,7 +40,7 @@ import pekko.persistence.cassandra.FutureDone
   // snapshot is for backwards compatibility and not used for new rows
   def createTable =
     s"""
-    |CREATE TABLE IF NOT EXISTS ${tableName} (
+    |CREATE TABLE IF NOT EXISTS $tableName (
     |  persistence_id text,
     |  sequence_nr bigint,
     |  timestamp bigint,
@@ -57,19 +57,19 @@ import pekko.persistence.cassandra.FutureDone
     """.stripMargin.trim
 
   def writeSnapshot(withMeta: Boolean): String = s"""
-      INSERT INTO ${tableName} (persistence_id, sequence_nr, timestamp, 
ser_manifest, ser_id, snapshot_data
+      INSERT INTO $tableName (persistence_id, sequence_nr, timestamp, 
ser_manifest, ser_id, snapshot_data
       ${if (withMeta) ", meta_ser_id, meta_ser_manifest, meta" else ""})
       VALUES (?, ?, ?, ?, ?, ? ${if (withMeta) ", ?, ?, ?" else ""})
     """
 
   def deleteSnapshot = s"""
-      DELETE FROM ${tableName} WHERE
+      DELETE FROM $tableName WHERE
         persistence_id = ? AND
         sequence_nr = ?
     """
 
   def deleteAllSnapshotForPersistenceIdAndSequenceNrBetween = s"""
-    DELETE FROM ${tableName}
+    DELETE FROM $tableName
     WHERE persistence_id = ?
     AND sequence_nr >= ?
     AND sequence_nr <= ?
@@ -77,34 +77,34 @@ import pekko.persistence.cassandra.FutureDone
 
   def deleteSnapshotsBefore =
     s"""
-        DELETE FROM ${tableName}
+        DELETE FROM $tableName
         WHERE persistence_id = ?
         AND sequence_nr < ?
        """
 
   def selectSnapshot = s"""
-      SELECT * FROM ${tableName} WHERE
+      SELECT * FROM $tableName WHERE
         persistence_id = ? AND
         sequence_nr = ?
     """
 
   def selectSnapshotMetadata(limit: Option[Int] = None) = s"""
-      SELECT persistence_id, sequence_nr, timestamp FROM ${tableName} WHERE
+      SELECT persistence_id, sequence_nr, timestamp FROM $tableName WHERE
         persistence_id = ? AND
         sequence_nr <= ? AND
         sequence_nr >= ?
-        ${limit.map(l => s"LIMIT ${l}").getOrElse("")}
+        ${limit.map(l => s"LIMIT $l").getOrElse("")}
     """
 
   def selectLatestSnapshotMeta =
-    s"""SELECT persistence_id, sequence_nr, timestamp FROM ${tableName} WHERE
+    s"""SELECT persistence_id, sequence_nr, timestamp FROM $tableName WHERE
     persistence_id = ? 
     ORDER BY sequence_nr DESC
     LIMIT ?
     """
 
   def selectAllSnapshotMeta =
-    s"""SELECT sequence_nr, timestamp FROM ${tableName} WHERE
+    s"""SELECT sequence_nr, timestamp FROM $tableName WHERE
     persistence_id = ? 
     ORDER BY sequence_nr DESC
     """
diff --git 
a/core/src/test/scala/org/apache/pekko/persistence/cassandra/CassandraSpec.scala
 
b/core/src/test/scala/org/apache/pekko/persistence/cassandra/CassandraSpec.scala
index faad7c6..94688df 100644
--- 
a/core/src/test/scala/org/apache/pekko/persistence/cassandra/CassandraSpec.scala
+++ 
b/core/src/test/scala/org/apache/pekko/persistence/cassandra/CassandraSpec.scala
@@ -185,7 +185,7 @@ abstract class CassandraSpec(
         if 
(system.settings.config.getBoolean("pekko.persistence.cassandra.events-by-tag.enabled"))
 {
           println("tag_views")
           cluster
-            .execute(s"select * from ${journalName}.tag_views")
+            .execute(s"select * from $journalName.tag_views")
             .asScala
             .foreach(row => {
               
println(s"""Row:${row.getString("tag_name")},${row.getLong("timebucket")},${formatOffset(
diff --git 
a/core/src/test/scala/org/apache/pekko/persistence/cassandra/EventsByTagMigrationSpec.scala
 
b/core/src/test/scala/org/apache/pekko/persistence/cassandra/EventsByTagMigrationSpec.scala
index 8a414bf..949014f 100644
--- 
a/core/src/test/scala/org/apache/pekko/persistence/cassandra/EventsByTagMigrationSpec.scala
+++ 
b/core/src/test/scala/org/apache/pekko/persistence/cassandra/EventsByTagMigrationSpec.scala
@@ -269,7 +269,7 @@ class EventsByTagMigrationSpec extends 
AbstractEventsByTagMigrationSpec {
     }
 
     "have a peek in the messages table" taggedAs RequiresCassandraThree in {
-      val row = cluster.execute(SimpleStatement.newInstance(s"select * from 
${messagesTableName} limit 1")).one()
+      val row = cluster.execute(SimpleStatement.newInstance(s"select * from 
$messagesTableName limit 1")).one()
       system.log.debug("New messages table looks like: {}", row)
       system.log.debug("{}", row.getColumnDefinitions)
     }
diff --git 
a/core/src/test/scala/org/apache/pekko/persistence/cassandra/EventsByTagRecoverySpec.scala
 
b/core/src/test/scala/org/apache/pekko/persistence/cassandra/EventsByTagRecoverySpec.scala
index c6cd346..9cce922 100644
--- 
a/core/src/test/scala/org/apache/pekko/persistence/cassandra/EventsByTagRecoverySpec.scala
+++ 
b/core/src/test/scala/org/apache/pekko/persistence/cassandra/EventsByTagRecoverySpec.scala
@@ -112,8 +112,8 @@ class EventsByTagRecoverySpec extends 
CassandraSpec(EventsByTagRecoverySpec.conf
 
         Thread.sleep(500)
         systemTwo.terminate().futureValue
-        cluster.execute(s"truncate ${journalName}.tag_views")
-        cluster.execute(s"truncate ${journalName}.tag_write_progress")
+        cluster.execute(s"truncate $journalName.tag_views")
+        cluster.execute(s"truncate $journalName.tag_write_progress")
 
         val tProbe = TestProbe()(system)
         val p2take2 = system.actorOf(TestTaggingActor.props("p2", Set("red", 
"orange")))
@@ -158,8 +158,8 @@ class EventsByTagRecoverySpec extends 
CassandraSpec(EventsByTagRecoverySpec.conf
         Thread.sleep(500)
 
         systemTwo.terminate().futureValue
-        cluster.execute(s"truncate ${journalName}.tag_views")
-        cluster.execute(s"truncate ${journalName}.tag_write_progress")
+        cluster.execute(s"truncate $journalName.tag_views")
+        cluster.execute(s"truncate $journalName.tag_write_progress")
 
         val tProbe = TestProbe()(system)
         val p3take2 = system.actorOf(TestTaggingActor.props("p3", Set("red", 
"orange")))
diff --git a/project/CopyrightHeader.scala b/project/CopyrightHeader.scala
index 54270e9..965a433 100644
--- a/project/CopyrightHeader.scala
+++ b/project/CopyrightHeader.scala
@@ -66,7 +66,7 @@ trait CopyrightHeader extends AutoPlugin {
         case Some(existedText) if 
isOnlyLightbendCopyrightAnnotated(existedText) =>
           HeaderCommentStyle.cStyleBlockComment.commentCreator(text, 
existingText) + NewLine * 2 + existedText
         case Some(existedText) =>
-          throw new IllegalStateException(s"Unable to detect Copyright for 
header:[${existedText}]")
+          throw new IllegalStateException(s"Unable to detect Copyright for 
header:[$existedText]")
         case None =>
           HeaderCommentStyle.cStyleBlockComment.commentCreator(text, 
existingText)
       }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to