From b58b35366e6a02a0a01f476500484676dc1109c8 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 15 Feb 2023 11:19:38 +0100 Subject: [PATCH] pekko naming (#9) --- .github/workflows/mysql-tests.yml | 4 +- .github/workflows/oracle-tests.yml | 4 +- .github/workflows/postgres-tests.yml | 4 +- .github/workflows/sqlserver-tests.yml | 4 +- README.md | 4 +- build.sbt | 51 ++++++----- .../integration/AllPersistenceIdsTest.scala | 4 +- .../CurrentEventsByPersistenceIdTest.scala | 4 +- .../integration/CurrentEventsByTagTest.scala | 4 +- .../CurrentPersistenceIdsTest.scala | 4 +- .../jdbc/integration/EventAdapterTest.scala | 10 ++- .../EventsByPersistenceIdTest.scala | 4 +- .../jdbc/integration/EventsByTagTest.scala | 10 ++- .../integration/HardDeleteQueryTest.scala | 4 +- .../integration/JdbcJournalPerfSpec.scala | 12 +-- .../jdbc/integration/JdbcJournalSpec.scala | 6 +- .../integration/JdbcSnapshotStoreSpec.scala | 12 +-- .../JournalDaoStreamMessagesMemoryTest.scala | 4 +- .../JournalSequenceActorTest.scala | 4 +- .../PostgresDurableStateStorePluginSpec.scala | 4 +- ...calaJdbcDurableStateChangesByTagTest.scala | 8 +- .../StoreOnlySerializableMessagesTest.scala | 12 +-- core/src/main/resources/reference.conf | 84 +++++++++---------- .../jdbc/util/PluginVersionChecker.scala | 22 ----- .../pekko}/persistence/jdbc/JournalRow.scala | 2 +- .../jdbc/PekkoSerialization.scala} | 22 ++--- .../jdbc/config/AkkaPersistenceConfig.scala | 4 +- .../persistence/jdbc/db/SlickDatabase.scala | 6 +- .../persistence/jdbc/db/SlickExtension.scala | 18 ++-- .../jdbc/journal/JdbcAsyncWriteJournal.scala | 28 +++---- .../jdbc/journal/dao/BaseDao.scala | 8 +- .../dao/BaseJournalDaoWithReadMessages.scala | 16 ++-- .../jdbc/journal/dao/DefaultJournalDao.scala | 42 +++++----- .../jdbc/journal/dao/FlowControl.scala | 2 +- .../jdbc/journal/dao/H2Compat.scala | 2 +- .../jdbc/journal/dao/JournalDao.scala | 6 +- .../dao/JournalDaoWithReadMessages.scala | 10 +-- .../journal/dao/JournalDaoWithUpdates.scala | 4 +- .../jdbc/journal/dao/JournalQueries.scala | 8 +- .../jdbc/journal/dao/JournalTables.scala | 14 ++-- .../dao/legacy/ByteArrayJournalDao.scala | 29 ++++--- .../legacy/ByteArrayJournalSerializer.scala | 8 +- .../journal/dao/legacy/JournalQueries.scala | 4 +- .../journal/dao/legacy/JournalTables.scala | 4 +- .../jdbc/journal/dao/legacy/package.scala | 2 +- .../jdbc/query/JdbcReadJournalProvider.scala | 6 +- .../jdbc/query/JournalSequenceActor.scala | 14 ++-- .../query/dao/DefaultReadJournalDao.scala | 22 ++--- .../jdbc/query/dao/ReadJournalDao.scala | 10 +-- .../jdbc/query/dao/ReadJournalQueries.scala | 10 ++- .../dao/legacy/ByteArrayReadJournalDao.scala | 26 +++--- .../query/dao/legacy/ReadJournalQueries.scala | 6 +- .../jdbc/query/javadsl/JdbcReadJournal.scala | 18 ++-- .../persistence/jdbc/query/package.scala | 6 +- .../jdbc/query/scaladsl/JdbcReadJournal.scala | 46 +++++----- .../PersistentReprSerializer.scala | 14 ++-- .../serialization/SnapshotSerializer.scala | 4 +- .../jdbc/snapshot/JdbcSnapshotStore.scala | 18 ++-- .../snapshot/dao/DefaultSnapshotDao.scala | 18 ++-- .../jdbc/snapshot/dao/SnapshotDao.scala | 4 +- .../jdbc/snapshot/dao/SnapshotQueries.scala | 6 +- .../jdbc/snapshot/dao/SnapshotTables.scala | 10 +-- .../dao/legacy/ByteArraySnapshotDao.scala | 16 ++-- .../legacy/ByteArraySnapshotSerializer.scala | 12 +-- .../snapshot/dao/legacy/SnapshotQueries.scala | 6 +- .../snapshot/dao/legacy/SnapshotTables.scala | 8 +- .../jdbc/state/DurableStateQueries.scala | 8 +- .../jdbc/state/DurableStateTables.scala | 10 +-- .../state/JdbcDurableStateStoreProvider.scala | 18 ++-- .../persistence/jdbc/state/OffsetOps.scala | 6 +- .../jdbc/state/SequenceNextValUpdater.scala | 6 +- .../state/javadsl/JdbcDurableStateStore.scala | 27 +++--- .../scaladsl/DurableStateSequenceActor.scala | 18 ++-- .../scaladsl/JdbcDurableStateStore.scala | 49 ++++++----- .../jdbc/testkit/internal/SchemaType.scala | 4 +- .../testkit/internal/SchemaUtilsImpl.scala | 16 ++-- .../jdbc/testkit/javadsl/SchemaUtils.scala | 44 +++++----- .../jdbc/testkit/scaladsl/SchemaUtils.scala | 44 +++++----- .../persistence/jdbc/util/BlockingOps.scala | 2 +- .../persistence/jdbc/util/ByteArrayOps.scala | 2 +- .../persistence/jdbc/util/ConfigOps.scala | 2 +- .../jdbc/util/InputStreamOps.scala | 2 +- .../jdbc/util/PluginVersionChecker.scala | 22 +++++ .../persistence/jdbc/util/StringOps.scala | 2 +- .../pekko}/persistence/jdbc/util/TrySeq.scala | 2 +- .../persistence/jdbc/JavadslSnippets.java | 36 ++++---- .../jdbc/state/JavadslSnippets.java | 54 ++++++------ core/src/test/resources/general.conf | 20 ++--- core/src/test/resources/h2-application.conf | 10 +-- .../resources/h2-shared-db-application.conf | 8 +- core/src/test/resources/jndi-application.conf | 8 +- .../resources/jndi-shared-db-application.conf | 8 +- core/src/test/resources/logback-test.xml | 8 +- .../src/test/resources/mysql-application.conf | 8 +- .../mysql-shared-db-application.conf | 10 +-- .../test/resources/oracle-application.conf | 8 +- .../oracle-shared-db-application.conf | 10 +-- .../test/resources/postgres-application.conf | 10 +-- .../postgres-shared-db-application.conf | 12 +-- .../test/resources/sqlserver-application.conf | 6 +- .../sqlserver-shared-db-application.conf | 10 +-- .../persistence/jdbc/ScaladslSnippets.scala | 27 +++--- .../jdbc/SharedActorSystemTestSpec.scala | 18 ++-- .../pekko}/persistence/jdbc/SimpleSpec.scala | 8 +- .../jdbc/SingleActorSystemPerTestSpec.scala | 20 ++--- .../persistence/jdbc/TablesTestSpec.scala | 28 +++---- .../jdbc/configuration/ConfigOpsTest.scala | 7 +- .../jdbc/configuration/JNDIConfigTest.scala | 8 +- .../PekkoPersistenceConfigTest.scala} | 42 +++++----- .../jdbc/journal/JdbcJournalPerfSpec.scala | 22 ++--- .../jdbc/journal/JdbcJournalSpec.scala | 16 ++-- .../jdbc/journal/dao/TrySeqTest.scala | 6 +- .../ByteArrayJournalSerializerTest.scala | 4 +- .../dao/legacy}/JournalTablesTest.scala | 4 +- .../dao/legacy}/TagsSerializationTest.scala | 4 +- .../jdbc/query/AllPersistenceIdsTest.scala | 2 +- .../CurrentEventsByPersistenceIdTest.scala | 16 ++-- .../jdbc/query/CurrentEventsByTagTest.scala | 10 +-- .../query/CurrentPersistenceIdsTest.scala | 2 +- .../jdbc/query/EventAdapterTest.scala | 8 +- .../query/EventsByPersistenceIdTest.scala | 14 ++-- .../jdbc/query/EventsByTagTest.scala | 10 +-- .../jdbc/query/HardDeleteQueryTest.scala | 6 +- .../JournalDaoStreamMessagesMemoryTest.scala | 14 ++-- .../jdbc/query/JournalSequenceActorTest.scala | 26 +++--- .../jdbc/query/MultipleReadJournalTest.scala | 10 +-- .../jdbc/query/QueryTestSpec.scala | 72 ++++++++-------- .../jdbc/query/TaggingEventAdapter.scala | 6 +- .../query/dao/ReadJournalTablesTest.scala | 6 +- .../query/dao/TestProbeReadJournalDao.scala | 18 ++-- .../StoreOnlySerializableMessagesTest.scala | 26 +++--- .../jdbc/snapshot/JdbcSnapshotStoreSpec.scala | 16 ++-- .../dao/legacy/SnapshotTablesTest.scala | 4 +- .../persistence/jdbc/state/Payloads.scala | 4 +- .../jdbc/state/ScaladslSnippets.scala | 52 ++++++------ .../state/scaladsl/DataGenerationHelper.scala | 2 +- .../DurableStateSequenceActorTest.scala | 23 ++--- .../DurableStateStorePluginSpec.scala | 8 +- .../state/scaladsl/JdbcDurableStateSpec.scala | 32 +++---- .../jdbc/state/scaladsl/StateSpecBase.scala | 30 +++---- .../TestProbeDurableStateStoreQuery.scala | 24 +++--- .../jdbc/util/ClasspathResources.scala | 2 +- .../persistence/jdbc/util/DropCreate.scala | 8 +- doc/deadlock.md | 2 +- docs/src/main/paradox/configuration.md | 14 ++-- docs/src/main/paradox/custom-dao.md | 14 ++-- docs/src/main/paradox/durable-state-store.md | 24 +++--- docs/src/main/paradox/index.md | 4 +- docs/src/main/paradox/migration.md | 6 +- docs/src/main/paradox/overview.md | 26 +++--- docs/src/main/paradox/query.md | 18 ++-- docs/src/main/paradox/snapshots.md | 30 ++++--- .../integration/JournalMigratorTest.scala | 6 +- .../integration/SnapshotMigratorTest.scala | 6 +- .../jdbc/migrator/JournalMigrator.scala | 48 +++++------ .../jdbc/migrator/SnapshotMigrator.scala | 28 +++---- migrator/src/test/resources/general.conf | 12 +-- .../src/test/resources/h2-application.conf | 8 +- .../src/test/resources/mysql-application.conf | 8 +- .../test/resources/oracle-application.conf | 8 +- .../test/resources/postgres-application.conf | 8 +- .../test/resources/sqlserver-application.conf | 6 +- .../jdbc/migrator/JournalMigratorTest.scala | 10 +-- .../jdbc/migrator/MigratorSpec.scala | 50 +++++------ .../jdbc/migrator/SnapshotMigratorTest.scala | 10 +-- project/Dependencies.scala | 17 ++-- project/ProjectAutoPlugin.scala | 29 +++---- project/plugins.sbt | 13 ++- project/project-info.conf | 40 ++------- scripts/link-validator.conf | 12 +-- 170 files changed, 1231 insertions(+), 1203 deletions(-) rename core/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/integration/AllPersistenceIdsTest.scala (84%) rename core/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/integration/CurrentEventsByPersistenceIdTest.scala (89%) rename core/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/integration/CurrentEventsByTagTest.scala (88%) rename core/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/integration/CurrentPersistenceIdsTest.scala (88%) rename core/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/integration/EventAdapterTest.scala (69%) rename core/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/integration/EventsByPersistenceIdTest.scala (86%) rename core/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/integration/EventsByTagTest.scala (70%) rename core/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/integration/HardDeleteQueryTest.scala (83%) rename core/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/integration/JdbcJournalPerfSpec.scala (78%) rename core/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/integration/JdbcJournalSpec.scala (81%) rename core/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/integration/JdbcSnapshotStoreSpec.scala (57%) rename core/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/integration/JournalDaoStreamMessagesMemoryTest.scala (87%) rename core/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/integration/JournalSequenceActorTest.scala (86%) rename core/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/integration/PostgresDurableStateStorePluginSpec.scala (63%) rename core/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/integration/PostgresScalaJdbcDurableStateChangesByTagTest.scala (57%) rename core/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/integration/StoreOnlySerializableMessagesTest.scala (56%) delete mode 100644 core/src/main/scala/akka/persistence/jdbc/util/PluginVersionChecker.scala rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/JournalRow.scala (88%) rename core/src/main/scala/{akka/persistence/jdbc/AkkaSerialization.scala => org/apache/pekko/persistence/jdbc/PekkoSerialization.scala} (70%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/config/AkkaPersistenceConfig.scala (99%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/db/SlickDatabase.scala (95%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/db/SlickExtension.scala (78%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/JdbcAsyncWriteJournal.scala (84%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/dao/BaseDao.scala (86%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/dao/BaseJournalDaoWithReadMessages.scala (84%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/dao/DefaultJournalDao.scala (71%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/dao/FlowControl.scala (92%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/dao/H2Compat.scala (91%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/dao/JournalDao.scala (81%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/dao/JournalDaoWithReadMessages.scala (83%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/dao/JournalDaoWithUpdates.scala (88%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/dao/JournalQueries.scala (90%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/dao/JournalTables.scala (86%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/dao/legacy/ByteArrayJournalDao.scala (84%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/dao/legacy/ByteArrayJournalSerializer.scala (81%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/dao/legacy/JournalQueries.scala (96%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/dao/legacy/JournalTables.scala (91%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/dao/legacy/package.scala (92%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/query/JdbcReadJournalProvider.scala (75%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/query/JournalSequenceActor.scala (95%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/query/dao/DefaultReadJournalDao.scala (73%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/query/dao/ReadJournalDao.scala (82%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/query/dao/ReadJournalQueries.scala (90%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/query/dao/legacy/ByteArrayReadJournalDao.scala (86%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/query/dao/legacy/ReadJournalQueries.scala (89%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/query/javadsl/JdbcReadJournal.scala (88%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/query/package.scala (71%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/query/scaladsl/JdbcReadJournal.scala (89%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/serialization/PersistentReprSerializer.scala (80%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/serialization/SnapshotSerializer.scala (75%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/snapshot/JdbcSnapshotStore.scala (85%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/snapshot/dao/DefaultSnapshotDao.scala (90%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/snapshot/dao/SnapshotDao.scala (91%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/snapshot/dao/SnapshotQueries.scala (93%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/snapshot/dao/SnapshotTables.scala (87%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/snapshot/dao/legacy/ByteArraySnapshotDao.scala (89%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/snapshot/dao/legacy/ByteArraySnapshotSerializer.scala (69%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/snapshot/dao/legacy/SnapshotQueries.scala (93%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/snapshot/dao/legacy/SnapshotTables.scala (86%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/state/DurableStateQueries.scala (95%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/state/DurableStateTables.scala (87%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/state/JdbcDurableStateStoreProvider.scala (69%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/state/OffsetOps.scala (70%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/state/SequenceNextValUpdater.scala (90%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/state/javadsl/JdbcDurableStateStore.scala (63%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/state/scaladsl/DurableStateSequenceActor.scala (96%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/state/scaladsl/JdbcDurableStateStore.scala (81%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/testkit/internal/SchemaType.scala (86%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/testkit/internal/SchemaUtilsImpl.scala (92%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/testkit/javadsl/SchemaUtils.scala (67%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/testkit/scaladsl/SchemaUtils.scala (66%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/util/BlockingOps.scala (92%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/util/ByteArrayOps.scala (90%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/util/ConfigOps.scala (93%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/util/InputStreamOps.scala (95%) create mode 100644 core/src/main/scala/org/apache/pekko/persistence/jdbc/util/PluginVersionChecker.scala rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/util/StringOps.scala (87%) rename core/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/util/TrySeq.scala (93%) rename core/src/test/java/{akka => org/apache/pekko}/persistence/jdbc/JavadslSnippets.java (71%) rename core/src/test/java/{akka => org/apache/pekko}/persistence/jdbc/state/JavadslSnippets.java (71%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/ScaladslSnippets.scala (74%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/SharedActorSystemTestSpec.scala (75%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/SimpleSpec.scala (81%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/SingleActorSystemPerTestSpec.scala (77%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/TablesTestSpec.scala (91%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/configuration/ConfigOpsTest.scala (81%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/configuration/JNDIConfigTest.scala (89%) rename core/src/test/scala/{akka/persistence/jdbc/configuration/AkkaPersistenceConfigTest.scala => org/apache/pekko/persistence/jdbc/configuration/PekkoPersistenceConfigTest.scala} (90%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/JdbcJournalPerfSpec.scala (83%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/JdbcJournalSpec.scala (77%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/journal/dao/TrySeqTest.scala (91%) rename core/src/test/scala/{akka/persistence/jdbc/journal/dao => org/apache/pekko/persistence/jdbc/journal/dao/legacy}/ByteArrayJournalSerializerTest.scala (93%) rename core/src/test/scala/{akka/persistence/jdbc/journal/dao => org/apache/pekko/persistence/jdbc/journal/dao/legacy}/JournalTablesTest.scala (92%) rename core/src/test/scala/{akka/persistence/jdbc/journal/dao => org/apache/pekko/persistence/jdbc/journal/dao/legacy}/TagsSerializationTest.scala (90%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/query/AllPersistenceIdsTest.scala (97%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/query/CurrentEventsByPersistenceIdTest.scala (95%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/query/CurrentEventsByTagTest.scala (96%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/query/CurrentPersistenceIdsTest.scala (96%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/query/EventAdapterTest.scala (96%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/query/EventsByPersistenceIdTest.scala (96%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/query/EventsByTagTest.scala (98%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/query/HardDeleteQueryTest.scala (96%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/query/JournalDaoStreamMessagesMemoryTest.scala (91%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/query/JournalSequenceActorTest.scala (93%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/query/MultipleReadJournalTest.scala (75%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/query/QueryTestSpec.scala (82%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/query/TaggingEventAdapter.scala (75%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/query/dao/ReadJournalTablesTest.scala (88%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/query/dao/TestProbeReadJournalDao.scala (83%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/serialization/StoreOnlySerializableMessagesTest.scala (85%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/snapshot/JdbcSnapshotStoreSpec.scala (72%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/snapshot/dao/legacy/SnapshotTablesTest.scala (93%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/state/Payloads.scala (90%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/state/ScaladslSnippets.scala (64%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/state/scaladsl/DataGenerationHelper.scala (97%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/state/scaladsl/DurableStateSequenceActorTest.scala (95%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/state/scaladsl/DurableStateStorePluginSpec.scala (83%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/state/scaladsl/JdbcDurableStateSpec.scala (94%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/state/scaladsl/StateSpecBase.scala (76%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/state/scaladsl/TestProbeDurableStateStoreQuery.scala (71%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/util/ClasspathResources.scala (93%) rename core/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/util/DropCreate.scala (84%) rename migrator/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/migrator/integration/JournalMigratorTest.scala (69%) rename migrator/src/it/scala/{akka => org/apache/pekko}/persistence/jdbc/migrator/integration/SnapshotMigratorTest.scala (69%) rename migrator/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/migrator/JournalMigrator.scala (73%) rename migrator/src/main/scala/{akka => org/apache/pekko}/persistence/jdbc/migrator/SnapshotMigrator.scala (76%) rename migrator/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/migrator/JournalMigratorTest.scala (95%) rename migrator/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/migrator/MigratorSpec.scala (87%) rename migrator/src/test/scala/{akka => org/apache/pekko}/persistence/jdbc/migrator/SnapshotMigratorTest.scala (88%) diff --git a/.github/workflows/mysql-tests.yml b/.github/workflows/mysql-tests.yml index 1887a270..6890af20 100644 --- a/.github/workflows/mysql-tests.yml +++ b/.github/workflows/mysql-tests.yml @@ -17,7 +17,7 @@ jobs: matrix: include: - { name: "MySQL", extraOpts: '' } - - { name: "MySQL (old dao)", extraOpts: ' -Djdbc-journal.dao=akka.persistence.jdbc.journal.dao.legacy.ByteArrayJournalDao -Djdbc-snapshot-store.dao=akka.persistence.jdbc.snapshot.dao.legacy.ByteArraySnapshotDao -Djdbc-read-journal.dao=akka.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao' } + - { name: "MySQL (old dao)", extraOpts: ' -Djdbc-journal.dao=org.apache.pekko.persistence.jdbc.journal.dao.legacy.ByteArrayJournalDao -Djdbc-snapshot-store.dao=org.apache.pekko.persistence.jdbc.snapshot.dao.legacy.ByteArraySnapshotDao -Djdbc-read-journal.dao=org.apache.pekko.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao' } steps: - name: Checkout @@ -43,7 +43,7 @@ jobs: run: ./scripts/launch-mysql.sh - name: Run Integration tests for ${{ matrix.name }} - run: sbt "++2.13.8 It/testOnly akka.persistence.jdbc.integration.MySQL*" ${{ matrix.extraOpts }} -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler + run: sbt "++2.13.8 It/testOnly org.apache.pekko.persistence.jdbc.integration.MySQL*" ${{ matrix.extraOpts }} -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler - name: Print logs on failure if: ${{ failure() }} diff --git a/.github/workflows/oracle-tests.yml b/.github/workflows/oracle-tests.yml index 04caae1f..7f321f5e 100644 --- a/.github/workflows/oracle-tests.yml +++ b/.github/workflows/oracle-tests.yml @@ -17,7 +17,7 @@ jobs: matrix: include: - { name: "Oracle", extraOpts: '' } - - { name: "Oracle (old dao)", extraOpts: ' -Djdbc-journal.dao=akka.persistence.jdbc.journal.dao.legacy.ByteArrayJournalDao -Djdbc-snapshot-store.dao=akka.persistence.jdbc.snapshot.dao.legacy.ByteArraySnapshotDao -Djdbc-read-journal.dao=akka.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao' } + - { name: "Oracle (old dao)", extraOpts: ' -Djdbc-journal.dao=org.apache.pekko.persistence.jdbc.journal.dao.legacy.ByteArrayJournalDao -Djdbc-snapshot-store.dao=org.apache.pekko.persistence.jdbc.snapshot.dao.legacy.ByteArraySnapshotDao -Djdbc-read-journal.dao=org.apache.pekko.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao' } steps: - name: Checkout @@ -43,7 +43,7 @@ jobs: run: ./scripts/launch-oracle.sh - name: Run Integration tests for ${{ matrix.name }} - run: sbt "++2.13.8 It/testOnly akka.persistence.jdbc.integration.Oracle*" ${{ matrix.extraOpts }} -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler + run: sbt "++2.13.8 It/testOnly org.apache.pekko.persistence.jdbc.integration.Oracle*" ${{ matrix.extraOpts }} -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler - name: Print logs on failure if: ${{ failure() }} diff --git a/.github/workflows/postgres-tests.yml b/.github/workflows/postgres-tests.yml index 2871dd25..85124d2c 100644 --- a/.github/workflows/postgres-tests.yml +++ b/.github/workflows/postgres-tests.yml @@ -17,7 +17,7 @@ jobs: matrix: include: - { name: "Postgres", extraOpts: '' } - - { name: "Postgres (old dao)", extraOpts: ' -Djdbc-journal.dao=akka.persistence.jdbc.journal.dao.legacy.ByteArrayJournalDao -Djdbc-snapshot-store.dao=akka.persistence.jdbc.snapshot.dao.legacy.ByteArraySnapshotDao -Djdbc-read-journal.dao=akka.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao' } + - { name: "Postgres (old dao)", extraOpts: ' -Djdbc-journal.dao=org.apache.pekko.persistence.jdbc.journal.dao.legacy.ByteArrayJournalDao -Djdbc-snapshot-store.dao=org.apache.pekko.persistence.jdbc.snapshot.dao.legacy.ByteArraySnapshotDao -Djdbc-read-journal.dao=org.apache.pekko.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao' } steps: - name: Checkout @@ -43,7 +43,7 @@ jobs: run: ./scripts/launch-postgres.sh - name: Run Integration tests for ${{ matrix.name }} - run: sbt "++2.13.8 It/testOnly akka.persistence.jdbc.integration.Postgres*" ${{ matrix.extraOpts }} -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler + run: sbt "++2.13.8 It/testOnly org.apache.pekko.persistence.jdbc.integration.Postgres*" ${{ matrix.extraOpts }} -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler - name: Print logs on failure if: ${{ failure() }} diff --git a/.github/workflows/sqlserver-tests.yml b/.github/workflows/sqlserver-tests.yml index fad70319..e1c69182 100644 --- a/.github/workflows/sqlserver-tests.yml +++ b/.github/workflows/sqlserver-tests.yml @@ -17,7 +17,7 @@ jobs: matrix: include: - { name: "SqlServer", extraOpts: '' } - - { name: "SqlServer (old dao)", extraOpts: ' -Djdbc-journal.dao=akka.persistence.jdbc.journal.dao.legacy.ByteArrayJournalDao -Djdbc-snapshot-store.dao=akka.persistence.jdbc.snapshot.dao.legacy.ByteArraySnapshotDao -Djdbc-read-journal.dao=akka.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao' } + - { name: "SqlServer (old dao)", extraOpts: ' -Djdbc-journal.dao=org.apache.pekko.persistence.jdbc.journal.dao.legacy.ByteArrayJournalDao -Djdbc-snapshot-store.dao=org.apache.pekko.persistence.jdbc.snapshot.dao.legacy.ByteArraySnapshotDao -Djdbc-read-journal.dao=org.apache.pekko.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao' } steps: - name: Checkout @@ -43,7 +43,7 @@ jobs: run: ./scripts/launch-sqlserver.sh - name: Run Integration tests for ${{ matrix.name }} - run: sbt "++2.13.8 It/testOnly akka.persistence.jdbc.integration.SqlServer*" ${{ matrix.extraOpts }} -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler + run: sbt "++2.13.8 It/testOnly org.apache.pekko.persistence.jdbc.integration.SqlServer*" ${{ matrix.extraOpts }} -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler - name: Print logs on failure if: ${{ failure() }} diff --git a/README.md b/README.md index fc63be46..173089ad 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,7 @@ Please note that the H2 database is not recommended to be used as a production d ## Documentation -* [current Akka Persistence JDBC documentation](https://doc.akka.io/docs/akka-persistence-jdbc/current/) -* [Akka Persistence JDBC 3.5.x documentation](https://doc.akka.io/docs/akka-persistence-jdbc/3.5/) -* [Snapshot documentation](https://doc.akka.io/docs/akka-persistence-jdbc/snapshot/) +* [current Apache Pekko Persistence JDBC documentation](https://pekko.apache.org/docs/pekko-persistence-jdbc/current/) ## Release notes diff --git a/build.sbt b/build.sbt index c4718863..40e8a204 100644 --- a/build.sbt +++ b/build.sbt @@ -1,9 +1,10 @@ import com.lightbend.paradox.apidoc.ApidocPlugin.autoImport.apidocRootPackage +import org.apache.pekko.PekkoParadoxPlugin.autoImport._ +import sbt.Keys._ -// FIXME remove switching to final Akka version -ThisBuild / resolvers += "Akka Snapshots".at("https://oss.sonatype.org/content/repositories/snapshots/") +ThisBuild / resolvers += "Apache Nexus Snapshots".at("https://repository.apache.org/content/repositories/snapshots/") -lazy val `akka-persistence-jdbc` = project +lazy val `pekko-persistence-jdbc` = project .in(file(".")) .enablePlugins(ScalaUnidocPlugin) .disablePlugins(MimaPlugin, SitePlugin) @@ -19,7 +20,7 @@ lazy val core = project .settings(Defaults.itSettings) .settings(MetaInfLicenseNoticeCopy.settings) .settings( - name := "akka-persistence-jdbc", + name := "pekko-persistence-jdbc", libraryDependencies ++= Dependencies.Libraries, mimaReportSignatureProblems := true, // temporarily disable mima checks @@ -32,50 +33,58 @@ lazy val migrator = project .settings(Defaults.itSettings) .settings(MetaInfLicenseNoticeCopy.settings) .settings( - name := "akka-persistence-jdbc-migrator", + name := "pekko-persistence-jdbc-migrator", libraryDependencies ++= Dependencies.Migration ++ Dependencies.Libraries, // TODO remove this when ready to publish it publish / skip := true) .dependsOn(core % "compile->compile;test->test") +/* +val themeSettings = Seq( + // allow access to snapshots for pekko-sbt-paradox + resolvers += "Apache Nexus Snapshots".at("https://repository.apache.org/content/repositories/snapshots/"), + pekkoParadoxGithub := "https://github.com/apache/incubator-pekko-persistence-jdbc") + */ + lazy val docs = project - .enablePlugins(ProjectAutoPlugin, AkkaParadoxPlugin, ParadoxSitePlugin, PreprocessPlugin, PublishRsyncPlugin) + .enablePlugins(ProjectAutoPlugin, ParadoxPlugin, ParadoxSitePlugin, PreprocessPlugin, PublishRsyncPlugin) .disablePlugins(MimaPlugin) .settings(MetaInfLicenseNoticeCopy.settings) .settings( - name := "Akka Persistence JDBC", + name := "Apache Pekko Persistence JDBC", publish / skip := true, makeSite := makeSite.dependsOn(LocalRootProject / ScalaUnidoc / doc).value, previewPath := (Paradox / siteSubdirName).value, - Preprocess / siteSubdirName := s"api/akka-persistence-jdbc/${if (isSnapshot.value) "snapshot" + Preprocess / siteSubdirName := s"api/pekko-persistence-jdbc/${if (isSnapshot.value) "snapshot" else version.value}", Preprocess / sourceDirectory := (LocalRootProject / ScalaUnidoc / unidoc / target).value, - Paradox / siteSubdirName := s"docs/akka-persistence-jdbc/${if (isSnapshot.value) "snapshot" else version.value}", + Paradox / siteSubdirName := s"docs/pekko-persistence-jdbc/${if (isSnapshot.value) "snapshot" else version.value}", Compile / paradoxProperties ++= Map( - "project.url" -> "https://doc.akka.io/docs/akka-persistence-jdbc/current/", - "github.base_url" -> "https://github.com/akka/akka-persistence-jdbc/", - "canonical.base_url" -> "https://doc.akka.io/docs/akka-persistence-jdbc/current", - "akka.version" -> Dependencies.AkkaVersion, + "project.url" -> "https://pekko.apache.org/docs/pekko-persistence-jdbc/current/", + "github.base_url" -> "https://github.com/apache/incubator-pekko-persistence-jdbc/", + "canonical.base_url" -> "https://pekko.apache.org/docs/pekko-persistence-jdbc/current", + "pekko.version" -> "current", "slick.version" -> Dependencies.SlickVersion, - "extref.github.base_url" -> s"https://github.com/akka/akka-persistence-jdbc/blob/${if (isSnapshot.value) "master" + "extref.github.base_url" -> s"https://github.com/apache/incubator-pekko-persistence-jdbc/blob/${if (isSnapshot.value) "master" else "v" + version.value}/%s", // Slick "extref.slick.base_url" -> s"https://scala-slick.org/doc/${Dependencies.SlickVersion}/%s", - // Akka - "extref.akka.base_url" -> s"https://doc.akka.io/docs/akka/${Dependencies.AkkaBinaryVersion}/%s", - "scaladoc.akka.base_url" -> s"https://doc.akka.io/api/akka/${Dependencies.AkkaBinaryVersion}/", - "javadoc.akka.base_url" -> s"https://doc.akka.io/japi/akka/${Dependencies.AkkaBinaryVersion}/", - "javadoc.akka.link_style" -> "direct", + // Pekko + "extref.pekko.base_url" -> "https://pekko.apache.org/docs/pekko/current/%s", + "scaladoc.base_url" -> "https://pekko.apache.org/api/pekko-persistence-jdbc/current/", + "scaladoc.pekko.base_url" -> "https://pekko.apache.org/api/pekko/current/", + "javadoc.pekko.base_url" -> "https://pekko.apache.org/japi/pekko/current/", + "javadoc.pekko.link_style" -> "direct", // Java "javadoc.base_url" -> "https://docs.oracle.com/javase/8/docs/api/", // Scala "scaladoc.scala.base_url" -> s"https://www.scala-lang.org/api/${scalaBinaryVersion.value}.x/", - "scaladoc.akka.persistence.jdbc.base_url" -> s"/${(Preprocess / siteSubdirName).value}/"), + "scaladoc.pekko.persistence.jdbc.base_url" -> s"/${(Preprocess / siteSubdirName).value}/"), paradoxGroups := Map("Language" -> Seq("Java", "Scala")), resolvers += Resolver.jcenterRepo, publishRsyncArtifacts += makeSite.value -> "www/", publishRsyncHost := "akkarepo@gustav.akka.io", - apidocRootPackage := "akka") + apidocRootPackage := "org.apache.pekko") Global / onLoad := (Global / onLoad).value.andThen { s => val v = version.value diff --git a/core/src/it/scala/akka/persistence/jdbc/integration/AllPersistenceIdsTest.scala b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/AllPersistenceIdsTest.scala similarity index 84% rename from core/src/it/scala/akka/persistence/jdbc/integration/AllPersistenceIdsTest.scala rename to core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/AllPersistenceIdsTest.scala index 658e51d7..c9a14d68 100644 --- a/core/src/it/scala/akka/persistence/jdbc/integration/AllPersistenceIdsTest.scala +++ b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/AllPersistenceIdsTest.scala @@ -1,6 +1,6 @@ -package akka.persistence.jdbc.integration +package org.apache.pekko.persistence.jdbc.integration -import akka.persistence.jdbc.query.{ +import org.apache.pekko.persistence.jdbc.query.{ AllPersistenceIdsTest, MysqlCleaner, OracleCleaner, diff --git a/core/src/it/scala/akka/persistence/jdbc/integration/CurrentEventsByPersistenceIdTest.scala b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/CurrentEventsByPersistenceIdTest.scala similarity index 89% rename from core/src/it/scala/akka/persistence/jdbc/integration/CurrentEventsByPersistenceIdTest.scala rename to core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/CurrentEventsByPersistenceIdTest.scala index 5ec02791..73cf0274 100644 --- a/core/src/it/scala/akka/persistence/jdbc/integration/CurrentEventsByPersistenceIdTest.scala +++ b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/CurrentEventsByPersistenceIdTest.scala @@ -1,6 +1,6 @@ -package akka.persistence.jdbc.integration +package org.apache.pekko.persistence.jdbc.integration -import akka.persistence.jdbc.query.{ +import org.apache.pekko.persistence.jdbc.query.{ CurrentEventsByPersistenceIdTest, MysqlCleaner, OracleCleaner, diff --git a/core/src/it/scala/akka/persistence/jdbc/integration/CurrentEventsByTagTest.scala b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/CurrentEventsByTagTest.scala similarity index 88% rename from core/src/it/scala/akka/persistence/jdbc/integration/CurrentEventsByTagTest.scala rename to core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/CurrentEventsByTagTest.scala index d0d269a7..0b483d2f 100644 --- a/core/src/it/scala/akka/persistence/jdbc/integration/CurrentEventsByTagTest.scala +++ b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/CurrentEventsByTagTest.scala @@ -1,6 +1,6 @@ -package akka.persistence.jdbc.integration +package org.apache.pekko.persistence.jdbc.integration -import akka.persistence.jdbc.query.{ +import org.apache.pekko.persistence.jdbc.query.{ CurrentEventsByTagTest, MysqlCleaner, OracleCleaner, diff --git a/core/src/it/scala/akka/persistence/jdbc/integration/CurrentPersistenceIdsTest.scala b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/CurrentPersistenceIdsTest.scala similarity index 88% rename from core/src/it/scala/akka/persistence/jdbc/integration/CurrentPersistenceIdsTest.scala rename to core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/CurrentPersistenceIdsTest.scala index 156e672d..2ed60593 100644 --- a/core/src/it/scala/akka/persistence/jdbc/integration/CurrentPersistenceIdsTest.scala +++ b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/CurrentPersistenceIdsTest.scala @@ -1,6 +1,6 @@ -package akka.persistence.jdbc.integration +package org.apache.pekko.persistence.jdbc.integration -import akka.persistence.jdbc.query.{ +import org.apache.pekko.persistence.jdbc.query.{ CurrentPersistenceIdsTest, MysqlCleaner, OracleCleaner, diff --git a/core/src/it/scala/akka/persistence/jdbc/integration/EventAdapterTest.scala b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/EventAdapterTest.scala similarity index 69% rename from core/src/it/scala/akka/persistence/jdbc/integration/EventAdapterTest.scala rename to core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/EventAdapterTest.scala index 4366e979..c1a05106 100644 --- a/core/src/it/scala/akka/persistence/jdbc/integration/EventAdapterTest.scala +++ b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/EventAdapterTest.scala @@ -1,6 +1,12 @@ -package akka.persistence.jdbc.integration +package org.apache.pekko.persistence.jdbc.integration -import akka.persistence.jdbc.query.{ EventAdapterTest, MysqlCleaner, OracleCleaner, PostgresCleaner, SqlServerCleaner } +import org.apache.pekko.persistence.jdbc.query.{ + EventAdapterTest, + MysqlCleaner, + OracleCleaner, + PostgresCleaner, + SqlServerCleaner +} class PostgresScalaEventAdapterTest extends EventAdapterTest("postgres-application.conf") with PostgresCleaner diff --git a/core/src/it/scala/akka/persistence/jdbc/integration/EventsByPersistenceIdTest.scala b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/EventsByPersistenceIdTest.scala similarity index 86% rename from core/src/it/scala/akka/persistence/jdbc/integration/EventsByPersistenceIdTest.scala rename to core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/EventsByPersistenceIdTest.scala index 48794294..aef3142e 100644 --- a/core/src/it/scala/akka/persistence/jdbc/integration/EventsByPersistenceIdTest.scala +++ b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/EventsByPersistenceIdTest.scala @@ -1,6 +1,6 @@ -package akka.persistence.jdbc.integration +package org.apache.pekko.persistence.jdbc.integration -import akka.persistence.jdbc.query.{ +import org.apache.pekko.persistence.jdbc.query.{ EventsByPersistenceIdTest, MysqlCleaner, OracleCleaner, diff --git a/core/src/it/scala/akka/persistence/jdbc/integration/EventsByTagTest.scala b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/EventsByTagTest.scala similarity index 70% rename from core/src/it/scala/akka/persistence/jdbc/integration/EventsByTagTest.scala rename to core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/EventsByTagTest.scala index f394869b..44cd1503 100644 --- a/core/src/it/scala/akka/persistence/jdbc/integration/EventsByTagTest.scala +++ b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/EventsByTagTest.scala @@ -1,6 +1,12 @@ -package akka.persistence.jdbc.integration +package org.apache.pekko.persistence.jdbc.integration -import akka.persistence.jdbc.query.{ EventsByTagTest, MysqlCleaner, OracleCleaner, PostgresCleaner, SqlServerCleaner } +import org.apache.pekko.persistence.jdbc.query.{ + EventsByTagTest, + MysqlCleaner, + OracleCleaner, + PostgresCleaner, + SqlServerCleaner +} class PostgresScalaEventsByTagTest extends EventsByTagTest("postgres-application.conf") with PostgresCleaner diff --git a/core/src/it/scala/akka/persistence/jdbc/integration/HardDeleteQueryTest.scala b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/HardDeleteQueryTest.scala similarity index 83% rename from core/src/it/scala/akka/persistence/jdbc/integration/HardDeleteQueryTest.scala rename to core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/HardDeleteQueryTest.scala index 4fa2f99a..5635a2ac 100644 --- a/core/src/it/scala/akka/persistence/jdbc/integration/HardDeleteQueryTest.scala +++ b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/HardDeleteQueryTest.scala @@ -1,6 +1,6 @@ -package akka.persistence.jdbc.integration +package org.apache.pekko.persistence.jdbc.integration -import akka.persistence.jdbc.query.{ +import org.apache.pekko.persistence.jdbc.query.{ HardDeleteQueryTest, MysqlCleaner, OracleCleaner, diff --git a/core/src/it/scala/akka/persistence/jdbc/integration/JdbcJournalPerfSpec.scala b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/JdbcJournalPerfSpec.scala similarity index 78% rename from core/src/it/scala/akka/persistence/jdbc/integration/JdbcJournalPerfSpec.scala rename to core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/JdbcJournalPerfSpec.scala index e1e9d5fa..36a61665 100644 --- a/core/src/it/scala/akka/persistence/jdbc/integration/JdbcJournalPerfSpec.scala +++ b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/JdbcJournalPerfSpec.scala @@ -1,10 +1,10 @@ -package akka.persistence.jdbc.integration +package org.apache.pekko.persistence.jdbc.integration -import akka.persistence.jdbc.journal.JdbcJournalPerfSpec -import akka.persistence.jdbc.testkit.internal.MySQL -import akka.persistence.jdbc.testkit.internal.Oracle -import akka.persistence.jdbc.testkit.internal.Postgres -import akka.persistence.jdbc.testkit.internal.SqlServer +import org.apache.pekko.persistence.jdbc.journal.JdbcJournalPerfSpec +import org.apache.pekko.persistence.jdbc.testkit.internal.MySQL +import org.apache.pekko.persistence.jdbc.testkit.internal.Oracle +import org.apache.pekko.persistence.jdbc.testkit.internal.Postgres +import org.apache.pekko.persistence.jdbc.testkit.internal.SqlServer import com.typesafe.config.ConfigFactory import com.typesafe.config.ConfigValueFactory diff --git a/core/src/it/scala/akka/persistence/jdbc/integration/JdbcJournalSpec.scala b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/JdbcJournalSpec.scala similarity index 81% rename from core/src/it/scala/akka/persistence/jdbc/integration/JdbcJournalSpec.scala rename to core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/JdbcJournalSpec.scala index 7a5fcfac..2588bd31 100644 --- a/core/src/it/scala/akka/persistence/jdbc/integration/JdbcJournalSpec.scala +++ b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/JdbcJournalSpec.scala @@ -1,7 +1,7 @@ -package akka.persistence.jdbc.integration +package org.apache.pekko.persistence.jdbc.integration -import akka.persistence.jdbc.journal.JdbcJournalSpec -import akka.persistence.jdbc.testkit.internal.{ MySQL, Oracle, Postgres, SqlServer } +import org.apache.pekko.persistence.jdbc.journal.JdbcJournalSpec +import org.apache.pekko.persistence.jdbc.testkit.internal.{ MySQL, Oracle, Postgres, SqlServer } import com.typesafe.config.ConfigFactory class PostgresJournalSpec extends JdbcJournalSpec(ConfigFactory.load("postgres-application.conf"), Postgres) diff --git a/core/src/it/scala/akka/persistence/jdbc/integration/JdbcSnapshotStoreSpec.scala b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/JdbcSnapshotStoreSpec.scala similarity index 57% rename from core/src/it/scala/akka/persistence/jdbc/integration/JdbcSnapshotStoreSpec.scala rename to core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/JdbcSnapshotStoreSpec.scala index 6e51688f..e9bcfe07 100644 --- a/core/src/it/scala/akka/persistence/jdbc/integration/JdbcSnapshotStoreSpec.scala +++ b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/JdbcSnapshotStoreSpec.scala @@ -1,10 +1,10 @@ -package akka.persistence.jdbc.integration +package org.apache.pekko.persistence.jdbc.integration -import akka.persistence.jdbc.snapshot.JdbcSnapshotStoreSpec -import akka.persistence.jdbc.testkit.internal.MySQL -import akka.persistence.jdbc.testkit.internal.Oracle -import akka.persistence.jdbc.testkit.internal.Postgres -import akka.persistence.jdbc.testkit.internal.SqlServer +import org.apache.pekko.persistence.jdbc.snapshot.JdbcSnapshotStoreSpec +import org.apache.pekko.persistence.jdbc.testkit.internal.MySQL +import org.apache.pekko.persistence.jdbc.testkit.internal.Oracle +import org.apache.pekko.persistence.jdbc.testkit.internal.Postgres +import org.apache.pekko.persistence.jdbc.testkit.internal.SqlServer import com.typesafe.config.ConfigFactory class PostgresSnapshotStoreSpec extends JdbcSnapshotStoreSpec(ConfigFactory.load("postgres-application.conf"), Postgres) diff --git a/core/src/it/scala/akka/persistence/jdbc/integration/JournalDaoStreamMessagesMemoryTest.scala b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/JournalDaoStreamMessagesMemoryTest.scala similarity index 87% rename from core/src/it/scala/akka/persistence/jdbc/integration/JournalDaoStreamMessagesMemoryTest.scala rename to core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/JournalDaoStreamMessagesMemoryTest.scala index ca387ab0..65eda378 100644 --- a/core/src/it/scala/akka/persistence/jdbc/integration/JournalDaoStreamMessagesMemoryTest.scala +++ b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/JournalDaoStreamMessagesMemoryTest.scala @@ -1,6 +1,6 @@ -package akka.persistence.jdbc.integration +package org.apache.pekko.persistence.jdbc.integration -import akka.persistence.jdbc.query.{ +import org.apache.pekko.persistence.jdbc.query.{ JournalDaoStreamMessagesMemoryTest, MysqlCleaner, OracleCleaner, diff --git a/core/src/it/scala/akka/persistence/jdbc/integration/JournalSequenceActorTest.scala b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/JournalSequenceActorTest.scala similarity index 86% rename from core/src/it/scala/akka/persistence/jdbc/integration/JournalSequenceActorTest.scala rename to core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/JournalSequenceActorTest.scala index a4d1f015..749d81bf 100644 --- a/core/src/it/scala/akka/persistence/jdbc/integration/JournalSequenceActorTest.scala +++ b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/JournalSequenceActorTest.scala @@ -1,6 +1,6 @@ -package akka.persistence.jdbc.integration +package org.apache.pekko.persistence.jdbc.integration -import akka.persistence.jdbc.query.{ +import org.apache.pekko.persistence.jdbc.query.{ JournalSequenceActorTest, MysqlCleaner, OracleCleaner, diff --git a/core/src/it/scala/akka/persistence/jdbc/integration/PostgresDurableStateStorePluginSpec.scala b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/PostgresDurableStateStorePluginSpec.scala similarity index 63% rename from core/src/it/scala/akka/persistence/jdbc/integration/PostgresDurableStateStorePluginSpec.scala rename to core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/PostgresDurableStateStorePluginSpec.scala index d4bcf1ed..ef8fedd7 100644 --- a/core/src/it/scala/akka/persistence/jdbc/integration/PostgresDurableStateStorePluginSpec.scala +++ b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/PostgresDurableStateStorePluginSpec.scala @@ -1,8 +1,8 @@ -package akka.persistence.jdbc.integration +package org.apache.pekko.persistence.jdbc.integration import com.typesafe.config.ConfigFactory import slick.jdbc.PostgresProfile -import akka.persistence.jdbc.state.scaladsl.DurableStateStorePluginSpec +import org.apache.pekko.persistence.jdbc.state.scaladsl.DurableStateStorePluginSpec class PostgresDurableStateStorePluginSpec extends DurableStateStorePluginSpec(ConfigFactory.load("postgres-shared-db-application.conf"), PostgresProfile) {} diff --git a/core/src/it/scala/akka/persistence/jdbc/integration/PostgresScalaJdbcDurableStateChangesByTagTest.scala b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/PostgresScalaJdbcDurableStateChangesByTagTest.scala similarity index 57% rename from core/src/it/scala/akka/persistence/jdbc/integration/PostgresScalaJdbcDurableStateChangesByTagTest.scala rename to core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/PostgresScalaJdbcDurableStateChangesByTagTest.scala index 51791695..19c0cb14 100644 --- a/core/src/it/scala/akka/persistence/jdbc/integration/PostgresScalaJdbcDurableStateChangesByTagTest.scala +++ b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/PostgresScalaJdbcDurableStateChangesByTagTest.scala @@ -1,9 +1,9 @@ -package akka.persistence.jdbc.integration +package org.apache.pekko.persistence.jdbc.integration import com.typesafe.config.ConfigFactory -import akka.actor.ActorSystem -import akka.persistence.jdbc.state.scaladsl.JdbcDurableStateSpec -import akka.persistence.jdbc.testkit.internal.Postgres +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.persistence.jdbc.state.scaladsl.JdbcDurableStateSpec +import org.apache.pekko.persistence.jdbc.testkit.internal.Postgres class PostgresScalaJdbcDurableStateStoreQueryTest extends JdbcDurableStateSpec(ConfigFactory.load("postgres-shared-db-application.conf"), Postgres) { diff --git a/core/src/it/scala/akka/persistence/jdbc/integration/StoreOnlySerializableMessagesTest.scala b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/StoreOnlySerializableMessagesTest.scala similarity index 56% rename from core/src/it/scala/akka/persistence/jdbc/integration/StoreOnlySerializableMessagesTest.scala rename to core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/StoreOnlySerializableMessagesTest.scala index d1c1c3c6..205769ae 100644 --- a/core/src/it/scala/akka/persistence/jdbc/integration/StoreOnlySerializableMessagesTest.scala +++ b/core/src/it/scala/org/apache/pekko/persistence/jdbc/integration/StoreOnlySerializableMessagesTest.scala @@ -1,10 +1,10 @@ -package akka.persistence.jdbc.integration +package org.apache.pekko.persistence.jdbc.integration -import akka.persistence.jdbc.serialization.StoreOnlySerializableMessagesTest -import akka.persistence.jdbc.testkit.internal.MySQL -import akka.persistence.jdbc.testkit.internal.Oracle -import akka.persistence.jdbc.testkit.internal.Postgres -import akka.persistence.jdbc.testkit.internal.SqlServer +import org.apache.pekko.persistence.jdbc.serialization.StoreOnlySerializableMessagesTest +import org.apache.pekko.persistence.jdbc.testkit.internal.MySQL +import org.apache.pekko.persistence.jdbc.testkit.internal.Oracle +import org.apache.pekko.persistence.jdbc.testkit.internal.Postgres +import org.apache.pekko.persistence.jdbc.testkit.internal.SqlServer class PostgresStoreOnlySerializableMessagesTest extends StoreOnlySerializableMessagesTest("postgres-application.conf", Postgres) diff --git a/core/src/main/resources/reference.conf b/core/src/main/resources/reference.conf index c44858f4..30263936 100644 --- a/core/src/main/resources/reference.conf +++ b/core/src/main/resources/reference.conf @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -akka-persistence-jdbc { +pekko-persistence-jdbc { # The tag separator to use when tagging events with more than one tag. # This property affects jdbc-journal.tagSeparator and jdbc-read-journal.tagSeparator. tagSeparator = "," - database-provider-fqcn = "akka.persistence.jdbc.db.DefaultSlickDatabaseProvider" + database-provider-fqcn = "org.apache.pekko.persistence.jdbc.db.DefaultSlickDatabaseProvider" shared-databases { // Shared databases can be defined here. @@ -41,15 +41,15 @@ akka-persistence-jdbc { # The JDBC URL for the chosen database # (uncomment and set the property below to match your needs) - # url = "jdbc:postgresql://localhost:5432/akka-plugin" + # url = "jdbc:postgresql://localhost:5432/pekko-plugin" # The database username # (uncomment and set the property below to match your needs) - # user = "akka-plugin" + # user = "pekko-plugin" # The username's password # (uncomment and set the property below to match your needs) - # password = "akka-plugin" + # password = "pekko-plugin" # The JDBC driver to use # (uncomment and set the property below to match your needs) @@ -101,9 +101,9 @@ akka-persistence-jdbc { } } -# the akka-persistence-journal in use +# the pekko-persistence-journal in use jdbc-journal { - class = "akka.persistence.jdbc.journal.JdbcAsyncWriteJournal" + class = "org.apache.pekko.persistence.jdbc.journal.JdbcAsyncWriteJournal" tables { @@ -155,18 +155,18 @@ jdbc-journal { } # Otherwise it would be a pinned dispatcher, see https://github.com/akka/akka/issues/31058 - plugin-dispatcher = "akka.actor.default-dispatcher" + plugin-dispatcher = "pekko.actor.default-dispatcher" } # The tag separator to use when tagging events with more than one tag. - # should not be configured directly, but through property akka-persistence-jdbc.tagSeparator + # should not be configured directly, but through property pekko-persistence-jdbc.tagSeparator # in order to keep consistent behavior over write/read sides # Only used for the legacy schema - tagSeparator = ${akka-persistence-jdbc.tagSeparator} + tagSeparator = ${pekko-persistence-jdbc.tagSeparator} - # If you have data from pre 5.0.0 use the legacy akka.persistence.jdbc.journal.dao.legacy.ByteArrayJournalDao + # If you have data from pre 5.0.0 use the legacy pekko.persistence.jdbc.journal.dao.legacy.ByteArrayJournalDao # Dao. Migration to the new dao will be added in the future. - dao = "akka.persistence.jdbc.journal.dao.DefaultJournalDao" + dao = "org.apache.pekko.persistence.jdbc.journal.dao.DefaultJournalDao" # The size of the buffer used when queueing up events for batch writing. This number must be bigger then the number # of events that may be written concurrently. In other words this number must be bigger than the number of persistent @@ -183,8 +183,8 @@ jdbc-journal { # To disable usage of a shared database, set to null or an empty string. # When set to a non empty string, this setting does two things: # - The actor which manages the write-journal will not automatically close the db when the actor stops (since it is shared) - # - If akka-persistence-jdbc.database-provider-fqcn is set to akka.persistence.jdbc.db.DefaultSlickDatabaseProvider - # then the shared database with the given name will be used. (shared databases are configured as part of akka-persistence-jdbc.shared-databases) + # - If pekko-persistence-jdbc.database-provider-fqcn is set to pekko.persistence.jdbc.db.DefaultSlickDatabaseProvider + # then the shared database with the given name will be used. (shared databases are configured as part of pekko-persistence-jdbc.shared-databases) # Please note that the database will only be shared with the other journals if the use-shared-db is also set # to the same value for these other journals. use-shared-db = null @@ -206,15 +206,15 @@ jdbc-journal { # The JDBC URL for the chosen database # (uncomment and set the property below to match your needs) - # url = "jdbc:postgresql://localhost:5432/akka-plugin" + # url = "jdbc:postgresql://localhost:5432/pekko-plugin" # The database username # (uncomment and set the property below to match your needs) - # user = "akka-plugin" + # user = "pekko-plugin" # The username's password # (uncomment and set the property below to match your needs) - # password = "akka-plugin" + # password = "pekko-plugin" # The JDBC driver to use # (uncomment and set the property below to match your needs) @@ -265,9 +265,9 @@ jdbc-journal { } } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { - class = "akka.persistence.jdbc.snapshot.JdbcSnapshotStore" + class = "org.apache.pekko.persistence.jdbc.snapshot.JdbcSnapshotStore" tables { legacy_snapshot { @@ -300,20 +300,20 @@ jdbc-snapshot-store { } # Otherwise it would be a pinned dispatcher, see https://github.com/akka/akka/issues/31058 - plugin-dispatcher = "akka.actor.default-dispatcher" + plugin-dispatcher = "pekko.actor.default-dispatcher" } # This setting can be used to configure usage of a shared database. # To disable usage of a shared database, set to null or an empty string. # When set to a non empty string, this setting does two things: # - The actor which manages the snapshot-journal will not automatically close the db when the actor stops (since it is shared) - # - If akka-persistence-jdbc.database-provider-fqcn is set to akka.persistence.jdbc.db.DefaultSlickDatabaseProvider - # then the shared database with the given name will be used. (shared databases are configured as part of akka-persistence-jdbc.shared-databases) + # - If pekko-persistence-jdbc.database-provider-fqcn is set to pekko.persistence.jdbc.db.DefaultSlickDatabaseProvider + # then the shared database with the given name will be used. (shared databases are configured as part of pekko-persistence-jdbc.shared-databases) # Please note that the database will only be shared with the other journals if the use-shared-db is also set # to the same value for these other journals. use-shared-db = null - dao = "akka.persistence.jdbc.snapshot.dao.DefaultSnapshotDao" + dao = "org.apache.pekko.persistence.jdbc.snapshot.dao.DefaultSnapshotDao" slick { @@ -332,15 +332,15 @@ jdbc-snapshot-store { # The JDBC URL for the chosen database # (uncomment and set the property below to match your needs) - # url = "jdbc:postgresql://localhost:5432/akka-plugin" + # url = "jdbc:postgresql://localhost:5432/pekko-plugin" # The database username # (uncomment and set the property below to match your needs) - # user = "akka-plugin" + # user = "pekko-plugin" # The username's password # (uncomment and set the property below to match your needs) - # password = "akka-plugin" + # password = "pekko-plugin" # The JDBC driver to use # (uncomment and set the property below to match your needs) @@ -391,9 +391,9 @@ jdbc-snapshot-store { } } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { - class = "akka.persistence.jdbc.query.JdbcReadJournalProvider" + class = "org.apache.pekko.persistence.jdbc.query.JdbcReadJournalProvider" # Absolute path to the write journal plugin configuration section. # Read journal uses event adapters from the write plugin @@ -412,14 +412,14 @@ jdbc-read-journal { # This setting can be used to configure usage of a shared database. # To disable usage of a shared database, set to null or an empty string. - # This setting only has effect if akka-persistence-jdbc.database-provider-fqcn is set to - # akka.persistence.jdbc.db.DefaultSlickDatabaseProvider. When this setting is set to a non empty string - # then the shared database with the given name will be used. (shared databases are configured as part of akka-persistence-jdbc.shared-databases) + # This setting only has effect if pekko-persistence-jdbc.database-provider-fqcn is set to + # pekko.persistence.jdbc.db.DefaultSlickDatabaseProvider. When this setting is set to a non empty string + # then the shared database with the given name will be used. (shared databases are configured as part of pekko-persistence-jdbc.shared-databases) # Please note that the database will only be shared with the other journals if the use-shared-db is also set # to the same value for these other journals. use-shared-db = null - dao = "akka.persistence.jdbc.query.dao.DefaultReadJournalDao" + dao = "org.apache.pekko.persistence.jdbc.query.dao.DefaultReadJournalDao" # Settings for determining if ids (ordering column) in the journal are out of sequence. journal-sequence-retrieval { @@ -446,9 +446,9 @@ jdbc-read-journal { } # The tag separator to use when tagging events with more than one tag. - # should not be configured directly, but through property akka-persistence-jdbc.tagSeparator + # should not be configured directly, but through property pekko-persistence-jdbc.tagSeparator # in order to keep consistent behavior over write/read sides - tagSeparator = ${akka-persistence-jdbc.tagSeparator} + tagSeparator = ${pekko-persistence-jdbc.tagSeparator} slick { @@ -467,15 +467,15 @@ jdbc-read-journal { # The JDBC URL for the chosen database # (uncomment and set the property below to match your needs) - # url = "jdbc:postgresql://localhost:5432/akka-plugin" + # url = "jdbc:postgresql://localhost:5432/pekko-plugin" # The database username # (uncomment and set the property below to match your needs) - # user = "akka-plugin" + # user = "pekko-plugin" # The username's password # (uncomment and set the property below to match your needs) - # password = "akka-plugin" + # password = "pekko-plugin" # The JDBC driver to use # (uncomment and set the property below to match your needs) @@ -526,9 +526,9 @@ jdbc-read-journal { } } -# the akka-persistence-durable-state-store in use +# the pekko-persistence-durable-state-store in use jdbc-durable-state-store { - class = "akka.persistence.jdbc.state.JdbcDurableStateStoreProvider" + class = "org.apache.pekko.persistence.jdbc.state.JdbcDurableStateStoreProvider" # number of records fetched from the store at once batchSize = 500 @@ -592,15 +592,15 @@ jdbc-durable-state-store { # The JDBC URL for the chosen database # (uncomment and set the property below to match your needs) - # url = "jdbc:postgresql://localhost:5432/akka-plugin" + # url = "jdbc:postgresql://localhost:5432/pekko-plugin" # The database username # (uncomment and set the property below to match your needs) - # user = "akka-plugin" + # user = "pekko-plugin" # The username's password # (uncomment and set the property below to match your needs) - # password = "akka-plugin" + # password = "pekko-plugin" # The JDBC driver to use # (uncomment and set the property below to match your needs) diff --git a/core/src/main/scala/akka/persistence/jdbc/util/PluginVersionChecker.scala b/core/src/main/scala/akka/persistence/jdbc/util/PluginVersionChecker.scala deleted file mode 100644 index 4c80c5b7..00000000 --- a/core/src/main/scala/akka/persistence/jdbc/util/PluginVersionChecker.scala +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2014 - 2019 Dennis Vriend - * Copyright (C) 2019 - 2021 Lightbend Inc. - */ - -package akka.persistence.jdbc.util - -import akka.annotation.InternalApi - -@InternalApi -private[jdbc] object PluginVersionChecker { - def check(): Unit = - try { - Class.forName("akka.persistence.jdbc.util.DefaultSlickDatabaseProvider") - throw new RuntimeException( - "Old version of Akka Persistence JDBC found on the classpath. Remove `com.github.dnvriend:akka-persistence-jdbc` from the classpath..") - } catch { - case _: ClassNotFoundException => - // All good! That's intentional. - // It's good if we don't have akka.persistence.jdbc.util.DefaultSlickDatabaseProvider around - } -} diff --git a/core/src/main/scala/akka/persistence/jdbc/JournalRow.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/JournalRow.scala similarity index 88% rename from core/src/main/scala/akka/persistence/jdbc/JournalRow.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/JournalRow.scala index 6de39108..33cc6d58 100644 --- a/core/src/main/scala/akka/persistence/jdbc/JournalRow.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/JournalRow.scala @@ -3,7 +3,7 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc +package org.apache.pekko.persistence.jdbc final case class JournalRow( ordering: Long, diff --git a/core/src/main/scala/akka/persistence/jdbc/AkkaSerialization.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/PekkoSerialization.scala similarity index 70% rename from core/src/main/scala/akka/persistence/jdbc/AkkaSerialization.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/PekkoSerialization.scala index c3270422..bd8476b8 100644 --- a/core/src/main/scala/akka/persistence/jdbc/AkkaSerialization.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/PekkoSerialization.scala @@ -3,13 +3,13 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc +package org.apache.pekko.persistence.jdbc -import akka.annotation.InternalApi -import akka.persistence.PersistentRepr -import akka.persistence.jdbc.state.DurableStateTables -import akka.persistence.jdbc.journal.dao.JournalTables.JournalAkkaSerializationRow -import akka.serialization.{ Serialization, Serializers } +import org.apache.pekko.annotation.InternalApi +import org.apache.pekko.persistence.PersistentRepr +import org.apache.pekko.persistence.jdbc.state.DurableStateTables +import org.apache.pekko.persistence.jdbc.journal.dao.JournalTables.JournalPekkoSerializationRow +import org.apache.pekko.serialization.{ Serialization, Serializers } import scala.util.{ Success, Try } @@ -17,19 +17,19 @@ import scala.util.{ Success, Try } * INTERNAL API */ @InternalApi -object AkkaSerialization { +object PekkoSerialization { - case class AkkaSerialized(serId: Int, serManifest: String, payload: Array[Byte]) + case class PekkoSerialized(serId: Int, serManifest: String, payload: Array[Byte]) - def serialize(serialization: Serialization, payload: Any): Try[AkkaSerialized] = { + def serialize(serialization: Serialization, payload: Any): Try[PekkoSerialized] = { val p2 = payload.asInstanceOf[AnyRef] val serializer = serialization.findSerializerFor(p2) val serManifest = Serializers.manifestFor(serializer, p2) val serialized = serialization.serialize(p2) - serialized.map(payload => AkkaSerialized(serializer.identifier, serManifest, payload)) + serialized.map(payload => PekkoSerialized(serializer.identifier, serManifest, payload)) } - def fromRow(serialization: Serialization)(row: JournalAkkaSerializationRow): Try[(PersistentRepr, Long)] = { + def fromRow(serialization: Serialization)(row: JournalPekkoSerializationRow): Try[(PersistentRepr, Long)] = { serialization.deserialize(row.eventPayload, row.eventSerId, row.eventSerManifest).flatMap { payload => val metadata = for { mPayload <- row.metaPayload diff --git a/core/src/main/scala/akka/persistence/jdbc/config/AkkaPersistenceConfig.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/config/AkkaPersistenceConfig.scala similarity index 99% rename from core/src/main/scala/akka/persistence/jdbc/config/AkkaPersistenceConfig.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/config/AkkaPersistenceConfig.scala index 4613ae33..29cd43eb 100644 --- a/core/src/main/scala/akka/persistence/jdbc/config/AkkaPersistenceConfig.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/config/AkkaPersistenceConfig.scala @@ -3,9 +3,9 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.config +package org.apache.pekko.persistence.jdbc.config -import akka.persistence.jdbc.util.ConfigOps._ +import org.apache.pekko.persistence.jdbc.util.ConfigOps._ import com.typesafe.config.Config import scala.concurrent.duration._ diff --git a/core/src/main/scala/akka/persistence/jdbc/db/SlickDatabase.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/db/SlickDatabase.scala similarity index 95% rename from core/src/main/scala/akka/persistence/jdbc/db/SlickDatabase.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/db/SlickDatabase.scala index 00a9beae..533732ba 100644 --- a/core/src/main/scala/akka/persistence/jdbc/db/SlickDatabase.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/db/SlickDatabase.scala @@ -3,11 +3,11 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.db +package org.apache.pekko.persistence.jdbc.db -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import javax.naming.InitialContext -import akka.persistence.jdbc.config.SlickConfiguration +import org.apache.pekko.persistence.jdbc.config.SlickConfiguration import com.typesafe.config.Config import slick.basic.DatabaseConfig import slick.jdbc.JdbcProfile diff --git a/core/src/main/scala/akka/persistence/jdbc/db/SlickExtension.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/db/SlickExtension.scala similarity index 78% rename from core/src/main/scala/akka/persistence/jdbc/db/SlickExtension.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/db/SlickExtension.scala index 81272287..f2499ae2 100644 --- a/core/src/main/scala/akka/persistence/jdbc/db/SlickExtension.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/db/SlickExtension.scala @@ -3,11 +3,11 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.db +package org.apache.pekko.persistence.jdbc.db -import akka.actor.{ ActorSystem, ExtendedActorSystem, Extension, ExtensionId, ExtensionIdProvider } -import akka.persistence.jdbc.config.{ ConfigKeys, SlickConfiguration } -import akka.persistence.jdbc.util.ConfigOps._ +import org.apache.pekko.actor.{ ActorSystem, ExtendedActorSystem, Extension, ExtensionId, ExtensionIdProvider } +import org.apache.pekko.persistence.jdbc.config.{ ConfigKeys, SlickConfiguration } +import org.apache.pekko.persistence.jdbc.util.ConfigOps._ import com.typesafe.config.{ Config, ConfigObject } import scala.collection.JavaConverters._ @@ -21,7 +21,7 @@ object SlickExtension extends ExtensionId[SlickExtensionImpl] with ExtensionIdPr class SlickExtensionImpl(system: ExtendedActorSystem) extends Extension { private val dbProvider: SlickDatabaseProvider = { - val fqcn = system.settings.config.getString("akka-persistence-jdbc.database-provider-fqcn") + val fqcn = system.settings.config.getString("pekko-persistence-jdbc.database-provider-fqcn") val args = List(classOf[ActorSystem] -> system) system.dynamicAccess.createInstanceFor[SlickDatabaseProvider](fqcn, args) match { case Success(result) => result @@ -39,7 +39,7 @@ class SlickExtensionImpl(system: ExtendedActorSystem) extends Extension { * A SlickDatabaseProvider is loaded using reflection, * The instance is created using the following: * - The fully qualified class name as configured in `jdbc-journal.database-provider-fqcn`. - * - The constructor with one argument of type [[akka.actor.ActorSystem]] is used to create the instance. + * - The constructor with one argument of type [[org.apache.pekko.actor.ActorSystem]] is used to create the instance. * Therefore the class must have such a constructor. */ trait SlickDatabaseProvider { @@ -54,7 +54,7 @@ trait SlickDatabaseProvider { class DefaultSlickDatabaseProvider(system: ActorSystem) extends SlickDatabaseProvider { val sharedDatabases: Map[String, LazySlickDatabase] = system.settings.config - .getObject("akka-persistence-jdbc.shared-databases") + .getObject("pekko-persistence-jdbc.shared-databases") .asScala .flatMap { case (key, confObj: ConfigObject) => @@ -65,7 +65,7 @@ class DefaultSlickDatabaseProvider(system: ActorSystem) extends SlickDatabasePro } else Nil case (key, notAnObject) => throw new RuntimeException( - s"""Expected "akka-persistence-jdbc.shared-databases.$key" to be a config ConfigObject, but got ${notAnObject + s"""Expected "pekko-persistence-jdbc.shared-databases.$key" to be a config ConfigObject, but got ${notAnObject .valueType()} (${notAnObject.getClass})""") } .toMap @@ -74,7 +74,7 @@ class DefaultSlickDatabaseProvider(system: ActorSystem) extends SlickDatabasePro sharedDatabases.getOrElse( sharedDbName, throw new RuntimeException( - s"No shared database is configured under akka-persistence-jdbc.shared-databases.$sharedDbName")) + s"No shared database is configured under pekko-persistence-jdbc.shared-databases.$sharedDbName")) def database(config: Config): SlickDatabase = { config.asStringOption(ConfigKeys.useSharedDb) match { diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/JdbcAsyncWriteJournal.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/JdbcAsyncWriteJournal.scala similarity index 84% rename from core/src/main/scala/akka/persistence/jdbc/journal/JdbcAsyncWriteJournal.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/JdbcAsyncWriteJournal.scala index c0441a7d..9ba58e27 100644 --- a/core/src/main/scala/akka/persistence/jdbc/journal/JdbcAsyncWriteJournal.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/JdbcAsyncWriteJournal.scala @@ -3,20 +3,20 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal +package org.apache.pekko.persistence.jdbc.journal import java.util.{ HashMap => JHMap, Map => JMap } -import akka.Done -import akka.actor.{ ActorSystem, ExtendedActorSystem } -import akka.persistence.jdbc.config.JournalConfig -import akka.persistence.jdbc.journal.JdbcAsyncWriteJournal.{ InPlaceUpdateEvent, WriteFinished } -import akka.persistence.jdbc.journal.dao.{ JournalDao, JournalDaoWithUpdates } -import akka.persistence.jdbc.db.{ SlickDatabase, SlickExtension } -import akka.persistence.journal.AsyncWriteJournal -import akka.persistence.{ AtomicWrite, PersistentRepr } -import akka.serialization.{ Serialization, SerializationExtension } -import akka.stream.{ Materializer, SystemMaterializer } +import org.apache.pekko.Done +import org.apache.pekko.actor.{ ActorSystem, ExtendedActorSystem } +import org.apache.pekko.persistence.jdbc.config.JournalConfig +import org.apache.pekko.persistence.jdbc.journal.JdbcAsyncWriteJournal.{ InPlaceUpdateEvent, WriteFinished } +import org.apache.pekko.persistence.jdbc.journal.dao.{ JournalDao, JournalDaoWithUpdates } +import org.apache.pekko.persistence.jdbc.db.{ SlickDatabase, SlickExtension } +import org.apache.pekko.persistence.journal.AsyncWriteJournal +import org.apache.pekko.persistence.{ AtomicWrite, PersistentRepr } +import org.apache.pekko.serialization.{ Serialization, SerializationExtension } +import org.apache.pekko.stream.{ Materializer, SystemMaterializer } import com.typesafe.config.Config import slick.jdbc.JdbcProfile import slick.jdbc.JdbcBackend._ @@ -24,8 +24,8 @@ import slick.jdbc.JdbcBackend._ import scala.collection.immutable._ import scala.concurrent.{ ExecutionContext, Future } import scala.util.{ Failure, Success, Try } -import akka.pattern.pipe -import akka.persistence.jdbc.util.PluginVersionChecker +import org.apache.pekko.pattern.pipe +import org.apache.pekko.persistence.jdbc.util.PluginVersionChecker object JdbcAsyncWriteJournal { private case class WriteFinished(pid: String, f: Future[_]) @@ -34,7 +34,7 @@ object JdbcAsyncWriteJournal { * Extra Plugin API: May be used to issue in-place updates for events. * To be used only for data migrations such as "encrypt all events" and similar operations. * - * The write payload may be wrapped in a [[akka.persistence.journal.Tagged]], + * The write payload may be wrapped in a [[org.apache.pekko.persistence.journal.Tagged]], * in which case the new tags will overwrite the existing tags of the event. */ final case class InPlaceUpdateEvent(persistenceId: String, seqNr: Long, write: AnyRef) diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/dao/BaseDao.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/BaseDao.scala similarity index 86% rename from core/src/main/scala/akka/persistence/jdbc/journal/dao/BaseDao.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/BaseDao.scala index 3374867b..57e077c0 100644 --- a/core/src/main/scala/akka/persistence/jdbc/journal/dao/BaseDao.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/BaseDao.scala @@ -3,11 +3,11 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal.dao +package org.apache.pekko.persistence.jdbc.journal.dao -import akka.persistence.jdbc.config.BaseDaoConfig -import akka.stream.scaladsl.{ Keep, Sink, Source, SourceQueueWithComplete } -import akka.stream.{ Materializer, OverflowStrategy, QueueOfferResult } +import org.apache.pekko.persistence.jdbc.config.BaseDaoConfig +import org.apache.pekko.stream.scaladsl.{ Keep, Sink, Source, SourceQueueWithComplete } +import org.apache.pekko.stream.{ Materializer, OverflowStrategy, QueueOfferResult } import scala.collection.immutable.{ Seq, Vector } import scala.concurrent.{ ExecutionContext, Future, Promise } diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/dao/BaseJournalDaoWithReadMessages.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/BaseJournalDaoWithReadMessages.scala similarity index 84% rename from core/src/main/scala/akka/persistence/jdbc/journal/dao/BaseJournalDaoWithReadMessages.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/BaseJournalDaoWithReadMessages.scala index fca97727..d6c2068c 100644 --- a/core/src/main/scala/akka/persistence/jdbc/journal/dao/BaseJournalDaoWithReadMessages.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/BaseJournalDaoWithReadMessages.scala @@ -3,14 +3,14 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal.dao +package org.apache.pekko.persistence.jdbc.journal.dao -import akka.NotUsed -import akka.actor.Scheduler -import akka.persistence.PersistentRepr -import akka.persistence.jdbc.journal.dao.FlowControl.{ Continue, ContinueDelayed, Stop } -import akka.stream.Materializer -import akka.stream.scaladsl.{ Sink, Source } +import org.apache.pekko.NotUsed +import org.apache.pekko.actor.Scheduler +import org.apache.pekko.persistence.PersistentRepr +import org.apache.pekko.persistence.jdbc.journal.dao.FlowControl.{ Continue, ContinueDelayed, Stop } +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.scaladsl.{ Sink, Source } import scala.collection.immutable.Seq import scala.concurrent.{ ExecutionContext, Future } @@ -64,7 +64,7 @@ trait BaseJournalDaoWithReadMessages extends JournalDaoWithReadMessages { case Continue => retrieveNextBatch() case ContinueDelayed => val (delay, scheduler) = refreshInterval.get - akka.pattern.after(delay, scheduler)(retrieveNextBatch()) + org.apache.pekko.pattern.after(delay, scheduler)(retrieveNextBatch()) } } .mapConcat(identity(_)) diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/dao/DefaultJournalDao.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/DefaultJournalDao.scala similarity index 71% rename from core/src/main/scala/akka/persistence/jdbc/journal/dao/DefaultJournalDao.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/DefaultJournalDao.scala index b2425833..55d36093 100644 --- a/core/src/main/scala/akka/persistence/jdbc/journal/dao/DefaultJournalDao.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/DefaultJournalDao.scala @@ -3,18 +3,18 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal.dao - -import akka.NotUsed -import akka.dispatch.ExecutionContexts -import akka.persistence.jdbc.AkkaSerialization -import akka.persistence.jdbc.config.{ BaseDaoConfig, JournalConfig } -import akka.persistence.jdbc.journal.dao.JournalTables.JournalAkkaSerializationRow -import akka.persistence.journal.Tagged -import akka.persistence.{ AtomicWrite, PersistentRepr } -import akka.serialization.Serialization -import akka.stream.Materializer -import akka.stream.scaladsl.Source +package org.apache.pekko.persistence.jdbc.journal.dao + +import org.apache.pekko.NotUsed +import org.apache.pekko.dispatch.ExecutionContexts +import org.apache.pekko.persistence.jdbc.PekkoSerialization +import org.apache.pekko.persistence.jdbc.config.{ BaseDaoConfig, JournalConfig } +import org.apache.pekko.persistence.jdbc.journal.dao.JournalTables.JournalPekkoSerializationRow +import org.apache.pekko.persistence.journal.Tagged +import org.apache.pekko.persistence.{ AtomicWrite, PersistentRepr } +import org.apache.pekko.serialization.Serialization +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.scaladsl.Source import slick.jdbc.JdbcBackend.Database import slick.jdbc.JdbcProfile @@ -32,7 +32,7 @@ class DefaultJournalDao( val profile: JdbcProfile, val journalConfig: JournalConfig, serialization: Serialization)(implicit val ec: ExecutionContext, val mat: Materializer) - extends BaseDao[(JournalAkkaSerializationRow, Set[String])] + extends BaseDao[(JournalPekkoSerializationRow, Set[String])] with BaseJournalDaoWithReadMessages with JournalDao with H2Compat { @@ -41,7 +41,7 @@ class DefaultJournalDao( override def baseDaoConfig: BaseDaoConfig = journalConfig.daoConfig - override def writeJournalRows(xs: immutable.Seq[(JournalAkkaSerializationRow, Set[String])]): Future[Unit] = { + override def writeJournalRows(xs: immutable.Seq[(JournalPekkoSerializationRow, Set[String])]): Future[Unit] = { db.run(queries.writeJournalRows(xs).transactionally).map(_ => ())(ExecutionContexts.parasitic) } @@ -69,20 +69,20 @@ class DefaultJournalDao( override def asyncWriteMessages(messages: immutable.Seq[AtomicWrite]): Future[immutable.Seq[Try[Unit]]] = { - def serializeAtomicWrite(aw: AtomicWrite): Try[Seq[(JournalAkkaSerializationRow, Set[String])]] = { + def serializeAtomicWrite(aw: AtomicWrite): Try[Seq[(JournalPekkoSerializationRow, Set[String])]] = { Try(aw.payload.map(serialize)) } - def serialize(pr: PersistentRepr): (JournalAkkaSerializationRow, Set[String]) = { + def serialize(pr: PersistentRepr): (JournalPekkoSerializationRow, Set[String]) = { val (updatedPr, tags) = pr.payload match { case Tagged(payload, tags) => (pr.withPayload(payload), tags) case _ => (pr, Set.empty[String]) } - val serializedPayload = AkkaSerialization.serialize(serialization, updatedPr.payload).get - val serializedMetadata = updatedPr.metadata.flatMap(m => AkkaSerialization.serialize(serialization, m).toOption) - val row = JournalAkkaSerializationRow( + val serializedPayload = PekkoSerialization.serialize(serialization, updatedPr.payload).get + val serializedMetadata = updatedPr.metadata.flatMap(m => PekkoSerialization.serialize(serialization, m).toOption) + val row = JournalPekkoSerializationRow( Long.MinValue, updatedPr.deleted, updatedPr.persistenceId, @@ -102,7 +102,7 @@ class DefaultJournalDao( val serializedTries = messages.map(serializeAtomicWrite) - val rowsToWrite: Seq[(JournalAkkaSerializationRow, Set[String])] = for { + val rowsToWrite: Seq[(JournalPekkoSerializationRow, Set[String])] = for { serializeTry <- serializedTries row <- serializeTry.getOrElse(Seq.empty) } yield row @@ -122,6 +122,6 @@ class DefaultJournalDao( .fromPublisher( db.stream( queries.messagesQuery((persistenceId, fromSequenceNr, toSequenceNr, correctMaxForH2Driver(max))).result)) - .map(AkkaSerialization.fromRow(serialization)(_)) + .map(PekkoSerialization.fromRow(serialization)(_)) } } diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/dao/FlowControl.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/FlowControl.scala similarity index 92% rename from core/src/main/scala/akka/persistence/jdbc/journal/dao/FlowControl.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/FlowControl.scala index c9fcaa30..4cdc81a5 100644 --- a/core/src/main/scala/akka/persistence/jdbc/journal/dao/FlowControl.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/FlowControl.scala @@ -3,7 +3,7 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal.dao +package org.apache.pekko.persistence.jdbc.journal.dao private[jdbc] sealed trait FlowControl diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/dao/H2Compat.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/H2Compat.scala similarity index 91% rename from core/src/main/scala/akka/persistence/jdbc/journal/dao/H2Compat.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/H2Compat.scala index b464f832..339af73d 100644 --- a/core/src/main/scala/akka/persistence/jdbc/journal/dao/H2Compat.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/H2Compat.scala @@ -3,7 +3,7 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal.dao +package org.apache.pekko.persistence.jdbc.journal.dao import slick.jdbc.JdbcProfile diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalDao.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/JournalDao.scala similarity index 81% rename from core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalDao.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/JournalDao.scala index d46c4318..1101d210 100644 --- a/core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalDao.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/JournalDao.scala @@ -3,9 +3,9 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal.dao +package org.apache.pekko.persistence.jdbc.journal.dao -import akka.persistence.AtomicWrite +import org.apache.pekko.persistence.AtomicWrite import scala.collection.immutable.Seq import scala.concurrent.Future import scala.util.Try @@ -24,7 +24,7 @@ trait JournalDao extends JournalDaoWithReadMessages { def highestSequenceNr(persistenceId: String, fromSequenceNr: Long): Future[Long] /** - * @see [[akka.persistence.journal.AsyncWriteJournal.asyncWriteMessages(messages)]] + * @see [[org.apache.pekko.persistence.journal.AsyncWriteJournal.asyncWriteMessages(messages)]] */ def asyncWriteMessages(messages: Seq[AtomicWrite]): Future[Seq[Try[Unit]]] } diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalDaoWithReadMessages.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/JournalDaoWithReadMessages.scala similarity index 83% rename from core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalDaoWithReadMessages.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/JournalDaoWithReadMessages.scala index e64cb726..96153ae4 100644 --- a/core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalDaoWithReadMessages.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/JournalDaoWithReadMessages.scala @@ -3,15 +3,15 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal.dao +package org.apache.pekko.persistence.jdbc.journal.dao import scala.concurrent.duration.FiniteDuration import scala.util.Try -import akka.NotUsed -import akka.actor.Scheduler -import akka.persistence.PersistentRepr -import akka.stream.scaladsl.Source +import org.apache.pekko.NotUsed +import org.apache.pekko.actor.Scheduler +import org.apache.pekko.persistence.PersistentRepr +import org.apache.pekko.stream.scaladsl.Source trait JournalDaoWithReadMessages { diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalDaoWithUpdates.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/JournalDaoWithUpdates.scala similarity index 88% rename from core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalDaoWithUpdates.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/JournalDaoWithUpdates.scala index 4f5d8131..4e05c20f 100644 --- a/core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalDaoWithUpdates.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/JournalDaoWithUpdates.scala @@ -3,9 +3,9 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal.dao +package org.apache.pekko.persistence.jdbc.journal.dao -import akka.Done +import org.apache.pekko.Done import scala.concurrent.Future diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalQueries.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/JournalQueries.scala similarity index 90% rename from core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalQueries.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/JournalQueries.scala index 4335692e..dbdcce08 100644 --- a/core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalQueries.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/JournalQueries.scala @@ -3,10 +3,10 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal.dao +package org.apache.pekko.persistence.jdbc.journal.dao -import akka.persistence.jdbc.config.{ EventJournalTableConfiguration, EventTagTableConfiguration } -import akka.persistence.jdbc.journal.dao.JournalTables.{ JournalAkkaSerializationRow, TagRow } +import org.apache.pekko.persistence.jdbc.config.{ EventJournalTableConfiguration, EventTagTableConfiguration } +import org.apache.pekko.persistence.jdbc.journal.dao.JournalTables.{ JournalPekkoSerializationRow, TagRow } import slick.jdbc.JdbcProfile import scala.concurrent.ExecutionContext @@ -23,7 +23,7 @@ class JournalQueries( private val insertAndReturn = JournalTable.returning(JournalTable.map(_.ordering)) private val TagTableC = Compiled(TagTable) - def writeJournalRows(xs: Seq[(JournalAkkaSerializationRow, Set[String])])(implicit ec: ExecutionContext) = { + def writeJournalRows(xs: Seq[(JournalPekkoSerializationRow, Set[String])])(implicit ec: ExecutionContext) = { val sorted = xs.sortBy(event => event._1.sequenceNumber) if (sorted.exists(_._2.nonEmpty)) { // only if there are any tags diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalTables.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/JournalTables.scala similarity index 86% rename from core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalTables.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/JournalTables.scala index 5cf1a6ad..827f9def 100644 --- a/core/src/main/scala/akka/persistence/jdbc/journal/dao/JournalTables.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/JournalTables.scala @@ -3,18 +3,18 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal.dao +package org.apache.pekko.persistence.jdbc.journal.dao -import akka.annotation.InternalApi -import akka.persistence.jdbc.config.{ EventJournalTableConfiguration, EventTagTableConfiguration } -import akka.persistence.jdbc.journal.dao.JournalTables.{ JournalAkkaSerializationRow, TagRow } +import org.apache.pekko.annotation.InternalApi +import org.apache.pekko.persistence.jdbc.config.{ EventJournalTableConfiguration, EventTagTableConfiguration } +import org.apache.pekko.persistence.jdbc.journal.dao.JournalTables.{ JournalPekkoSerializationRow, TagRow } /** * INTERNAL API */ @InternalApi object JournalTables { - case class JournalAkkaSerializationRow( + case class JournalPekkoSerializationRow( ordering: Long, deleted: Boolean, persistenceId: String, @@ -46,7 +46,7 @@ trait JournalTables { def tagTableCfg: EventTagTableConfiguration class JournalEvents(_tableTag: Tag) - extends Table[JournalAkkaSerializationRow]( + extends Table[JournalPekkoSerializationRow]( _tableTag, _schemaName = journalTableCfg.schemaName, _tableName = journalTableCfg.tableName) { @@ -64,7 +64,7 @@ trait JournalTables { eventSerManifest, metaPayload, metaSerId, - metaSerManifest) <> (JournalAkkaSerializationRow.tupled, JournalAkkaSerializationRow.unapply) + metaSerManifest) <> (JournalPekkoSerializationRow.tupled, JournalPekkoSerializationRow.unapply) val ordering: Rep[Long] = column[Long](journalTableCfg.columnNames.ordering, O.AutoInc) val persistenceId: Rep[String] = diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/dao/legacy/ByteArrayJournalDao.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/ByteArrayJournalDao.scala similarity index 84% rename from core/src/main/scala/akka/persistence/jdbc/journal/dao/legacy/ByteArrayJournalDao.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/ByteArrayJournalDao.scala index 3143bff6..ff93e0e3 100644 --- a/core/src/main/scala/akka/persistence/jdbc/journal/dao/legacy/ByteArrayJournalDao.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/ByteArrayJournalDao.scala @@ -3,16 +3,21 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal.dao.legacy - -import akka.persistence.jdbc.config.{ BaseDaoConfig, JournalConfig } -import akka.persistence.jdbc.journal.dao.{ BaseDao, BaseJournalDaoWithReadMessages, H2Compat, JournalDaoWithUpdates } -import akka.persistence.jdbc.serialization.FlowPersistentReprSerializer -import akka.persistence.{ AtomicWrite, PersistentRepr } -import akka.serialization.Serialization -import akka.stream.Materializer -import akka.stream.scaladsl.Source -import akka.{ Done, NotUsed } +package org.apache.pekko.persistence.jdbc.journal.dao.legacy + +import org.apache.pekko.persistence.jdbc.config.{ BaseDaoConfig, JournalConfig } +import org.apache.pekko.persistence.jdbc.journal.dao.{ + BaseDao, + BaseJournalDaoWithReadMessages, + H2Compat, + JournalDaoWithUpdates +} +import org.apache.pekko.persistence.jdbc.serialization.FlowPersistentReprSerializer +import org.apache.pekko.persistence.{ AtomicWrite, PersistentRepr } +import org.apache.pekko.serialization.Serialization +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.{ Done, NotUsed } import org.slf4j.LoggerFactory import slick.jdbc.JdbcBackend.Database import slick.jdbc.JdbcProfile @@ -57,7 +62,7 @@ trait BaseByteArrayJournalDao } /** - * @see [[akka.persistence.journal.AsyncWriteJournal.asyncWriteMessages(messages)]] + * @see [[org.apache.pekko.persistence.journal.AsyncWriteJournal.asyncWriteMessages(messages)]] */ def asyncWriteMessages(messages: Seq[AtomicWrite]): Future[Seq[Try[Unit]]] = { val serializedTries: Seq[Try[Seq[JournalRow]]] = serializer.serialize(messages) @@ -76,7 +81,7 @@ trait BaseByteArrayJournalDao override def delete(persistenceId: String, maxSequenceNr: Long): Future[Unit] = { // We should keep journal record with highest sequence number in order to be compliant - // with @see [[akka.persistence.journal.JournalSpec]] + // with @see [[org.apache.pekko.persistence.journal.JournalSpec]] val actions: DBIOAction[Unit, NoStream, Effect.Write with Effect.Read] = for { _ <- queries.markJournalMessagesAsDeleted(persistenceId, maxSequenceNr) highestMarkedSequenceNr <- highestMarkedSequenceNr(persistenceId) diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/dao/legacy/ByteArrayJournalSerializer.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/ByteArrayJournalSerializer.scala similarity index 81% rename from core/src/main/scala/akka/persistence/jdbc/journal/dao/legacy/ByteArrayJournalSerializer.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/ByteArrayJournalSerializer.scala index fdc47059..d19e1e2a 100644 --- a/core/src/main/scala/akka/persistence/jdbc/journal/dao/legacy/ByteArrayJournalSerializer.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/ByteArrayJournalSerializer.scala @@ -3,12 +3,12 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc +package org.apache.pekko.persistence.jdbc package journal.dao.legacy -import akka.persistence.PersistentRepr -import akka.persistence.jdbc.serialization.FlowPersistentReprSerializer -import akka.serialization.Serialization +import org.apache.pekko.persistence.PersistentRepr +import org.apache.pekko.persistence.jdbc.serialization.FlowPersistentReprSerializer +import org.apache.pekko.serialization.Serialization import scala.collection.immutable._ import scala.util.Try diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/dao/legacy/JournalQueries.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/JournalQueries.scala similarity index 96% rename from core/src/main/scala/akka/persistence/jdbc/journal/dao/legacy/JournalQueries.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/JournalQueries.scala index 2b457f70..5918fb48 100644 --- a/core/src/main/scala/akka/persistence/jdbc/journal/dao/legacy/JournalQueries.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/JournalQueries.scala @@ -3,10 +3,10 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc +package org.apache.pekko.persistence.jdbc package journal.dao.legacy -import akka.persistence.jdbc.config.LegacyJournalTableConfiguration +import org.apache.pekko.persistence.jdbc.config.LegacyJournalTableConfiguration import slick.jdbc.JdbcProfile class JournalQueries(val profile: JdbcProfile, override val journalTableCfg: LegacyJournalTableConfiguration) diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/dao/legacy/JournalTables.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/JournalTables.scala similarity index 91% rename from core/src/main/scala/akka/persistence/jdbc/journal/dao/legacy/JournalTables.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/JournalTables.scala index 8a053c28..63ec2956 100644 --- a/core/src/main/scala/akka/persistence/jdbc/journal/dao/legacy/JournalTables.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/JournalTables.scala @@ -3,9 +3,9 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal.dao.legacy +package org.apache.pekko.persistence.jdbc.journal.dao.legacy -import akka.persistence.jdbc.config.LegacyJournalTableConfiguration +import org.apache.pekko.persistence.jdbc.config.LegacyJournalTableConfiguration trait JournalTables { val profile: slick.jdbc.JdbcProfile diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/dao/legacy/package.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/package.scala similarity index 92% rename from core/src/main/scala/akka/persistence/jdbc/journal/dao/legacy/package.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/package.scala index a393ea27..577270e6 100644 --- a/core/src/main/scala/akka/persistence/jdbc/journal/dao/legacy/package.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/package.scala @@ -3,7 +3,7 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal.dao +package org.apache.pekko.persistence.jdbc.journal.dao import scala.collection.immutable.Set diff --git a/core/src/main/scala/akka/persistence/jdbc/query/JdbcReadJournalProvider.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/JdbcReadJournalProvider.scala similarity index 75% rename from core/src/main/scala/akka/persistence/jdbc/query/JdbcReadJournalProvider.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/query/JdbcReadJournalProvider.scala index dd2784a5..bb67bafb 100644 --- a/core/src/main/scala/akka/persistence/jdbc/query/JdbcReadJournalProvider.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/JdbcReadJournalProvider.scala @@ -3,10 +3,10 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query +package org.apache.pekko.persistence.jdbc.query -import akka.actor.ExtendedActorSystem -import akka.persistence.query.ReadJournalProvider +import org.apache.pekko.actor.ExtendedActorSystem +import org.apache.pekko.persistence.query.ReadJournalProvider import com.typesafe.config.Config class JdbcReadJournalProvider(system: ExtendedActorSystem, config: Config, configPath: String) diff --git a/core/src/main/scala/akka/persistence/jdbc/query/JournalSequenceActor.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/JournalSequenceActor.scala similarity index 95% rename from core/src/main/scala/akka/persistence/jdbc/query/JournalSequenceActor.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/query/JournalSequenceActor.scala index 30fdfea0..bd057234 100644 --- a/core/src/main/scala/akka/persistence/jdbc/query/JournalSequenceActor.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/JournalSequenceActor.scala @@ -3,15 +3,15 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc +package org.apache.pekko.persistence.jdbc package query -import akka.actor.{ Actor, ActorLogging, Props, Status, Timers } -import akka.pattern.pipe -import akka.persistence.jdbc.config.JournalSequenceRetrievalConfig -import akka.persistence.jdbc.query.dao.ReadJournalDao -import akka.stream.Materializer -import akka.stream.scaladsl.Sink +import org.apache.pekko.actor.{ Actor, ActorLogging, Props, Status, Timers } +import org.apache.pekko.pattern.pipe +import org.apache.pekko.persistence.jdbc.config.JournalSequenceRetrievalConfig +import org.apache.pekko.persistence.jdbc.query.dao.ReadJournalDao +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.scaladsl.Sink import scala.collection.immutable.NumericRange import scala.concurrent.duration.FiniteDuration diff --git a/core/src/main/scala/akka/persistence/jdbc/query/dao/DefaultReadJournalDao.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/dao/DefaultReadJournalDao.scala similarity index 73% rename from core/src/main/scala/akka/persistence/jdbc/query/dao/DefaultReadJournalDao.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/query/dao/DefaultReadJournalDao.scala index c4a70efe..128492a5 100644 --- a/core/src/main/scala/akka/persistence/jdbc/query/dao/DefaultReadJournalDao.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/dao/DefaultReadJournalDao.scala @@ -3,15 +3,15 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query.dao -import akka.NotUsed -import akka.persistence.PersistentRepr -import akka.persistence.jdbc.AkkaSerialization -import akka.persistence.jdbc.config.ReadJournalConfig -import akka.persistence.jdbc.journal.dao.{ BaseJournalDaoWithReadMessages, H2Compat } -import akka.serialization.Serialization -import akka.stream.Materializer -import akka.stream.scaladsl.Source +package org.apache.pekko.persistence.jdbc.query.dao +import org.apache.pekko.NotUsed +import org.apache.pekko.persistence.PersistentRepr +import org.apache.pekko.persistence.jdbc.PekkoSerialization +import org.apache.pekko.persistence.jdbc.config.ReadJournalConfig +import org.apache.pekko.persistence.jdbc.journal.dao.{ BaseJournalDaoWithReadMessages, H2Compat } +import org.apache.pekko.serialization.Serialization +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.scaladsl.Source import slick.jdbc.JdbcBackend.Database import slick.jdbc.JdbcProfile @@ -43,7 +43,7 @@ class DefaultReadJournalDao( Source .fromPublisher(db.stream(queries.eventsByTag((tag, offset, maxOffset, correctMaxForH2Driver(max))).result)) .map(row => - AkkaSerialization.fromRow(serialization)(row).map { case (repr, ordering) => (repr, Set.empty, ordering) }) + PekkoSerialization.fromRow(serialization)(row).map { case (repr, ordering) => (repr, Set.empty, ordering) }) } override def journalSequence(offset: Long, limit: Long): Source[Long, NotUsed] = @@ -61,6 +61,6 @@ class DefaultReadJournalDao( .fromPublisher( db.stream( queries.messagesQuery((persistenceId, fromSequenceNr, toSequenceNr, correctMaxForH2Driver(max))).result)) - .map(AkkaSerialization.fromRow(serialization)(_)) + .map(PekkoSerialization.fromRow(serialization)(_)) } diff --git a/core/src/main/scala/akka/persistence/jdbc/query/dao/ReadJournalDao.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/dao/ReadJournalDao.scala similarity index 82% rename from core/src/main/scala/akka/persistence/jdbc/query/dao/ReadJournalDao.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/query/dao/ReadJournalDao.scala index de84287e..075eeb02 100644 --- a/core/src/main/scala/akka/persistence/jdbc/query/dao/ReadJournalDao.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/dao/ReadJournalDao.scala @@ -3,12 +3,12 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query.dao +package org.apache.pekko.persistence.jdbc.query.dao -import akka.NotUsed -import akka.persistence.PersistentRepr -import akka.persistence.jdbc.journal.dao.JournalDaoWithReadMessages -import akka.stream.scaladsl.Source +import org.apache.pekko.NotUsed +import org.apache.pekko.persistence.PersistentRepr +import org.apache.pekko.persistence.jdbc.journal.dao.JournalDaoWithReadMessages +import org.apache.pekko.stream.scaladsl.Source import scala.collection.immutable.Set import scala.concurrent.Future diff --git a/core/src/main/scala/akka/persistence/jdbc/query/dao/ReadJournalQueries.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/dao/ReadJournalQueries.scala similarity index 90% rename from core/src/main/scala/akka/persistence/jdbc/query/dao/ReadJournalQueries.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/query/dao/ReadJournalQueries.scala index 3684eb9a..b727cd33 100644 --- a/core/src/main/scala/akka/persistence/jdbc/query/dao/ReadJournalQueries.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/dao/ReadJournalQueries.scala @@ -3,10 +3,14 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query.dao +package org.apache.pekko.persistence.jdbc.query.dao -import akka.persistence.jdbc.config.{ EventJournalTableConfiguration, EventTagTableConfiguration, ReadJournalConfig } -import akka.persistence.jdbc.journal.dao.JournalTables +import org.apache.pekko.persistence.jdbc.config.{ + EventJournalTableConfiguration, + EventTagTableConfiguration, + ReadJournalConfig +} +import org.apache.pekko.persistence.jdbc.journal.dao.JournalTables import slick.jdbc.JdbcProfile class ReadJournalQueries(val profile: JdbcProfile, val readJournalConfig: ReadJournalConfig) extends JournalTables { diff --git a/core/src/main/scala/akka/persistence/jdbc/query/dao/legacy/ByteArrayReadJournalDao.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/dao/legacy/ByteArrayReadJournalDao.scala similarity index 86% rename from core/src/main/scala/akka/persistence/jdbc/query/dao/legacy/ByteArrayReadJournalDao.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/query/dao/legacy/ByteArrayReadJournalDao.scala index 4c15231a..b2c2bf2f 100644 --- a/core/src/main/scala/akka/persistence/jdbc/query/dao/legacy/ByteArrayReadJournalDao.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/dao/legacy/ByteArrayReadJournalDao.scala @@ -3,19 +3,19 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query.dao.legacy - -import akka.NotUsed -import akka.persistence.PersistentRepr -import akka.persistence.jdbc.config.ReadJournalConfig -import akka.persistence.jdbc.journal.dao.{ BaseJournalDaoWithReadMessages, H2Compat } -import akka.persistence.jdbc.journal.dao.legacy.{ ByteArrayJournalSerializer, JournalRow } -import akka.persistence.jdbc.query.dao.ReadJournalDao -import akka.persistence.jdbc.query.dao.legacy.TagFilterFlow.perfectlyMatchTag -import akka.persistence.jdbc.serialization.FlowPersistentReprSerializer -import akka.serialization.Serialization -import akka.stream.Materializer -import akka.stream.scaladsl.{ Flow, Source } +package org.apache.pekko.persistence.jdbc.query.dao.legacy + +import org.apache.pekko.NotUsed +import org.apache.pekko.persistence.PersistentRepr +import org.apache.pekko.persistence.jdbc.config.ReadJournalConfig +import org.apache.pekko.persistence.jdbc.journal.dao.{ BaseJournalDaoWithReadMessages, H2Compat } +import org.apache.pekko.persistence.jdbc.journal.dao.legacy.{ ByteArrayJournalSerializer, JournalRow } +import org.apache.pekko.persistence.jdbc.query.dao.ReadJournalDao +import org.apache.pekko.persistence.jdbc.query.dao.legacy.TagFilterFlow.perfectlyMatchTag +import org.apache.pekko.persistence.jdbc.serialization.FlowPersistentReprSerializer +import org.apache.pekko.serialization.Serialization +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.scaladsl.{ Flow, Source } import slick.jdbc.JdbcBackend._ import slick.jdbc.{ GetResult, JdbcProfile } diff --git a/core/src/main/scala/akka/persistence/jdbc/query/dao/legacy/ReadJournalQueries.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/dao/legacy/ReadJournalQueries.scala similarity index 89% rename from core/src/main/scala/akka/persistence/jdbc/query/dao/legacy/ReadJournalQueries.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/query/dao/legacy/ReadJournalQueries.scala index 0bc87fa6..8d9f0d4c 100644 --- a/core/src/main/scala/akka/persistence/jdbc/query/dao/legacy/ReadJournalQueries.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/dao/legacy/ReadJournalQueries.scala @@ -3,10 +3,10 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query.dao.legacy +package org.apache.pekko.persistence.jdbc.query.dao.legacy -import akka.persistence.jdbc.config.{ LegacyJournalTableConfiguration, ReadJournalConfig } -import akka.persistence.jdbc.journal.dao.legacy.JournalTables +import org.apache.pekko.persistence.jdbc.config.{ LegacyJournalTableConfiguration, ReadJournalConfig } +import org.apache.pekko.persistence.jdbc.journal.dao.legacy.JournalTables import slick.jdbc.JdbcProfile class ReadJournalQueries(val profile: JdbcProfile, val readJournalConfig: ReadJournalConfig) extends JournalTables { diff --git a/core/src/main/scala/akka/persistence/jdbc/query/javadsl/JdbcReadJournal.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/javadsl/JdbcReadJournal.scala similarity index 88% rename from core/src/main/scala/akka/persistence/jdbc/query/javadsl/JdbcReadJournal.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/query/javadsl/JdbcReadJournal.scala index f266b360..a01d1686 100644 --- a/core/src/main/scala/akka/persistence/jdbc/query/javadsl/JdbcReadJournal.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/javadsl/JdbcReadJournal.scala @@ -3,13 +3,13 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query.javadsl +package org.apache.pekko.persistence.jdbc.query.javadsl -import akka.NotUsed -import akka.persistence.jdbc.query.scaladsl.{ JdbcReadJournal => ScalaJdbcReadJournal } -import akka.persistence.query.{ EventEnvelope, Offset } -import akka.persistence.query.javadsl._ -import akka.stream.javadsl.Source +import org.apache.pekko.NotUsed +import org.apache.pekko.persistence.jdbc.query.scaladsl.{ JdbcReadJournal => ScalaJdbcReadJournal } +import org.apache.pekko.persistence.query.{ EventEnvelope, Offset } +import org.apache.pekko.persistence.query.javadsl._ +import org.apache.pekko.stream.javadsl.Source object JdbcReadJournal { final val Identifier = ScalaJdbcReadJournal.Identifier @@ -72,7 +72,7 @@ class JdbcReadJournal(journal: ScalaJdbcReadJournal) * The `EventEnvelope` also provides the `offset` that corresponds to the `ordering` column in * the Journal table. The `ordering` is a sequential id number that uniquely identifies the * position of each event, also across different `persistenceId`. The `Offset` type is - * `akka.persistence.query.Sequence` with the `ordering` as the offset value. This is the + * `org.apache.pekko.persistence.query.Sequence` with the `ordering` as the offset value. This is the * same `ordering` number as is used in the offset of the `eventsByTag` query. * * The returned event stream is ordered by `sequenceNr`. @@ -108,9 +108,9 @@ class JdbcReadJournal(journal: ScalaJdbcReadJournal) * The offset is exclusive, i.e. the event corresponding to the given `offset` parameter is not * included in the stream. * - * For akka-persistence-jdbc the `offset` corresponds to the `ordering` column in the Journal table. + * For pekko-persistence-jdbc the `offset` corresponds to the `ordering` column in the Journal table. * The `ordering` is a sequential id number that uniquely identifies the position of each event within - * the event stream. The `Offset` type is `akka.persistence.query.Sequence` with the `ordering` as the + * the event stream. The `Offset` type is `org.apache.pekko.persistence.query.Sequence` with the `ordering` as the * offset value. * * The returned event stream is ordered by `offset`. diff --git a/core/src/main/scala/akka/persistence/jdbc/query/package.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/package.scala similarity index 71% rename from core/src/main/scala/akka/persistence/jdbc/query/package.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/query/package.scala index 6579da08..bafe8ac3 100644 --- a/core/src/main/scala/akka/persistence/jdbc/query/package.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/package.scala @@ -3,9 +3,9 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc +package org.apache.pekko.persistence.jdbc -import akka.persistence.query._ +import org.apache.pekko.persistence.query._ package object query { implicit class OffsetOps(val that: Offset) extends AnyVal { @@ -15,7 +15,7 @@ package object query { case NoOffset => 0L case _ => throw new IllegalArgumentException( - "akka-persistence-jdbc does not support " + that.getClass.getName + " offsets") + "pekko-persistence-jdbc does not support " + that.getClass.getName + " offsets") } } } diff --git a/core/src/main/scala/akka/persistence/jdbc/query/scaladsl/JdbcReadJournal.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/scaladsl/JdbcReadJournal.scala similarity index 89% rename from core/src/main/scala/akka/persistence/jdbc/query/scaladsl/JdbcReadJournal.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/query/scaladsl/JdbcReadJournal.scala index 48c6a4c3..fe23c020 100644 --- a/core/src/main/scala/akka/persistence/jdbc/query/scaladsl/JdbcReadJournal.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/query/scaladsl/JdbcReadJournal.scala @@ -3,22 +3,22 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query +package org.apache.pekko.persistence.jdbc.query package scaladsl -import akka.NotUsed -import akka.actor.ExtendedActorSystem -import akka.persistence.jdbc.config.ReadJournalConfig -import akka.persistence.jdbc.query.JournalSequenceActor.{ GetMaxOrderingId, MaxOrderingId } -import akka.persistence.jdbc.db.SlickExtension -import akka.persistence.jdbc.journal.dao.FlowControl -import akka.persistence.query.scaladsl._ -import akka.persistence.query.{ EventEnvelope, Offset, Sequence } -import akka.persistence.{ Persistence, PersistentRepr } -import akka.serialization.{ Serialization, SerializationExtension } -import akka.stream.scaladsl.{ Sink, Source } -import akka.stream.{ Materializer, SystemMaterializer } -import akka.util.Timeout +import org.apache.pekko.NotUsed +import org.apache.pekko.actor.ExtendedActorSystem +import org.apache.pekko.persistence.jdbc.config.ReadJournalConfig +import org.apache.pekko.persistence.jdbc.query.JournalSequenceActor.{ GetMaxOrderingId, MaxOrderingId } +import org.apache.pekko.persistence.jdbc.db.SlickExtension +import org.apache.pekko.persistence.jdbc.journal.dao.FlowControl +import org.apache.pekko.persistence.query.scaladsl._ +import org.apache.pekko.persistence.query.{ EventEnvelope, Offset, Sequence } +import org.apache.pekko.persistence.{ Persistence, PersistentRepr } +import org.apache.pekko.serialization.{ Serialization, SerializationExtension } +import org.apache.pekko.stream.scaladsl.{ Sink, Source } +import org.apache.pekko.stream.{ Materializer, SystemMaterializer } +import org.apache.pekko.util.Timeout import com.typesafe.config.Config import slick.jdbc.JdbcBackend._ import slick.jdbc.JdbcProfile @@ -27,9 +27,9 @@ import scala.collection.immutable._ import scala.concurrent.duration._ import scala.concurrent.{ ExecutionContext, Future } import scala.util.{ Failure, Success } -import akka.actor.Scheduler -import akka.persistence.jdbc.query.dao.ReadJournalDao -import akka.persistence.jdbc.util.PluginVersionChecker +import org.apache.pekko.actor.Scheduler +import org.apache.pekko.persistence.jdbc.query.dao.ReadJournalDao +import org.apache.pekko.persistence.jdbc.util.PluginVersionChecker object JdbcReadJournal { final val Identifier = "jdbc-read-journal" @@ -82,7 +82,7 @@ class JdbcReadJournal(config: Config, configPath: String)(implicit val system: E // Started lazily to prevent the actor for querying the db if no eventsByTag queries are used private[query] lazy val journalSequenceActor = system.systemActorOf( JournalSequenceActor.props(readJournalDao, readJournalConfig.journalSequenceRetrievalConfiguration), - s"$configPath.akka-persistence-jdbc-journal-sequence-actor") + s"$configPath.pekko-persistence-jdbc-journal-sequence-actor") private val delaySource = Source.tick(readJournalConfig.refreshInterval, 0.seconds, 0).take(1) @@ -150,7 +150,7 @@ class JdbcReadJournal(config: Config, configPath: String)(implicit val system: E * The `EventEnvelope` also provides the `offset` that corresponds to the `ordering` column in * the Journal table. The `ordering` is a sequential id number that uniquely identifies the * position of each event, also across different `persistenceId`. The `Offset` type is - * `akka.persistence.query.Sequence` with the `ordering` as the offset value. This is the + * `org.apache.pekko.persistence.query.Sequence` with the `ordering` as the offset value. This is the * same `ordering` number as is used in the offset of the `eventsByTag` query. * * The returned event stream is ordered by `sequenceNr`. @@ -224,7 +224,7 @@ class JdbcReadJournal(config: Config, configPath: String)(implicit val system: E tag: String, offset: Long, terminateAfterOffset: Option[Long]): Source[EventEnvelope, NotUsed] = { - import akka.pattern.ask + import org.apache.pekko.pattern.ask import FlowControl._ implicit val askTimeout: Timeout = Timeout(readJournalConfig.journalSequenceRetrievalConfiguration.askTimeout) val batchSize = readJournalConfig.maxBufferSize @@ -266,7 +266,7 @@ class JdbcReadJournal(config: Config, configPath: String)(implicit val system: E case Stop => Future.successful(None) case Continue => retrieveNextBatch() case ContinueDelayed => - akka.pattern.after(readJournalConfig.refreshInterval, system.scheduler)(retrieveNextBatch()) + org.apache.pekko.pattern.after(readJournalConfig.refreshInterval, system.scheduler)(retrieveNextBatch()) } } .mapConcat(identity) @@ -288,9 +288,9 @@ class JdbcReadJournal(config: Config, configPath: String)(implicit val system: E * The offset is exclusive, i.e. the event corresponding to the given `offset` parameter is not * included in the stream. * - * For akka-persistence-jdbc the `offset` corresponds to the `ordering` column in the Journal table. + * For pekko-persistence-jdbc the `offset` corresponds to the `ordering` column in the Journal table. * The `ordering` is a sequential id number that uniquely identifies the position of each event within - * the event stream. The `Offset` type is `akka.persistence.query.Sequence` with the `ordering` as the + * the event stream. The `Offset` type is `org.apache.pekko.persistence.query.Sequence` with the `ordering` as the * offset value. * * The returned event stream is ordered by `offset`. diff --git a/core/src/main/scala/akka/persistence/jdbc/serialization/PersistentReprSerializer.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/serialization/PersistentReprSerializer.scala similarity index 80% rename from core/src/main/scala/akka/persistence/jdbc/serialization/PersistentReprSerializer.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/serialization/PersistentReprSerializer.scala index 778bac2e..07aa8475 100644 --- a/core/src/main/scala/akka/persistence/jdbc/serialization/PersistentReprSerializer.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/serialization/PersistentReprSerializer.scala @@ -3,13 +3,13 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.serialization +package org.apache.pekko.persistence.jdbc.serialization -import akka.NotUsed -import akka.persistence.jdbc.util.TrySeq -import akka.persistence.journal.Tagged -import akka.persistence.{ AtomicWrite, PersistentRepr } -import akka.stream.scaladsl.Flow +import org.apache.pekko.NotUsed +import org.apache.pekko.persistence.jdbc.util.TrySeq +import org.apache.pekko.persistence.journal.Tagged +import org.apache.pekko.persistence.{ AtomicWrite, PersistentRepr } +import org.apache.pekko.stream.scaladsl.Flow import scala.collection.immutable._ import scala.util.Try @@ -18,7 +18,7 @@ import scala.util.Try trait PersistentReprSerializer[T] { /** - * An akka.persistence.AtomicWrite contains a Sequence of events (with metadata, the PersistentRepr) + * An org.apache.pekko.persistence.AtomicWrite contains a Sequence of events (with metadata, the PersistentRepr) * that must all be persisted or all fail, what makes the operation atomic. The function converts * each AtomicWrite to a Try[Seq[T]]. * The Try denotes whether there was a problem with the AtomicWrite or not. diff --git a/core/src/main/scala/akka/persistence/jdbc/serialization/SnapshotSerializer.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/serialization/SnapshotSerializer.scala similarity index 75% rename from core/src/main/scala/akka/persistence/jdbc/serialization/SnapshotSerializer.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/serialization/SnapshotSerializer.scala index 77234896..f08965d0 100644 --- a/core/src/main/scala/akka/persistence/jdbc/serialization/SnapshotSerializer.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/serialization/SnapshotSerializer.scala @@ -3,9 +3,9 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.serialization +package org.apache.pekko.persistence.jdbc.serialization -import akka.persistence.SnapshotMetadata +import org.apache.pekko.persistence.SnapshotMetadata import scala.util.Try diff --git a/core/src/main/scala/akka/persistence/jdbc/snapshot/JdbcSnapshotStore.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/JdbcSnapshotStore.scala similarity index 85% rename from core/src/main/scala/akka/persistence/jdbc/snapshot/JdbcSnapshotStore.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/JdbcSnapshotStore.scala index 79c248ac..84edbab8 100644 --- a/core/src/main/scala/akka/persistence/jdbc/snapshot/JdbcSnapshotStore.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/JdbcSnapshotStore.scala @@ -3,16 +3,16 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.snapshot +package org.apache.pekko.persistence.jdbc.snapshot -import akka.actor.{ ActorSystem, ExtendedActorSystem } -import akka.persistence.jdbc.config.SnapshotConfig -import akka.persistence.jdbc.snapshot.dao.SnapshotDao -import akka.persistence.jdbc.db.{ SlickDatabase, SlickExtension } -import akka.persistence.snapshot.SnapshotStore -import akka.persistence.{ SelectedSnapshot, SnapshotMetadata, SnapshotSelectionCriteria } -import akka.serialization.{ Serialization, SerializationExtension } -import akka.stream.{ Materializer, SystemMaterializer } +import org.apache.pekko.actor.{ ActorSystem, ExtendedActorSystem } +import org.apache.pekko.persistence.jdbc.config.SnapshotConfig +import org.apache.pekko.persistence.jdbc.snapshot.dao.SnapshotDao +import org.apache.pekko.persistence.jdbc.db.{ SlickDatabase, SlickExtension } +import org.apache.pekko.persistence.snapshot.SnapshotStore +import org.apache.pekko.persistence.{ SelectedSnapshot, SnapshotMetadata, SnapshotSelectionCriteria } +import org.apache.pekko.serialization.{ Serialization, SerializationExtension } +import org.apache.pekko.stream.{ Materializer, SystemMaterializer } import com.typesafe.config.Config import slick.jdbc.JdbcProfile import slick.jdbc.JdbcBackend._ diff --git a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/DefaultSnapshotDao.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/DefaultSnapshotDao.scala similarity index 90% rename from core/src/main/scala/akka/persistence/jdbc/snapshot/dao/DefaultSnapshotDao.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/DefaultSnapshotDao.scala index 600bd58e..b99328a2 100644 --- a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/DefaultSnapshotDao.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/DefaultSnapshotDao.scala @@ -3,16 +3,16 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.snapshot.dao +package org.apache.pekko.persistence.jdbc.snapshot.dao import slick.jdbc.{ JdbcBackend, JdbcProfile } -import akka.persistence.SnapshotMetadata -import akka.persistence.jdbc.config.SnapshotConfig -import akka.serialization.Serialization -import akka.stream.Materializer +import org.apache.pekko.persistence.SnapshotMetadata +import org.apache.pekko.persistence.jdbc.config.SnapshotConfig +import org.apache.pekko.serialization.Serialization +import org.apache.pekko.stream.Materializer import SnapshotTables._ -import akka.dispatch.ExecutionContexts -import akka.persistence.jdbc.AkkaSerialization +import org.apache.pekko.dispatch.ExecutionContexts +import org.apache.pekko.persistence.jdbc.PekkoSerialization import scala.concurrent.{ ExecutionContext, Future } import scala.util.{ Success, Try } @@ -47,8 +47,8 @@ class DefaultSnapshotDao( } private def serializeSnapshot(meta: SnapshotMetadata, snapshot: Any): Try[SnapshotRow] = { - val serializedMetadata = meta.metadata.flatMap(m => AkkaSerialization.serialize(serialization, m).toOption) - AkkaSerialization + val serializedMetadata = meta.metadata.flatMap(m => PekkoSerialization.serialize(serialization, m).toOption) + PekkoSerialization .serialize(serialization, payload = snapshot) .map(serializedSnapshot => SnapshotRow( diff --git a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/SnapshotDao.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/SnapshotDao.scala similarity index 91% rename from core/src/main/scala/akka/persistence/jdbc/snapshot/dao/SnapshotDao.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/SnapshotDao.scala index 2d48f86f..11448b2c 100644 --- a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/SnapshotDao.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/SnapshotDao.scala @@ -3,9 +3,9 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.snapshot.dao +package org.apache.pekko.persistence.jdbc.snapshot.dao -import akka.persistence.SnapshotMetadata +import org.apache.pekko.persistence.SnapshotMetadata import scala.concurrent.Future diff --git a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/SnapshotQueries.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/SnapshotQueries.scala similarity index 93% rename from core/src/main/scala/akka/persistence/jdbc/snapshot/dao/SnapshotQueries.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/SnapshotQueries.scala index 8dffdbef..1ea83eec 100644 --- a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/SnapshotQueries.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/SnapshotQueries.scala @@ -3,10 +3,10 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.snapshot.dao +package org.apache.pekko.persistence.jdbc.snapshot.dao -import akka.persistence.jdbc.config.SnapshotTableConfiguration -import akka.persistence.jdbc.snapshot.dao.SnapshotTables.SnapshotRow +import org.apache.pekko.persistence.jdbc.config.SnapshotTableConfiguration +import org.apache.pekko.persistence.jdbc.snapshot.dao.SnapshotTables.SnapshotRow import slick.jdbc.JdbcProfile class SnapshotQueries(val profile: JdbcProfile, override val snapshotTableCfg: SnapshotTableConfiguration) diff --git a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/SnapshotTables.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/SnapshotTables.scala similarity index 87% rename from core/src/main/scala/akka/persistence/jdbc/snapshot/dao/SnapshotTables.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/SnapshotTables.scala index 4a17841d..33edb784 100644 --- a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/SnapshotTables.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/SnapshotTables.scala @@ -3,12 +3,12 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.snapshot.dao +package org.apache.pekko.persistence.jdbc.snapshot.dao -import akka.persistence.jdbc.config.SnapshotTableConfiguration -import akka.persistence.jdbc.snapshot.dao.SnapshotTables.SnapshotRow -import akka.persistence.jdbc.snapshot.dao.legacy.SnapshotTables.isOracleDriver -import akka.persistence.jdbc.util.InputStreamOps.InputStreamImplicits +import org.apache.pekko.persistence.jdbc.config.SnapshotTableConfiguration +import org.apache.pekko.persistence.jdbc.snapshot.dao.SnapshotTables.SnapshotRow +import org.apache.pekko.persistence.jdbc.snapshot.dao.legacy.SnapshotTables.isOracleDriver +import org.apache.pekko.persistence.jdbc.util.InputStreamOps.InputStreamImplicits object SnapshotTables { case class SnapshotRow( diff --git a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/legacy/ByteArraySnapshotDao.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/legacy/ByteArraySnapshotDao.scala similarity index 89% rename from core/src/main/scala/akka/persistence/jdbc/snapshot/dao/legacy/ByteArraySnapshotDao.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/legacy/ByteArraySnapshotDao.scala index 7e409236..5841af49 100644 --- a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/legacy/ByteArraySnapshotDao.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/legacy/ByteArraySnapshotDao.scala @@ -3,14 +3,14 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.snapshot.dao.legacy - -import akka.persistence.SnapshotMetadata -import akka.persistence.jdbc.config.SnapshotConfig -import akka.persistence.jdbc.snapshot.dao.legacy.SnapshotTables.SnapshotRow -import akka.persistence.jdbc.snapshot.dao.SnapshotDao -import akka.serialization.Serialization -import akka.stream.Materializer +package org.apache.pekko.persistence.jdbc.snapshot.dao.legacy + +import org.apache.pekko.persistence.SnapshotMetadata +import org.apache.pekko.persistence.jdbc.config.SnapshotConfig +import org.apache.pekko.persistence.jdbc.snapshot.dao.legacy.SnapshotTables.SnapshotRow +import org.apache.pekko.persistence.jdbc.snapshot.dao.SnapshotDao +import org.apache.pekko.serialization.Serialization +import org.apache.pekko.stream.Materializer import slick.jdbc.{ JdbcBackend, JdbcProfile } import scala.concurrent.{ ExecutionContext, Future } diff --git a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/legacy/ByteArraySnapshotSerializer.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/legacy/ByteArraySnapshotSerializer.scala similarity index 69% rename from core/src/main/scala/akka/persistence/jdbc/snapshot/dao/legacy/ByteArraySnapshotSerializer.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/legacy/ByteArraySnapshotSerializer.scala index 5ab85d42..f77cc147 100644 --- a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/legacy/ByteArraySnapshotSerializer.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/legacy/ByteArraySnapshotSerializer.scala @@ -3,13 +3,13 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.snapshot.dao.legacy +package org.apache.pekko.persistence.jdbc.snapshot.dao.legacy -import akka.persistence.SnapshotMetadata -import akka.persistence.jdbc.serialization.SnapshotSerializer -import akka.persistence.jdbc.snapshot.dao.legacy.SnapshotTables.SnapshotRow -import akka.persistence.serialization.Snapshot -import akka.serialization.Serialization +import org.apache.pekko.persistence.SnapshotMetadata +import org.apache.pekko.persistence.jdbc.serialization.SnapshotSerializer +import org.apache.pekko.persistence.jdbc.snapshot.dao.legacy.SnapshotTables.SnapshotRow +import org.apache.pekko.persistence.serialization.Snapshot +import org.apache.pekko.serialization.Serialization import scala.util.Try diff --git a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/legacy/SnapshotQueries.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/legacy/SnapshotQueries.scala similarity index 93% rename from core/src/main/scala/akka/persistence/jdbc/snapshot/dao/legacy/SnapshotQueries.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/legacy/SnapshotQueries.scala index bc6e8b41..22ebbcee 100644 --- a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/legacy/SnapshotQueries.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/legacy/SnapshotQueries.scala @@ -3,10 +3,10 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.snapshot.dao.legacy +package org.apache.pekko.persistence.jdbc.snapshot.dao.legacy -import akka.persistence.jdbc.config.LegacySnapshotTableConfiguration -import akka.persistence.jdbc.snapshot.dao.legacy.SnapshotTables.SnapshotRow +import org.apache.pekko.persistence.jdbc.config.LegacySnapshotTableConfiguration +import org.apache.pekko.persistence.jdbc.snapshot.dao.legacy.SnapshotTables.SnapshotRow import slick.jdbc.JdbcProfile class SnapshotQueries(val profile: JdbcProfile, override val snapshotTableCfg: LegacySnapshotTableConfiguration) diff --git a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/legacy/SnapshotTables.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/legacy/SnapshotTables.scala similarity index 86% rename from core/src/main/scala/akka/persistence/jdbc/snapshot/dao/legacy/SnapshotTables.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/legacy/SnapshotTables.scala index 81741358..34229b99 100644 --- a/core/src/main/scala/akka/persistence/jdbc/snapshot/dao/legacy/SnapshotTables.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/legacy/SnapshotTables.scala @@ -3,11 +3,11 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.snapshot.dao.legacy +package org.apache.pekko.persistence.jdbc.snapshot.dao.legacy -import akka.persistence.jdbc.config.LegacySnapshotTableConfiguration -import akka.persistence.jdbc.snapshot.dao.legacy.SnapshotTables.{ isOracleDriver, SnapshotRow } -import akka.persistence.jdbc.util.InputStreamOps._ +import org.apache.pekko.persistence.jdbc.config.LegacySnapshotTableConfiguration +import org.apache.pekko.persistence.jdbc.snapshot.dao.legacy.SnapshotTables.{ isOracleDriver, SnapshotRow } +import org.apache.pekko.persistence.jdbc.util.InputStreamOps._ import slick.jdbc.JdbcProfile object SnapshotTables { diff --git a/core/src/main/scala/akka/persistence/jdbc/state/DurableStateQueries.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/DurableStateQueries.scala similarity index 95% rename from core/src/main/scala/akka/persistence/jdbc/state/DurableStateQueries.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/state/DurableStateQueries.scala index 35691e55..51bcf21e 100644 --- a/core/src/main/scala/akka/persistence/jdbc/state/DurableStateQueries.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/DurableStateQueries.scala @@ -3,21 +3,21 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.state +package org.apache.pekko.persistence.jdbc.state -import akka.annotation.InternalApi +import org.apache.pekko.annotation.InternalApi import slick.jdbc.{ JdbcProfile, SetParameter } import slick.jdbc.H2Profile import slick.jdbc.MySQLProfile import slick.jdbc.OracleProfile import slick.jdbc.PostgresProfile import slick.jdbc.SQLServerProfile -import akka.persistence.jdbc.config.DurableStateTableConfiguration +import org.apache.pekko.persistence.jdbc.config.DurableStateTableConfiguration /** * INTERNAL API */ -@InternalApi private[akka] class DurableStateQueries( +@InternalApi private[pekko] class DurableStateQueries( val profile: JdbcProfile, override val durableStateTableCfg: DurableStateTableConfiguration) extends DurableStateTables { diff --git a/core/src/main/scala/akka/persistence/jdbc/state/DurableStateTables.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/DurableStateTables.scala similarity index 87% rename from core/src/main/scala/akka/persistence/jdbc/state/DurableStateTables.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/state/DurableStateTables.scala index cb5dcd4b..20e6a055 100644 --- a/core/src/main/scala/akka/persistence/jdbc/state/DurableStateTables.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/DurableStateTables.scala @@ -3,15 +3,15 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.state +package org.apache.pekko.persistence.jdbc.state -import akka.annotation.InternalApi -import akka.persistence.jdbc.config.DurableStateTableConfiguration +import org.apache.pekko.annotation.InternalApi +import org.apache.pekko.persistence.jdbc.config.DurableStateTableConfiguration /** * INTERNAL API */ -@InternalApi private[akka] object DurableStateTables { +@InternalApi private[pekko] object DurableStateTables { case class DurableStateRow( globalOffset: Long, persistenceId: String, @@ -26,7 +26,7 @@ import akka.persistence.jdbc.config.DurableStateTableConfiguration /** * INTERNAL API */ -@InternalApi private[akka] trait DurableStateTables { +@InternalApi private[pekko] trait DurableStateTables { val profile: slick.jdbc.JdbcProfile import profile.api._ def durableStateTableCfg: DurableStateTableConfiguration diff --git a/core/src/main/scala/akka/persistence/jdbc/state/JdbcDurableStateStoreProvider.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/JdbcDurableStateStoreProvider.scala similarity index 69% rename from core/src/main/scala/akka/persistence/jdbc/state/JdbcDurableStateStoreProvider.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/state/JdbcDurableStateStoreProvider.scala index 6270d74d..46c02a8c 100644 --- a/core/src/main/scala/akka/persistence/jdbc/state/JdbcDurableStateStoreProvider.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/JdbcDurableStateStoreProvider.scala @@ -3,19 +3,19 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.state +package org.apache.pekko.persistence.jdbc.state import scala.concurrent.ExecutionContext import slick.jdbc.JdbcProfile import slick.jdbc.JdbcBackend._ -import akka.actor.ExtendedActorSystem -import akka.persistence.jdbc.config.DurableStateTableConfiguration -import akka.persistence.state.scaladsl.DurableStateStore -import akka.persistence.state.javadsl.{ DurableStateStore => JDurableStateStore } -import akka.persistence.state.DurableStateStoreProvider -import akka.persistence.jdbc.db.{ SlickDatabase, SlickExtension } -import akka.serialization.SerializationExtension -import akka.stream.{ Materializer, SystemMaterializer } +import org.apache.pekko.actor.ExtendedActorSystem +import org.apache.pekko.persistence.jdbc.config.DurableStateTableConfiguration +import org.apache.pekko.persistence.state.scaladsl.DurableStateStore +import org.apache.pekko.persistence.state.javadsl.{ DurableStateStore => JDurableStateStore } +import org.apache.pekko.persistence.state.DurableStateStoreProvider +import org.apache.pekko.persistence.jdbc.db.{ SlickDatabase, SlickExtension } +import org.apache.pekko.serialization.SerializationExtension +import org.apache.pekko.stream.{ Materializer, SystemMaterializer } class JdbcDurableStateStoreProvider[A](system: ExtendedActorSystem) extends DurableStateStoreProvider { diff --git a/core/src/main/scala/akka/persistence/jdbc/state/OffsetOps.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/OffsetOps.scala similarity index 70% rename from core/src/main/scala/akka/persistence/jdbc/state/OffsetOps.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/state/OffsetOps.scala index 78999b0b..163c124a 100644 --- a/core/src/main/scala/akka/persistence/jdbc/state/OffsetOps.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/OffsetOps.scala @@ -3,9 +3,9 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.state +package org.apache.pekko.persistence.jdbc.state -import akka.persistence.query._ +import org.apache.pekko.persistence.query._ object OffsetSyntax { implicit class OffsetOps(val that: Offset) extends AnyVal { def value = @@ -14,7 +14,7 @@ object OffsetSyntax { case NoOffset => 0L case _ => throw new IllegalArgumentException( - "akka-persistence-jdbc does not support " + that.getClass.getName + " offsets") + "pekko-persistence-jdbc does not support " + that.getClass.getName + " offsets") } } } diff --git a/core/src/main/scala/akka/persistence/jdbc/state/SequenceNextValUpdater.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/SequenceNextValUpdater.scala similarity index 90% rename from core/src/main/scala/akka/persistence/jdbc/state/SequenceNextValUpdater.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/state/SequenceNextValUpdater.scala index f0923ab2..f5861742 100644 --- a/core/src/main/scala/akka/persistence/jdbc/state/SequenceNextValUpdater.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/SequenceNextValUpdater.scala @@ -3,10 +3,10 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.state +package org.apache.pekko.persistence.jdbc.state -import akka.annotation.InternalApi -import akka.persistence.jdbc.config.DurableStateTableConfiguration +import org.apache.pekko.annotation.InternalApi +import org.apache.pekko.persistence.jdbc.config.DurableStateTableConfiguration import slick.jdbc.JdbcProfile import slick.dbio.Effect import slick.sql.SqlStreamingAction diff --git a/core/src/main/scala/akka/persistence/jdbc/state/javadsl/JdbcDurableStateStore.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/javadsl/JdbcDurableStateStore.scala similarity index 63% rename from core/src/main/scala/akka/persistence/jdbc/state/javadsl/JdbcDurableStateStore.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/state/javadsl/JdbcDurableStateStore.scala index 8ebdfe53..f5278f35 100644 --- a/core/src/main/scala/akka/persistence/jdbc/state/javadsl/JdbcDurableStateStore.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/javadsl/JdbcDurableStateStore.scala @@ -3,24 +3,22 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.state.javadsl +package org.apache.pekko.persistence.jdbc.state.javadsl import java.util.Optional import java.util.concurrent.CompletionStage - import scala.compat.java8.FutureConverters._ import scala.concurrent.ExecutionContext - -import akka.annotation.ApiMayChange +import org.apache.pekko.annotation.ApiMayChange +import org.apache.pekko.{ Done, NotUsed } +import org.apache.pekko.persistence.jdbc.state.DurableStateQueries +import org.apache.pekko.persistence.jdbc.config.DurableStateTableConfiguration +import org.apache.pekko.persistence.jdbc.state.scaladsl.{ JdbcDurableStateStore => ScalaJdbcDurableStateStore } +import org.apache.pekko.persistence.query.{ DurableStateChange, Offset } +import org.apache.pekko.persistence.query.javadsl.DurableStateStoreQuery +import org.apache.pekko.persistence.state.javadsl.{ DurableStateUpdateStore, GetObjectResult } +import org.apache.pekko.stream.javadsl.Source import slick.jdbc.JdbcProfile -import akka.{ Done, NotUsed } -import akka.persistence.state.javadsl.{ DurableStateUpdateStore, GetObjectResult } -import akka.persistence.jdbc.state.DurableStateQueries -import akka.persistence.jdbc.config.DurableStateTableConfiguration -import akka.persistence.jdbc.state.scaladsl.{ JdbcDurableStateStore => ScalaJdbcDurableStateStore } -import akka.persistence.query.{ DurableStateChange, Offset } -import akka.persistence.query.javadsl.DurableStateStoreQuery -import akka.stream.javadsl.Source object JdbcDurableStateStore { val Identifier = ScalaJdbcDurableStateStore.Identifier @@ -33,7 +31,7 @@ object JdbcDurableStateStore { class JdbcDurableStateStore[A]( profile: JdbcProfile, durableStateConfig: DurableStateTableConfiguration, - scalaStore: akka.persistence.jdbc.state.scaladsl.JdbcDurableStateStore[A])(implicit ec: ExecutionContext) + scalaStore: ScalaJdbcDurableStateStore[A])(implicit ec: ExecutionContext) extends DurableStateUpdateStore[A] with DurableStateStoreQuery[A] { @@ -51,6 +49,9 @@ class JdbcDurableStateStore[A]( def deleteObject(persistenceId: String): CompletionStage[Done] = toJava(scalaStore.deleteObject(persistenceId)) + def deleteObject(persistenceId: String, revision: Long): CompletionStage[Done] = + toJava(scalaStore.deleteObject(persistenceId, revision)) + def currentChanges(tag: String, offset: Offset): Source[DurableStateChange[A], NotUsed] = scalaStore.currentChanges(tag, offset).asJava diff --git a/core/src/main/scala/akka/persistence/jdbc/state/scaladsl/DurableStateSequenceActor.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/DurableStateSequenceActor.scala similarity index 96% rename from core/src/main/scala/akka/persistence/jdbc/state/scaladsl/DurableStateSequenceActor.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/DurableStateSequenceActor.scala index fbb62208..ffd6932a 100644 --- a/core/src/main/scala/akka/persistence/jdbc/state/scaladsl/DurableStateSequenceActor.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/DurableStateSequenceActor.scala @@ -3,23 +3,23 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.state.scaladsl +package org.apache.pekko.persistence.jdbc.state.scaladsl import scala.collection.immutable.NumericRange -import akka.actor.{ Actor, ActorLogging, Props, Status, Timers } -import akka.pattern.pipe -import akka.persistence.jdbc.config.DurableStateSequenceRetrievalConfig -import akka.stream.Materializer -import akka.stream.scaladsl.Sink +import org.apache.pekko.actor.{ Actor, ActorLogging, Props, Status, Timers } +import org.apache.pekko.pattern.pipe +import org.apache.pekko.persistence.jdbc.config.DurableStateSequenceRetrievalConfig +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.scaladsl.Sink import scala.concurrent.duration.FiniteDuration -import akka.annotation.InternalApi +import org.apache.pekko.annotation.InternalApi /** * INTERNAL API */ -@InternalApi private[akka] object DurableStateSequenceActor { +@InternalApi private[pekko] object DurableStateSequenceActor { def props[A](stateStore: JdbcDurableStateStore[A], config: DurableStateSequenceRetrievalConfig)( implicit materializer: Materializer): Props = Props(new DurableStateSequenceActor(stateStore, config)) @@ -104,7 +104,7 @@ import akka.annotation.InternalApi * INTERNAL API */ @InternalApi -private[akka] class DurableStateSequenceActor[A]( +private[pekko] class DurableStateSequenceActor[A]( stateStore: JdbcDurableStateStore[A], config: DurableStateSequenceRetrievalConfig)(implicit materializer: Materializer) extends Actor diff --git a/core/src/main/scala/akka/persistence/jdbc/state/scaladsl/JdbcDurableStateStore.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/JdbcDurableStateStore.scala similarity index 81% rename from core/src/main/scala/akka/persistence/jdbc/state/scaladsl/JdbcDurableStateStore.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/JdbcDurableStateStore.scala index 188d7255..cb49f98f 100644 --- a/core/src/main/scala/akka/persistence/jdbc/state/scaladsl/JdbcDurableStateStore.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/JdbcDurableStateStore.scala @@ -3,32 +3,32 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.state.scaladsl +package org.apache.pekko.persistence.jdbc.state.scaladsl import scala.concurrent.{ ExecutionContext, Future } import scala.concurrent.duration._ import scala.util.Try import slick.jdbc.{ JdbcBackend, JdbcProfile } -import akka.{ Done, NotUsed } -import akka.actor.ExtendedActorSystem -import akka.pattern.ask -import akka.persistence.state.scaladsl.{ DurableStateUpdateStore, GetObjectResult } -import akka.persistence.jdbc.AkkaSerialization -import akka.persistence.jdbc.state.DurableStateQueries -import akka.persistence.jdbc.config.DurableStateTableConfiguration -import akka.persistence.jdbc.state.{ DurableStateTables, OffsetSyntax } -import akka.persistence.query.{ DurableStateChange, Offset } -import akka.persistence.query.scaladsl.DurableStateStoreQuery -import akka.persistence.jdbc.journal.dao.FlowControl -import akka.serialization.Serialization -import akka.stream.scaladsl.{ Sink, Source } -import akka.stream.{ Materializer, SystemMaterializer } -import akka.util.Timeout +import org.apache.pekko.{ Done, NotUsed } +import org.apache.pekko.actor.ExtendedActorSystem +import org.apache.pekko.pattern.ask +import org.apache.pekko.persistence.state.scaladsl.{ DurableStateUpdateStore, GetObjectResult } +import org.apache.pekko.persistence.jdbc.PekkoSerialization +import org.apache.pekko.persistence.jdbc.state.DurableStateQueries +import org.apache.pekko.persistence.jdbc.config.DurableStateTableConfiguration +import org.apache.pekko.persistence.jdbc.state.{ DurableStateTables, OffsetSyntax } +import org.apache.pekko.persistence.query.{ DurableStateChange, Offset } +import org.apache.pekko.persistence.query.scaladsl.DurableStateStoreQuery +import org.apache.pekko.persistence.jdbc.journal.dao.FlowControl +import org.apache.pekko.serialization.Serialization +import org.apache.pekko.stream.scaladsl.{ Sink, Source } +import org.apache.pekko.stream.{ Materializer, SystemMaterializer } +import org.apache.pekko.util.Timeout import DurableStateSequenceActor._ import OffsetSyntax._ -import akka.annotation.ApiMayChange -import akka.persistence.query.UpdatedDurableState +import org.apache.pekko.annotation.ApiMayChange +import org.apache.pekko.persistence.query.UpdatedDurableState object JdbcDurableStateStore { val Identifier = "jdbc-durable-state-store" @@ -56,14 +56,14 @@ class JdbcDurableStateStore[A]( // Started lazily to prevent the actor for querying the db if no changesByTag queries are used private[jdbc] lazy val stateSequenceActor = system.systemActorOf( DurableStateSequenceActor.props(this, durableStateConfig.stateSequenceConfig), - s"akka-persistence-jdbc-durable-state-sequence-actor") + s"pekko-persistence-jdbc-durable-state-sequence-actor") def getObject(persistenceId: String): Future[GetObjectResult[A]] = { db.run(queries.selectFromDbByPersistenceId(persistenceId).result).map { rows => rows.headOption match { case Some(row) => GetObjectResult( - AkkaSerialization.fromDurableStateRow(serialization)(row).toOption.asInstanceOf[Option[A]], + PekkoSerialization.fromDurableStateRow(serialization)(row).toOption.asInstanceOf[Option[A]], row.revision) case None => @@ -75,7 +75,7 @@ class JdbcDurableStateStore[A]( def upsertObject(persistenceId: String, revision: Long, value: A, tag: String): Future[Done] = { require(revision > 0) val row = - AkkaSerialization.serialize(serialization, value).map { serialized => + PekkoSerialization.serialize(serialization, value).map { serialized => DurableStateTables.DurableStateRow( 0, // insert 0 for autoinc columns persistenceId, @@ -104,6 +104,9 @@ class JdbcDurableStateStore[A]( def deleteObject(persistenceId: String): Future[Done] = db.run(queries.deleteFromDb(persistenceId).map(_ => Done)) + def deleteObject(persistenceId: String, revision: Long): Future[Done] = + db.run(queries.deleteFromDb(persistenceId).map(_ => Done)) + def currentChanges(tag: String, offset: Offset): Source[DurableStateChange[A], NotUsed] = { Source .futureSource(maxStateStoreOffset().map { maxOrderingInDb => @@ -180,7 +183,7 @@ class JdbcDurableStateStore[A]( case Stop => Future.successful(None) case Continue => retrieveNextBatch() case ContinueDelayed => - akka.pattern.after(durableStateConfig.refreshInterval, system.scheduler)(retrieveNextBatch()) + org.apache.pekko.pattern.after(durableStateConfig.refreshInterval, system.scheduler)(retrieveNextBatch()) } } .mapConcat(identity) @@ -193,7 +196,7 @@ class JdbcDurableStateStore[A]( Source.fromPublisher(db.stream(queries.stateStoreStateQuery((offset, limit)).result)) private def toDurableStateChange(row: DurableStateTables.DurableStateRow): Try[DurableStateChange[A]] = { - AkkaSerialization + PekkoSerialization .fromDurableStateRow(serialization)(row) .map(payload => new UpdatedDurableState( diff --git a/core/src/main/scala/akka/persistence/jdbc/testkit/internal/SchemaType.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/testkit/internal/SchemaType.scala similarity index 86% rename from core/src/main/scala/akka/persistence/jdbc/testkit/internal/SchemaType.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/testkit/internal/SchemaType.scala index ef05746d..6ce51766 100644 --- a/core/src/main/scala/akka/persistence/jdbc/testkit/internal/SchemaType.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/testkit/internal/SchemaType.scala @@ -3,9 +3,9 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.testkit.internal +package org.apache.pekko.persistence.jdbc.testkit.internal -import akka.annotation.InternalApi +import org.apache.pekko.annotation.InternalApi /** * INTERNAL API diff --git a/core/src/main/scala/akka/persistence/jdbc/testkit/internal/SchemaUtilsImpl.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/testkit/internal/SchemaUtilsImpl.scala similarity index 92% rename from core/src/main/scala/akka/persistence/jdbc/testkit/internal/SchemaUtilsImpl.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/testkit/internal/SchemaUtilsImpl.scala index 8086d4b7..a248cdbd 100644 --- a/core/src/main/scala/akka/persistence/jdbc/testkit/internal/SchemaUtilsImpl.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/testkit/internal/SchemaUtilsImpl.scala @@ -3,17 +3,17 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.testkit.internal +package org.apache.pekko.persistence.jdbc.testkit.internal import java.sql.Statement import scala.concurrent.Future -import akka.Done -import akka.actor.ClassicActorSystemProvider -import akka.annotation.InternalApi -import akka.dispatch.Dispatchers -import akka.persistence.jdbc.db.SlickDatabase -import akka.persistence.jdbc.db.SlickExtension +import org.apache.pekko.Done +import org.apache.pekko.actor.ClassicActorSystemProvider +import org.apache.pekko.annotation.InternalApi +import org.apache.pekko.dispatch.Dispatchers +import org.apache.pekko.persistence.jdbc.db.SlickDatabase +import org.apache.pekko.persistence.jdbc.db.SlickExtension import com.typesafe.config.Config import org.slf4j.Logger import slick.jdbc.H2Profile @@ -31,7 +31,7 @@ import slick.jdbc.SQLServerProfile private[jdbc] object SchemaUtilsImpl { def legacy(configKey: String, config: Config): Boolean = - config.getConfig(configKey).getString("dao") != "akka.persistence.jdbc.journal.dao.DefaultJournalDao" + config.getConfig(configKey).getString("dao") != "org.apache.pekko.persistence.jdbc.journal.dao.DefaultJournalDao" /** * INTERNAL API diff --git a/core/src/main/scala/akka/persistence/jdbc/testkit/javadsl/SchemaUtils.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/testkit/javadsl/SchemaUtils.scala similarity index 67% rename from core/src/main/scala/akka/persistence/jdbc/testkit/javadsl/SchemaUtils.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/testkit/javadsl/SchemaUtils.scala index f0bd1a38..cc2cf60f 100644 --- a/core/src/main/scala/akka/persistence/jdbc/testkit/javadsl/SchemaUtils.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/testkit/javadsl/SchemaUtils.scala @@ -3,34 +3,34 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.testkit.javadsl +package org.apache.pekko.persistence.jdbc.testkit.javadsl import java.util.concurrent.CompletionStage import scala.compat.java8.FutureConverters._ -import akka.Done -import akka.actor.ClassicActorSystemProvider -import akka.annotation.ApiMayChange -import akka.persistence.jdbc.testkit.internal.SchemaUtilsImpl +import org.apache.pekko.Done +import org.apache.pekko.actor.ClassicActorSystemProvider +import org.apache.pekko.annotation.ApiMayChange +import org.apache.pekko.persistence.jdbc.testkit.internal.SchemaUtilsImpl import org.slf4j.LoggerFactory object SchemaUtils { - private val logger = LoggerFactory.getLogger("akka.persistence.jdbc.testkit.javadsl.SchemaUtils") + private val logger = LoggerFactory.getLogger("org.apache.pekko.persistence.jdbc.testkit.javadsl.SchemaUtils") /** * Drops the schema for both the journal and the snapshot table using the default schema definition. * * For information about the different schemas and supported databases consult - * https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#database-schema + * https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#database-schema * * This utility method is intended to be used for testing only. * For production, it's recommended to run any DDL statements before the system is started. * * This method will automatically detects the configured database using the settings from `jdbc-journal` config. - * If configured with `use-shared-db`, it will use the `akka-persistence-jdbc.shared-databases` definition instead. - * See https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. + * If configured with `use-shared-db`, it will use the `pekko-persistence-jdbc.shared-databases` definition instead. + * See https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. */ @ApiMayChange def dropIfExists(actorSystem: ClassicActorSystemProvider): CompletionStage[Done] = @@ -40,14 +40,14 @@ object SchemaUtils { * Drops the schema for both the journal and the snapshot table using the default schema definition. * * For information about the different schemas and supported databases consult - * https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#database-schema + * https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#database-schema * * This utility method is intended to be used for testing only. * For production, it's recommended to run any DDL statements before the system is started. * * This method will automatically detects the configured database using the settings from `configKey` config. - * If configured with `use-shared-db`, it will use the `akka-persistence-jdbc.shared-databases` definition instead. - * See https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. + * If configured with `use-shared-db`, it will use the `pekko-persistence-jdbc.shared-databases` definition instead. + * See https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. * * @param configKey the database journal configuration key to use. */ @@ -59,14 +59,14 @@ object SchemaUtils { * Creates the schema for both the journal and the snapshot table using the default schema definition. * * For information about the different schemas and supported databases consult - * https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#database-schema + * https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#database-schema * * This utility method is intended to be used for testing only. * For production, it's recommended to create run DDL statements before the system is started. * * This method will automatically detects the configured database using the settings from `jdbc-journal` config. - * If configured with `use-shared-db`, it will use the `akka-persistence-jdbc.shared-databases` definition instead. - * See https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. + * If configured with `use-shared-db`, it will use the `pekko-persistence-jdbc.shared-databases` definition instead. + * See https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. */ @ApiMayChange def createIfNotExists(actorSystem: ClassicActorSystemProvider): CompletionStage[Done] = @@ -76,14 +76,14 @@ object SchemaUtils { * Creates the schema for both the journal and the snapshot table using the default schema definition. * * For information about the different schemas and supported databases consult - * https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#database-schema + * https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#database-schema * * This utility method is intended to be used for testing only. * For production, it's recommended to create run DDL statements before the system is started. * * This method will automatically detects the configured database using the settings from `configKey` config. - * If configured with `use-shared-db`, it will use the `akka-persistence-jdbc.shared-databases` definition instead. - * See https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. + * If configured with `use-shared-db`, it will use the `pekko-persistence-jdbc.shared-databases` definition instead. + * See https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. * * @param configKey the database journal configuration key to use. */ @@ -97,8 +97,8 @@ object SchemaUtils { * This utility method is intended to be used for testing only. * For production, it's recommended to run any DDL statements before the system is started. * - * It will use the database settings found under `jdbc-journal`, or `akka-persistence-jdbc.shared-databases` if configured so. - * See https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. + * It will use the database settings found under `jdbc-journal`, or `pekko-persistence-jdbc.shared-databases` if configured so. + * See https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. * * @param script the DDL script. The passed script can contain more then one SQL statements separated by a ; (semi-colon). */ @@ -112,8 +112,8 @@ object SchemaUtils { * This utility method is intended to be used for testing only. * For production, it's recommended to run any DDL statements before the system is started. * - * It will use the database settings found under `configKey`, or `akka-persistence-jdbc.shared-databases` if configured so. - * See https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. + * It will use the database settings found under `configKey`, or `pekko-persistence-jdbc.shared-databases` if configured so. + * See https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. * * @param script the DDL script. The passed `script` can contain more then one SQL statements. * @param separator used to separate the different DDL statements. diff --git a/core/src/main/scala/akka/persistence/jdbc/testkit/scaladsl/SchemaUtils.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/testkit/scaladsl/SchemaUtils.scala similarity index 66% rename from core/src/main/scala/akka/persistence/jdbc/testkit/scaladsl/SchemaUtils.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/testkit/scaladsl/SchemaUtils.scala index dbe086bf..2fad712d 100644 --- a/core/src/main/scala/akka/persistence/jdbc/testkit/scaladsl/SchemaUtils.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/testkit/scaladsl/SchemaUtils.scala @@ -3,32 +3,32 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.testkit.scaladsl +package org.apache.pekko.persistence.jdbc.testkit.scaladsl import scala.concurrent.Future -import akka.Done -import akka.actor.ClassicActorSystemProvider -import akka.annotation.ApiMayChange -import akka.persistence.jdbc.testkit.internal.SchemaUtilsImpl +import org.apache.pekko.Done +import org.apache.pekko.actor.ClassicActorSystemProvider +import org.apache.pekko.annotation.ApiMayChange +import org.apache.pekko.persistence.jdbc.testkit.internal.SchemaUtilsImpl import org.slf4j.LoggerFactory object SchemaUtils { - private val logger = LoggerFactory.getLogger("akka.persistence.jdbc.testkit.scaladsl.SchemaUtils") + private val logger = LoggerFactory.getLogger("org.apache.pekko.persistence.jdbc.testkit.scaladsl.SchemaUtils") /** * Drops the schema for both the journal and the snapshot table using the default schema definition. * * For information about the different schemas and supported databases consult - * https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#database-schema + * https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#database-schema * * This utility method is intended to be used for testing only. * For production, it's recommended to run any DDL statements before the system is started. * * This method will automatically detects the configured database using the settings from `jdbc-journal` config. - * If configured with `use-shared-db`, it will use the `akka-persistence-jdbc.shared-databases` definition instead. - * See https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. + * If configured with `use-shared-db`, it will use the `pekko-persistence-jdbc.shared-databases` definition instead. + * See https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. */ @ApiMayChange def dropIfExists()(implicit actorSystem: ClassicActorSystemProvider): Future[Done] = @@ -38,14 +38,14 @@ object SchemaUtils { * Drops the schema for both the journal and the snapshot table using the default schema definition. * * For information about the different schemas and supported databases consult - * https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#database-schema + * https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#database-schema * * This utility method is intended to be used for testing only. * For production, it's recommended to run any DDL statements before the system is started. * * This method will automatically detects the configured database using the settings from `configKey` config. - * If configured with `use-shared-db`, it will use the `akka-persistence-jdbc.shared-databases` definition instead. - * See https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. + * If configured with `use-shared-db`, it will use the `pekko-persistence-jdbc.shared-databases` definition instead. + * See https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. * * @param configKey the database journal configuration key to use. */ @@ -57,14 +57,14 @@ object SchemaUtils { * Creates the schema for both the journal and the snapshot table using the default schema definition. * * For information about the different schemas and supported databases consult - * https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#database-schema + * https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#database-schema * * This utility method is intended to be used for testing only. * For production, it's recommended to run any DDL statements before the system is started. * * This method will automatically detects the configured database using the settings from `jdbc-journal` config. - * If configured with `use-shared-db`, it will use the `akka-persistence-jdbc.shared-databases` definition instead. - * See https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. + * If configured with `use-shared-db`, it will use the `pekko-persistence-jdbc.shared-databases` definition instead. + * See https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. */ @ApiMayChange def createIfNotExists()(implicit actorSystem: ClassicActorSystemProvider): Future[Done] = @@ -74,14 +74,14 @@ object SchemaUtils { * Creates the schema for both the journal and the snapshot table using the default schema definition. * * For information about the different schemas and supported databases consult - * https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#database-schema + * https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#database-schema * * This utility method is intended to be used for testing only. * For production, it's recommended to run any DDL statements before the system is started. * * This method will automatically detects the configured database using the settings from `configKey` config. - * If configured with `use-shared-db`, it will use the `akka-persistence-jdbc.shared-databases` definition instead. - * See https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. + * If configured with `use-shared-db`, it will use the `pekko-persistence-jdbc.shared-databases` definition instead. + * See https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. * * @param configKey the database journal configuration key to use. */ @@ -95,8 +95,8 @@ object SchemaUtils { * This utility method is intended to be used for testing only. * For production, it's recommended to run any DDL statements before the system is started. * - * It will use the database settings found under `jdbc-journal`, or `akka-persistence-jdbc.shared-databases` if configured so. - * See https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. + * It will use the database settings found under `jdbc-journal`, or `pekko-persistence-jdbc.shared-databases` if configured so. + * See https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. * * @param script the DDL script. The passed script can contain more then one SQL statements separated by a ; (semi-colon). */ @@ -110,8 +110,8 @@ object SchemaUtils { * This utility method is intended to be used for testing only. * For production, it's recommended to create the table with DDL statements before the system is started. * - * It will use the database settings found under `configKey`, or `akka-persistence-jdbc.shared-databases` if configured so. - * See https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. + * It will use the database settings found under `configKey`, or `pekko-persistence-jdbc.shared-databases` if configured so. + * See https://pekko.apache.org/docs/pekko-persistence-jdbc/current/index.html#sharing-the-database-connection-pool-between-the-journals for details. * * @param script the DDL script. The passed `script` can contain more then one SQL statements. * @param separator used to separate the different DDL statements. diff --git a/core/src/main/scala/akka/persistence/jdbc/util/BlockingOps.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/util/BlockingOps.scala similarity index 92% rename from core/src/main/scala/akka/persistence/jdbc/util/BlockingOps.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/util/BlockingOps.scala index 8aa1c784..75764024 100644 --- a/core/src/main/scala/akka/persistence/jdbc/util/BlockingOps.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/util/BlockingOps.scala @@ -3,7 +3,7 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.util +package org.apache.pekko.persistence.jdbc.util import scala.concurrent.duration.{ FiniteDuration, _ } import scala.concurrent.{ Await, Future } diff --git a/core/src/main/scala/akka/persistence/jdbc/util/ByteArrayOps.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/util/ByteArrayOps.scala similarity index 90% rename from core/src/main/scala/akka/persistence/jdbc/util/ByteArrayOps.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/util/ByteArrayOps.scala index 0777dcca..8f767785 100644 --- a/core/src/main/scala/akka/persistence/jdbc/util/ByteArrayOps.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/util/ByteArrayOps.scala @@ -3,7 +3,7 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.util +package org.apache.pekko.persistence.jdbc.util import java.io.{ ByteArrayInputStream, InputStream } import java.util.Base64 diff --git a/core/src/main/scala/akka/persistence/jdbc/util/ConfigOps.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/util/ConfigOps.scala similarity index 93% rename from core/src/main/scala/akka/persistence/jdbc/util/ConfigOps.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/util/ConfigOps.scala index 363230da..09e45b2b 100644 --- a/core/src/main/scala/akka/persistence/jdbc/util/ConfigOps.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/util/ConfigOps.scala @@ -3,7 +3,7 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.util +package org.apache.pekko.persistence.jdbc.util import com.typesafe.config.Config diff --git a/core/src/main/scala/akka/persistence/jdbc/util/InputStreamOps.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/util/InputStreamOps.scala similarity index 95% rename from core/src/main/scala/akka/persistence/jdbc/util/InputStreamOps.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/util/InputStreamOps.scala index 03a708d2..3c2025ab 100644 --- a/core/src/main/scala/akka/persistence/jdbc/util/InputStreamOps.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/util/InputStreamOps.scala @@ -3,7 +3,7 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.util +package org.apache.pekko.persistence.jdbc.util import java.io.{ ByteArrayOutputStream, InputStream } diff --git a/core/src/main/scala/org/apache/pekko/persistence/jdbc/util/PluginVersionChecker.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/util/PluginVersionChecker.scala new file mode 100644 index 00000000..4981df81 --- /dev/null +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/util/PluginVersionChecker.scala @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2014 - 2019 Dennis Vriend + * Copyright (C) 2019 - 2021 Lightbend Inc. + */ + +package org.apache.pekko.persistence.jdbc.util + +import org.apache.pekko.annotation.InternalApi + +@InternalApi +private[jdbc] object PluginVersionChecker { + def check(): Unit = + try { + Class.forName("org.apache.pekko.persistence.jdbc.util.DefaultSlickDatabaseProvider") + throw new RuntimeException( + "Old version of Apache Pekko Persistence JDBC found on the classpath. Remove `com.github.dnvriend:pekko-persistence-jdbc` from the classpath..") + } catch { + case _: ClassNotFoundException => + // All good! That's intentional. + // It's good if we don't have pekko.persistence.jdbc.util.DefaultSlickDatabaseProvider around + } +} diff --git a/core/src/main/scala/akka/persistence/jdbc/util/StringOps.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/util/StringOps.scala similarity index 87% rename from core/src/main/scala/akka/persistence/jdbc/util/StringOps.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/util/StringOps.scala index e8b65655..6e0d764c 100644 --- a/core/src/main/scala/akka/persistence/jdbc/util/StringOps.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/util/StringOps.scala @@ -3,7 +3,7 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.util +package org.apache.pekko.persistence.jdbc.util import java.util.Base64 diff --git a/core/src/main/scala/akka/persistence/jdbc/util/TrySeq.scala b/core/src/main/scala/org/apache/pekko/persistence/jdbc/util/TrySeq.scala similarity index 93% rename from core/src/main/scala/akka/persistence/jdbc/util/TrySeq.scala rename to core/src/main/scala/org/apache/pekko/persistence/jdbc/util/TrySeq.scala index 8849bf35..e743c793 100644 --- a/core/src/main/scala/akka/persistence/jdbc/util/TrySeq.scala +++ b/core/src/main/scala/org/apache/pekko/persistence/jdbc/util/TrySeq.scala @@ -3,7 +3,7 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.util +package org.apache.pekko.persistence.jdbc.util import scala.collection.immutable._ import scala.util.{ Failure, Success, Try } diff --git a/core/src/test/java/akka/persistence/jdbc/JavadslSnippets.java b/core/src/test/java/org/apache/pekko/persistence/jdbc/JavadslSnippets.java similarity index 71% rename from core/src/test/java/akka/persistence/jdbc/JavadslSnippets.java rename to core/src/test/java/org/apache/pekko/persistence/jdbc/JavadslSnippets.java index 73fb3f8e..b0c02729 100644 --- a/core/src/test/java/akka/persistence/jdbc/JavadslSnippets.java +++ b/core/src/test/java/org/apache/pekko/persistence/jdbc/JavadslSnippets.java @@ -3,34 +3,34 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc; +package org.apache.pekko.persistence.jdbc; -import akka.Done; -import akka.NotUsed; -import akka.actor.ActorSystem; +import org.apache.pekko.Done; +import org.apache.pekko.NotUsed; +import org.apache.pekko.actor.ActorSystem; // #create -import akka.persistence.jdbc.testkit.javadsl.SchemaUtils; +import org.apache.pekko.persistence.jdbc.testkit.javadsl.SchemaUtils; // #create // #read-journal -import akka.persistence.query.*; -import akka.persistence.jdbc.query.javadsl.JdbcReadJournal; +import org.apache.pekko.persistence.query.*; +import org.apache.pekko.persistence.jdbc.query.javadsl.JdbcReadJournal; // #read-journal // #persistence-ids -import akka.stream.javadsl.Source; -import akka.persistence.query.PersistenceQuery; -import akka.persistence.jdbc.query.javadsl.JdbcReadJournal; +import org.apache.pekko.stream.javadsl.Source; +import org.apache.pekko.persistence.query.PersistenceQuery; +import org.apache.pekko.persistence.jdbc.query.javadsl.JdbcReadJournal; // #persistence-ids // #events-by-persistence-id -import akka.stream.javadsl.Source; -import akka.persistence.query.PersistenceQuery; -import akka.persistence.query.EventEnvelope; -import akka.persistence.jdbc.query.javadsl.JdbcReadJournal; +import org.apache.pekko.stream.javadsl.Source; +import org.apache.pekko.persistence.query.PersistenceQuery; +import org.apache.pekko.persistence.query.EventEnvelope; +import org.apache.pekko.persistence.jdbc.query.javadsl.JdbcReadJournal; // #events-by-persistence-id // #events-by-tag -import akka.stream.javadsl.Source; -import akka.persistence.query.PersistenceQuery; -import akka.persistence.query.EventEnvelope; -import akka.persistence.jdbc.query.javadsl.JdbcReadJournal; +import org.apache.pekko.stream.javadsl.Source; +import org.apache.pekko.persistence.query.PersistenceQuery; +import org.apache.pekko.persistence.query.EventEnvelope; +import org.apache.pekko.persistence.jdbc.query.javadsl.JdbcReadJournal; // #events-by-tag import java.util.concurrent.CompletionStage; diff --git a/core/src/test/java/akka/persistence/jdbc/state/JavadslSnippets.java b/core/src/test/java/org/apache/pekko/persistence/jdbc/state/JavadslSnippets.java similarity index 71% rename from core/src/test/java/akka/persistence/jdbc/state/JavadslSnippets.java rename to core/src/test/java/org/apache/pekko/persistence/jdbc/state/JavadslSnippets.java index 1267444c..b82bbda6 100644 --- a/core/src/test/java/akka/persistence/jdbc/state/JavadslSnippets.java +++ b/core/src/test/java/org/apache/pekko/persistence/jdbc/state/JavadslSnippets.java @@ -1,45 +1,45 @@ -package akka.persistence.jdbc.state; +package org.apache.pekko.persistence.jdbc.state; import java.util.concurrent.CompletionStage; -import akka.actor.ActorSystem; -import akka.Done; -import akka.NotUsed; +import org.apache.pekko.actor.ActorSystem; +import org.apache.pekko.Done; +import org.apache.pekko.NotUsed; // #create -import akka.persistence.jdbc.testkit.javadsl.SchemaUtils; +import org.apache.pekko.persistence.jdbc.testkit.javadsl.SchemaUtils; // #create // #jdbc-durable-state-store -import akka.persistence.state.DurableStateStoreRegistry; -import akka.persistence.jdbc.state.javadsl.JdbcDurableStateStore; +import org.apache.pekko.persistence.state.DurableStateStoreRegistry; +import org.apache.pekko.persistence.jdbc.state.javadsl.JdbcDurableStateStore; // #jdbc-durable-state-store // #get-object -import akka.persistence.state.DurableStateStoreRegistry; -import akka.persistence.jdbc.state.javadsl.JdbcDurableStateStore; -import akka.persistence.state.javadsl.GetObjectResult; +import org.apache.pekko.persistence.state.DurableStateStoreRegistry; +import org.apache.pekko.persistence.jdbc.state.javadsl.JdbcDurableStateStore; +import org.apache.pekko.persistence.state.javadsl.GetObjectResult; // #get-object // #upsert-get-object -import akka.persistence.state.DurableStateStoreRegistry; -import akka.persistence.jdbc.state.javadsl.JdbcDurableStateStore; -import akka.persistence.state.javadsl.GetObjectResult; +import org.apache.pekko.persistence.state.DurableStateStoreRegistry; +import org.apache.pekko.persistence.jdbc.state.javadsl.JdbcDurableStateStore; +import org.apache.pekko.persistence.state.javadsl.GetObjectResult; // #upsert-get-object // #delete-object -import akka.persistence.state.DurableStateStoreRegistry; -import akka.persistence.jdbc.state.javadsl.JdbcDurableStateStore; +import org.apache.pekko.persistence.state.DurableStateStoreRegistry; +import org.apache.pekko.persistence.jdbc.state.javadsl.JdbcDurableStateStore; // #delete-object // #current-changes -import akka.NotUsed; -import akka.stream.javadsl.Source; -import akka.persistence.state.DurableStateStoreRegistry; -import akka.persistence.jdbc.state.javadsl.JdbcDurableStateStore; -import akka.persistence.query.DurableStateChange; -import akka.persistence.query.NoOffset; +import org.apache.pekko.NotUsed; +import org.apache.pekko.stream.javadsl.Source; +import org.apache.pekko.persistence.state.DurableStateStoreRegistry; +import org.apache.pekko.persistence.jdbc.state.javadsl.JdbcDurableStateStore; +import org.apache.pekko.persistence.query.DurableStateChange; +import org.apache.pekko.persistence.query.NoOffset; // #current-changes // #changes -import akka.NotUsed; -import akka.stream.javadsl.Source; -import akka.persistence.state.DurableStateStoreRegistry; -import akka.persistence.jdbc.state.javadsl.JdbcDurableStateStore; -import akka.persistence.query.DurableStateChange; -import akka.persistence.query.NoOffset; +import org.apache.pekko.NotUsed; +import org.apache.pekko.stream.javadsl.Source; +import org.apache.pekko.persistence.state.DurableStateStoreRegistry; +import org.apache.pekko.persistence.jdbc.state.javadsl.JdbcDurableStateStore; +import org.apache.pekko.persistence.query.DurableStateChange; +import org.apache.pekko.persistence.query.NoOffset; // #changes final class JavadslSnippets { diff --git a/core/src/test/resources/general.conf b/core/src/test/resources/general.conf index ba9873cf..16108ed2 100644 --- a/core/src/test/resources/general.conf +++ b/core/src/test/resources/general.conf @@ -12,17 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -// This file contains the general settings which are shared in all akka-persistence-jdbc tests +// This file contains the general settings which are shared in all pekko-persistence-jdbc tests -akka { +pekko { stdout-loglevel = off // defaults to WARNING can be disabled with off. The stdout-loglevel is only in effect during system startup and shutdown log-dead-letters-during-shutdown = on loglevel = debug log-dead-letters = on log-config-on-start = off // Log the complete configuration at INFO level when the actor system is started - loggers = ["akka.event.slf4j.Slf4jLogger"] - logging-filter = "akka.event.slf4j.Slf4jLoggingFilter" + loggers = ["org.apache.pekko.event.slf4j.Slf4jLogger"] + logging-filter = "org.apache.pekko.event.slf4j.Slf4jLoggingFilter" actor { // Required until https://github.com/akka/akka/pull/28333 is available @@ -44,15 +44,15 @@ docker { jdbc-journal { event-adapters { - test-write-event-adapter = "akka.persistence.jdbc.query.EventAdapterTest$TestWriteEventAdapter" - test-read-event-adapter = "akka.persistence.jdbc.query.EventAdapterTest$TestReadEventAdapter" + test-write-event-adapter = "org.apache.pekko.persistence.jdbc.query.EventAdapterTest$TestWriteEventAdapter" + test-read-event-adapter = "org.apache.pekko.persistence.jdbc.query.EventAdapterTest$TestReadEventAdapter" } event-adapter-bindings { - "akka.persistence.jdbc.query.EventAdapterTest$Event" = test-write-event-adapter - "akka.persistence.jdbc.query.EventAdapterTest$TaggedEvent" = test-write-event-adapter - "akka.persistence.jdbc.query.EventAdapterTest$TaggedAsyncEvent" = test-write-event-adapter - "akka.persistence.jdbc.query.EventAdapterTest$EventAdapted" = test-read-event-adapter + "org.apache.pekko.persistence.jdbc.query.EventAdapterTest$Event" = test-write-event-adapter + "org.apache.pekko.persistence.jdbc.query.EventAdapterTest$TaggedEvent" = test-write-event-adapter + "org.apache.pekko.persistence.jdbc.query.EventAdapterTest$TaggedAsyncEvent" = test-write-event-adapter + "org.apache.pekko.persistence.jdbc.query.EventAdapterTest$EventAdapted" = test-read-event-adapter } } diff --git a/core/src/test/resources/h2-application.conf b/core/src/test/resources/h2-application.conf index 1d01979f..923903c6 100644 --- a/core/src/test/resources/h2-application.conf +++ b/core/src/test/resources/h2-application.conf @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -// general.conf is included only for shared settings used for the akka-persistence-jdbc tests +// general.conf is included only for shared settings used for the pekko-persistence-jdbc tests include "general.conf" -akka { +pekko { persistence { journal { plugin = "jdbc-journal" @@ -34,17 +34,17 @@ jdbc-journal { slick = ${slick} } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { slick = ${slick} } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { slick = ${slick} } -# the akka-persistence-jdbc provider in use for durable state store +# the pekko-persistence-jdbc provider in use for durable state store jdbc-durable-state-store { slick = ${slick} } diff --git a/core/src/test/resources/h2-shared-db-application.conf b/core/src/test/resources/h2-shared-db-application.conf index b41239d5..0439e405 100644 --- a/core/src/test/resources/h2-shared-db-application.conf +++ b/core/src/test/resources/h2-shared-db-application.conf @@ -14,7 +14,7 @@ include "general.conf" -akka { +pekko { persistence { journal { plugin = "jdbc-journal" @@ -29,7 +29,7 @@ akka { } } -akka-persistence-jdbc { +pekko-persistence-jdbc { shared-databases { slick { profile = "slick.jdbc.H2Profile$" @@ -50,12 +50,12 @@ jdbc-journal { use-shared-db = "slick" } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { use-shared-db = "slick" } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { use-shared-db = "slick" } diff --git a/core/src/test/resources/jndi-application.conf b/core/src/test/resources/jndi-application.conf index 1305d0dc..63f18072 100644 --- a/core/src/test/resources/jndi-application.conf +++ b/core/src/test/resources/jndi-application.conf @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -// general.conf is included only for shared settings used for the akka-persistence-jdbc tests +// general.conf is included only for shared settings used for the pekko-persistence-jdbc tests include "general.conf" -akka { +pekko { persistence { journal { plugin = "jdbc-journal" @@ -34,12 +34,12 @@ jdbc-journal { slick = ${slick} } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { slick = ${slick} } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { slick = ${slick} } diff --git a/core/src/test/resources/jndi-shared-db-application.conf b/core/src/test/resources/jndi-shared-db-application.conf index 06a27f1f..0dc48795 100644 --- a/core/src/test/resources/jndi-shared-db-application.conf +++ b/core/src/test/resources/jndi-shared-db-application.conf @@ -14,7 +14,7 @@ include "general.conf" -akka { +pekko { persistence { journal { plugin = "jdbc-journal" @@ -29,7 +29,7 @@ akka { } } -akka-persistence-jdbc { +pekko-persistence-jdbc { shared-databases { slick { profile = "slick.jdbc.PostgresProfile$" @@ -42,12 +42,12 @@ jdbc-journal { use-shared-db = "slick" } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { use-shared-db = "slick" } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { use-shared-db = "slick" } diff --git a/core/src/test/resources/logback-test.xml b/core/src/test/resources/logback-test.xml index c0d5a74e..d37ac671 100644 --- a/core/src/test/resources/logback-test.xml +++ b/core/src/test/resources/logback-test.xml @@ -10,8 +10,8 @@ - - + + @@ -37,8 +37,8 @@ - - + + diff --git a/core/src/test/resources/mysql-application.conf b/core/src/test/resources/mysql-application.conf index 43643ab4..110cfa16 100644 --- a/core/src/test/resources/mysql-application.conf +++ b/core/src/test/resources/mysql-application.conf @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -// general.conf is included only for shared settings used for the akka-persistence-jdbc tests +// general.conf is included only for shared settings used for the pekko-persistence-jdbc tests include "general.conf" -akka { +pekko { persistence { journal { plugin = "jdbc-journal" @@ -34,12 +34,12 @@ jdbc-journal { slick = ${slick} } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { slick = ${slick} } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { slick = ${slick} } diff --git a/core/src/test/resources/mysql-shared-db-application.conf b/core/src/test/resources/mysql-shared-db-application.conf index b8016ae8..aa66962e 100644 --- a/core/src/test/resources/mysql-shared-db-application.conf +++ b/core/src/test/resources/mysql-shared-db-application.conf @@ -14,7 +14,7 @@ include "general.conf" -akka { +pekko { persistence { journal { plugin = "jdbc-journal" @@ -29,14 +29,14 @@ akka { } } -akka-persistence-jdbc { +pekko-persistence-jdbc { shared-databases { slick { profile = "slick.jdbc.MySQLProfile$" db { host = ${docker.host} host = ${?DB_HOST} - url = "jdbc:mysql://"${akka-persistence-jdbc.shared-databases.slick.db.host}":3306/mysql?cachePrepStmts=true&cacheCallableStmts=true&cacheServerConfiguration=true&useLocalSessionState=true&elideSetAutoCommits=true&alwaysSendSetIsolation=false&enableQueryTimeouts=false&connectionAttributes=none&verifyServerCertificate=false&useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&useLegacyDatetimeCode=false&serverTimezone=UTC&rewriteBatchedStatements=true" + url = "jdbc:mysql://"${pekko-persistence-jdbc.shared-databases.slick.db.host}":3306/mysql?cachePrepStmts=true&cacheCallableStmts=true&cacheServerConfiguration=true&useLocalSessionState=true&elideSetAutoCommits=true&alwaysSendSetIsolation=false&enableQueryTimeouts=false&connectionAttributes=none&verifyServerCertificate=false&useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&useLegacyDatetimeCode=false&serverTimezone=UTC&rewriteBatchedStatements=true" user = "root" password = "root" driver = "com.mysql.cj.jdbc.Driver" @@ -52,12 +52,12 @@ jdbc-journal { use-shared-db = "slick" } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { use-shared-db = "slick" } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { use-shared-db = "slick" } diff --git a/core/src/test/resources/oracle-application.conf b/core/src/test/resources/oracle-application.conf index 9ef96863..e13ad046 100644 --- a/core/src/test/resources/oracle-application.conf +++ b/core/src/test/resources/oracle-application.conf @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -// general.conf is included only for shared settings used for the akka-persistence-jdbc tests +// general.conf is included only for shared settings used for the pekko-persistence-jdbc tests include "general.conf" include "oracle-schema-overrides.conf" -akka { +pekko { persistence { journal { plugin = "jdbc-journal" @@ -36,12 +36,12 @@ jdbc-journal { slick = ${slick} } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { slick = ${slick} } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { slick = ${slick} } diff --git a/core/src/test/resources/oracle-shared-db-application.conf b/core/src/test/resources/oracle-shared-db-application.conf index 58c3c4f1..12298e04 100644 --- a/core/src/test/resources/oracle-shared-db-application.conf +++ b/core/src/test/resources/oracle-shared-db-application.conf @@ -15,7 +15,7 @@ include "general.conf" include "oracle-schema-overrides.conf" -akka { +pekko { persistence { journal { plugin = "jdbc-journal" @@ -30,14 +30,14 @@ akka { } } -akka-persistence-jdbc { +pekko-persistence-jdbc { shared-databases { slick { profile = "slick.jdbc.OracleProfile$" db { host = ${docker.host} host = ${?DB_HOST} - url = "jdbc:oracle:thin:@//"${akka-persistence-jdbc.shared-databases.slick.db.host}":1521/xe" + url = "jdbc:oracle:thin:@//"${pekko-persistence-jdbc.shared-databases.slick.db.host}":1521/xe" user = "system" password = "oracle" driver = "oracle.jdbc.OracleDriver" @@ -53,12 +53,12 @@ jdbc-journal { use-shared-db = "slick" } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { use-shared-db = "slick" } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { use-shared-db = "slick" } diff --git a/core/src/test/resources/postgres-application.conf b/core/src/test/resources/postgres-application.conf index 789a94cb..e9884ce6 100644 --- a/core/src/test/resources/postgres-application.conf +++ b/core/src/test/resources/postgres-application.conf @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -// general.conf is included only for shared settings used for the akka-persistence-jdbc tests +// general.conf is included only for shared settings used for the pekko-persistence-jdbc tests include "general.conf" -akka { +pekko { persistence { journal { plugin = "jdbc-journal" @@ -34,17 +34,17 @@ jdbc-journal { slick = ${slick} } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { slick = ${slick} } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { slick = ${slick} } -# the akka-persistence-jdbc provider in use for durable state store +# the pekko-persistence-jdbc provider in use for durable state store jdbc-durable-state-store { slick = ${slick} } diff --git a/core/src/test/resources/postgres-shared-db-application.conf b/core/src/test/resources/postgres-shared-db-application.conf index f9821ff4..72ef0bc3 100644 --- a/core/src/test/resources/postgres-shared-db-application.conf +++ b/core/src/test/resources/postgres-shared-db-application.conf @@ -14,7 +14,7 @@ include "general.conf" -akka { +pekko { persistence { journal { plugin = "jdbc-journal" @@ -29,14 +29,14 @@ akka { } } -akka-persistence-jdbc { +pekko-persistence-jdbc { shared-databases { slick { profile = "slick.jdbc.PostgresProfile$" db { host = "localhost" host = ${?DB_HOST} - url = "jdbc:postgresql://"${akka-persistence-jdbc.shared-databases.slick.db.host}":5432/docker?reWriteBatchedInserts=true" + url = "jdbc:postgresql://"${pekko-persistence-jdbc.shared-databases.slick.db.host}":5432/docker?reWriteBatchedInserts=true" user = "docker" password = "docker" driver = "org.postgresql.Driver" @@ -52,17 +52,17 @@ jdbc-journal { use-shared-db = "slick" } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { use-shared-db = "slick" } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { use-shared-db = "slick" } -# the akka-persistence-jdbc provider in use for durable state store +# the pekko-persistence-jdbc provider in use for durable state store jdbc-durable-state-store { use-shared-db = "slick" } diff --git a/core/src/test/resources/sqlserver-application.conf b/core/src/test/resources/sqlserver-application.conf index 42f651eb..bccc357a 100644 --- a/core/src/test/resources/sqlserver-application.conf +++ b/core/src/test/resources/sqlserver-application.conf @@ -14,7 +14,7 @@ include "general.conf" -akka { +pekko { persistence { journal { plugin = "jdbc-journal" @@ -39,7 +39,7 @@ jdbc-journal { slick = ${slick} } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { tables { snapshot { @@ -50,7 +50,7 @@ jdbc-snapshot-store { slick = ${slick} } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { tables { journal { diff --git a/core/src/test/resources/sqlserver-shared-db-application.conf b/core/src/test/resources/sqlserver-shared-db-application.conf index f7ef37f5..3bbc8a35 100644 --- a/core/src/test/resources/sqlserver-shared-db-application.conf +++ b/core/src/test/resources/sqlserver-shared-db-application.conf @@ -14,7 +14,7 @@ include "general.conf" -akka { +pekko { persistence { journal { plugin = "jdbc-journal" @@ -29,14 +29,14 @@ akka { } } -akka-persistence-jdbc { +pekko-persistence-jdbc { shared-databases { slick { profile = "slick.jdbc.SQLServerProfile$" db { host = ${docker.host} host = ${?DB_HOST} - url = "jdbc:sqlserver://"${akka-persistence-jdbc.shared-databases.slick.db.host}":1433;databaseName=docker;integratedSecurity=false;" + url = "jdbc:sqlserver://"${pekko-persistence-jdbc.shared-databases.slick.db.host}":1433;databaseName=docker;integratedSecurity=false;" user = "docker" password = "docker" driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver" @@ -52,12 +52,12 @@ jdbc-journal { use-shared-db = "slick" } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { use-shared-db = "slick" } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { use-shared-db = "slick" } diff --git a/core/src/test/scala/akka/persistence/jdbc/ScaladslSnippets.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/ScaladslSnippets.scala similarity index 74% rename from core/src/test/scala/akka/persistence/jdbc/ScaladslSnippets.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/ScaladslSnippets.scala index d7a499db..ab635809 100644 --- a/core/src/test/scala/akka/persistence/jdbc/ScaladslSnippets.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/ScaladslSnippets.scala @@ -3,10 +3,12 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc +package org.apache.pekko.persistence.jdbc -import akka.{ Done, NotUsed } -import akka.actor.ActorSystem +import org.apache.pekko.{ Done, NotUsed } +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.persistence.jdbc.query.scaladsl.JdbcReadJournal +import org.apache.pekko.persistence.jdbc.testkit.scaladsl.SchemaUtils import scala.concurrent.Future @@ -14,7 +16,6 @@ object ScaladslSnippets { def create(): Unit = { // #create - import akka.persistence.jdbc.testkit.scaladsl.SchemaUtils implicit val system: ActorSystem = ActorSystem("example") val done: Future[Done] = SchemaUtils.createIfNotExists() @@ -25,8 +26,7 @@ object ScaladslSnippets { implicit val system: ActorSystem = ActorSystem() // #read-journal - import akka.persistence.query.PersistenceQuery - import akka.persistence.jdbc.query.scaladsl.JdbcReadJournal + import org.apache.pekko.persistence.query.PersistenceQuery val readJournal: JdbcReadJournal = PersistenceQuery(system).readJournalFor[JdbcReadJournal](JdbcReadJournal.Identifier) @@ -37,9 +37,8 @@ object ScaladslSnippets { implicit val system: ActorSystem = ActorSystem() // #persistence-ids - import akka.stream.scaladsl.Source - import akka.persistence.query.PersistenceQuery - import akka.persistence.jdbc.query.scaladsl.JdbcReadJournal + import org.apache.pekko.stream.scaladsl.Source + import org.apache.pekko.persistence.query.PersistenceQuery val readJournal: JdbcReadJournal = PersistenceQuery(system).readJournalFor[JdbcReadJournal](JdbcReadJournal.Identifier) @@ -54,9 +53,8 @@ object ScaladslSnippets { implicit val system: ActorSystem = ActorSystem() // #events-by-persistence-id - import akka.stream.scaladsl.Source - import akka.persistence.query.{ EventEnvelope, PersistenceQuery } - import akka.persistence.jdbc.query.scaladsl.JdbcReadJournal + import org.apache.pekko.stream.scaladsl.Source + import org.apache.pekko.persistence.query.{ EventEnvelope, PersistenceQuery } val readJournal: JdbcReadJournal = PersistenceQuery(system).readJournalFor[JdbcReadJournal](JdbcReadJournal.Identifier) @@ -72,9 +70,8 @@ object ScaladslSnippets { def eventsByTag(): Unit = { implicit val system: ActorSystem = ActorSystem() // #events-by-tag - import akka.stream.scaladsl.Source - import akka.persistence.query.{ EventEnvelope, PersistenceQuery } - import akka.persistence.jdbc.query.scaladsl.JdbcReadJournal + import org.apache.pekko.stream.scaladsl.Source + import org.apache.pekko.persistence.query.{ EventEnvelope, PersistenceQuery } val readJournal: JdbcReadJournal = PersistenceQuery(system).readJournalFor[JdbcReadJournal](JdbcReadJournal.Identifier) diff --git a/core/src/test/scala/akka/persistence/jdbc/SharedActorSystemTestSpec.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/SharedActorSystemTestSpec.scala similarity index 75% rename from core/src/test/scala/akka/persistence/jdbc/SharedActorSystemTestSpec.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/SharedActorSystemTestSpec.scala index 325c9998..98f0b66d 100644 --- a/core/src/test/scala/akka/persistence/jdbc/SharedActorSystemTestSpec.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/SharedActorSystemTestSpec.scala @@ -3,16 +3,16 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc - -import akka.actor.ActorSystem -import akka.persistence.jdbc.config.{ JournalConfig, ReadJournalConfig } -import akka.persistence.jdbc.query.javadsl.JdbcReadJournal -import akka.persistence.jdbc.util.DropCreate -import akka.persistence.jdbc.db.SlickExtension -import akka.serialization.SerializationExtension -import akka.util.Timeout +package org.apache.pekko.persistence.jdbc + +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.serialization.SerializationExtension +import org.apache.pekko.util.Timeout import com.typesafe.config.{ Config, ConfigFactory, ConfigValue } +import org.apache.pekko.persistence.jdbc.config.{ JournalConfig, ReadJournalConfig } +import org.apache.pekko.persistence.jdbc.db.SlickExtension +import org.apache.pekko.persistence.jdbc.query.scaladsl.JdbcReadJournal +import org.apache.pekko.persistence.jdbc.util.DropCreate import org.scalatest.BeforeAndAfterAll import scala.concurrent.ExecutionContext diff --git a/core/src/test/scala/akka/persistence/jdbc/SimpleSpec.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/SimpleSpec.scala similarity index 81% rename from core/src/test/scala/akka/persistence/jdbc/SimpleSpec.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/SimpleSpec.scala index 5f5f70b5..3c6e9dfe 100644 --- a/core/src/test/scala/akka/persistence/jdbc/SimpleSpec.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/SimpleSpec.scala @@ -3,11 +3,11 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc +package org.apache.pekko.persistence.jdbc -import akka.actor.{ ActorRef, ActorSystem } -import akka.persistence.jdbc.util.ClasspathResources -import akka.testkit.TestProbe +import org.apache.pekko.actor.{ ActorRef, ActorSystem } +import org.apache.pekko.persistence.jdbc.util.ClasspathResources +import org.apache.pekko.testkit.TestProbe import org.scalatest._ import org.scalatest.concurrent.{ Eventually, ScalaFutures } import org.scalatest.flatspec.AnyFlatSpec diff --git a/core/src/test/scala/akka/persistence/jdbc/SingleActorSystemPerTestSpec.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/SingleActorSystemPerTestSpec.scala similarity index 77% rename from core/src/test/scala/akka/persistence/jdbc/SingleActorSystemPerTestSpec.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/SingleActorSystemPerTestSpec.scala index 965314b7..c706233d 100644 --- a/core/src/test/scala/akka/persistence/jdbc/SingleActorSystemPerTestSpec.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/SingleActorSystemPerTestSpec.scala @@ -3,15 +3,15 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc +package org.apache.pekko.persistence.jdbc -import akka.actor.ActorSystem -import akka.persistence.jdbc.config.{ JournalConfig, ReadJournalConfig, SlickConfiguration } -import akka.persistence.jdbc.query.javadsl.JdbcReadJournal -import akka.persistence.jdbc.util.DropCreate -import akka.persistence.jdbc.db.SlickDatabase -import akka.util.Timeout +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.util.Timeout import com.typesafe.config.{ Config, ConfigFactory, ConfigValue } +import org.apache.pekko.persistence.jdbc.config.{ JournalConfig, ReadJournalConfig, SlickConfiguration } +import org.apache.pekko.persistence.jdbc.db.SlickDatabase +import org.apache.pekko.persistence.jdbc.query.scaladsl.JdbcReadJournal +import org.apache.pekko.persistence.jdbc.util.DropCreate import org.scalatest.BeforeAndAfterEach import slick.jdbc.JdbcBackend.Database @@ -40,7 +40,7 @@ abstract class SingleActorSystemPerTestSpec(val config: Config) else List(journalConfig.journalTableConfiguration.tableName) val profile = if (cfg.hasPath("slick.profile")) { SlickDatabase.profile(cfg, "slick") - } else SlickDatabase.profile(config, "akka-persistence-jdbc.shared-databases.slick") + } else SlickDatabase.profile(config, "pekko-persistence-jdbc.shared-databases.slick") val readJournalConfig = new ReadJournalConfig(config.getConfig(JdbcReadJournal.Identifier)) // The db is initialized in the before and after each bocks @@ -52,8 +52,8 @@ abstract class SingleActorSystemPerTestSpec(val config: Config) } else SlickDatabase.database( config, - new SlickConfiguration(config.getConfig("akka-persistence-jdbc.shared-databases.slick")), - "akka-persistence-jdbc.shared-databases.slick.db") + new SlickConfiguration(config.getConfig("pekko-persistence-jdbc.shared-databases.slick")), + "pekko-persistence-jdbc.shared-databases.slick.db") dbOpt = Some(newDb) newDb diff --git a/core/src/test/scala/akka/persistence/jdbc/TablesTestSpec.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/TablesTestSpec.scala similarity index 91% rename from core/src/test/scala/akka/persistence/jdbc/TablesTestSpec.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/TablesTestSpec.scala index f52f7763..e676f16b 100644 --- a/core/src/test/scala/akka/persistence/jdbc/TablesTestSpec.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/TablesTestSpec.scala @@ -3,10 +3,10 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc +package org.apache.pekko.persistence.jdbc -import akka.persistence.jdbc.config._ import com.typesafe.config.ConfigFactory +import org.apache.pekko.persistence.jdbc.config.{ JournalConfig, ReadJournalConfig, SnapshotConfig } import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers @@ -15,14 +15,14 @@ abstract class TablesTestSpec extends AnyFlatSpec with Matchers { val config = ConfigFactory .parseString(""" - |akka-persistence-jdbc.slick.db { + |pekko-persistence-jdbc.slick.db { | host = | port = | name = |} | |jdbc-journal { - | class = "akka.persistence.jdbc.journal.JdbcAsyncWriteJournal" + | class = "org.apache.pekko.persistence.jdbc.journal.JdbcAsyncWriteJournal" | | tables { | journal { @@ -51,7 +51,7 @@ abstract class TablesTestSpec extends AnyFlatSpec with Matchers { | | serialization = on // alter only when using a custom dao | - | dao = "akka.persistence.jdbc.dao.bytea.ByteArrayJournalDao" + | dao = "org.apache.pekko.persistence.jdbc.dao.bytea.ByteArrayJournalDao" | | slick { | profile = "slick.jdbc.PostgresProfile" @@ -62,7 +62,7 @@ abstract class TablesTestSpec extends AnyFlatSpec with Matchers { | port = ${?POSTGRES_PORT} | name = "docker" | - | url = "jdbc:postgresql://"${akka-persistence-jdbc.slick.db.host}":"${akka-persistence-jdbc.slick.db.port}"/"${akka-persistence-jdbc.slick.db.name} + | url = "jdbc:postgresql://"${pekko-persistence-jdbc.slick.db.host}":"${pekko-persistence-jdbc.slick.db.port}"/"${pekko-persistence-jdbc.slick.db.name} | user = "docker" | password = "docker" | driver = "org.postgresql.Driver" @@ -92,9 +92,9 @@ abstract class TablesTestSpec extends AnyFlatSpec with Matchers { | } |} | - |# the akka-persistence-snapshot-store in use + |# the pekko-persistence-snapshot-store in use |jdbc-snapshot-store { - | class = "akka.persistence.jdbc.snapshot.JdbcSnapshotStore" + | class = "org.apache.pekko.persistence.jdbc.snapshot.JdbcSnapshotStore" | | tables { | snapshot { @@ -111,7 +111,7 @@ abstract class TablesTestSpec extends AnyFlatSpec with Matchers { | | serialization = on // alter only when using a custom dao | - | dao = "akka.persistence.jdbc.dao.bytea.ByteArraySnapshotDao" + | dao = "org.apache.pekko.persistence.jdbc.dao.bytea.ByteArraySnapshotDao" | | slick { | profile = "slick.jdbc.PostgresProfile" @@ -122,7 +122,7 @@ abstract class TablesTestSpec extends AnyFlatSpec with Matchers { | port = ${?POSTGRES_PORT} | name = "docker" | - | url = "jdbc:postgresql://"${akka-persistence-jdbc.slick.db.host}":"${akka-persistence-jdbc.slick.db.port}"/"${akka-persistence-jdbc.slick.db.name} + | url = "jdbc:postgresql://"${pekko-persistence-jdbc.slick.db.host}":"${pekko-persistence-jdbc.slick.db.port}"/"${pekko-persistence-jdbc.slick.db.name} | user = "docker" | password = "docker" | driver = "org.postgresql.Driver" @@ -152,9 +152,9 @@ abstract class TablesTestSpec extends AnyFlatSpec with Matchers { | } |} | - |# the akka-persistence-query provider in use + |# the pekko-persistence-query provider in use |jdbc-read-journal { - | class = "akka.persistence.jdbc.query.JdbcReadJournalProvider" + | class = "org.apache.pekko.persistence.jdbc.query.JdbcReadJournalProvider" | | # New events are retrieved (polled) with this interval. | refresh-interval = "1s" @@ -165,7 +165,7 @@ abstract class TablesTestSpec extends AnyFlatSpec with Matchers { | | serialization = on // alter only when using a custom dao | - | dao = "akka.persistence.jdbc.dao.bytea.ByteArrayJournalDao" + | dao = "org.apache.pekko.persistence.jdbc.dao.bytea.ByteArrayJournalDao" | | tables { | journal { @@ -192,7 +192,7 @@ abstract class TablesTestSpec extends AnyFlatSpec with Matchers { | port = ${?POSTGRES_PORT} | name = "docker" | - | url = "jdbc:postgresql://"${akka-persistence-jdbc.slick.db.host}":"${akka-persistence-jdbc.slick.db.port}"/"${akka-persistence-jdbc.slick.db.name} + | url = "jdbc:postgresql://"${pekko-persistence-jdbc.slick.db.host}":"${pekko-persistence-jdbc.slick.db.port}"/"${pekko-persistence-jdbc.slick.db.name} | user = "docker" | password = "docker" | driver = "org.postgresql.Driver" diff --git a/core/src/test/scala/akka/persistence/jdbc/configuration/ConfigOpsTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/configuration/ConfigOpsTest.scala similarity index 81% rename from core/src/test/scala/akka/persistence/jdbc/configuration/ConfigOpsTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/configuration/ConfigOpsTest.scala index 3e0ed07a..b723c4dd 100644 --- a/core/src/test/scala/akka/persistence/jdbc/configuration/ConfigOpsTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/configuration/ConfigOpsTest.scala @@ -3,12 +3,11 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.configuration +package org.apache.pekko.persistence.jdbc.configuration -import akka.persistence.jdbc.SimpleSpec -import akka.persistence.jdbc.util.ConfigOps -import ConfigOps._ import com.typesafe.config.ConfigFactory +import org.apache.pekko.persistence.jdbc.SimpleSpec +import org.apache.pekko.persistence.jdbc.util.ConfigOps.ConfigOperations class ConfigOpsTest extends SimpleSpec { it should "parse field values to Options" in { diff --git a/core/src/test/scala/akka/persistence/jdbc/configuration/JNDIConfigTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/configuration/JNDIConfigTest.scala similarity index 89% rename from core/src/test/scala/akka/persistence/jdbc/configuration/JNDIConfigTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/configuration/JNDIConfigTest.scala index df0e0a8a..c0c5d791 100644 --- a/core/src/test/scala/akka/persistence/jdbc/configuration/JNDIConfigTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/configuration/JNDIConfigTest.scala @@ -3,12 +3,12 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.configuration +package org.apache.pekko.persistence.jdbc.configuration -import akka.actor.ActorSystem -import akka.persistence.jdbc.SimpleSpec -import akka.persistence.jdbc.db.SlickExtension import com.typesafe.config.ConfigFactory +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.persistence.jdbc.SimpleSpec +import org.apache.pekko.persistence.jdbc.db.SlickExtension class JNDIConfigTest extends SimpleSpec { "JNDI config" should "read the config and throw NoInitialContextException in case the JNDI resource is not available" in { diff --git a/core/src/test/scala/akka/persistence/jdbc/configuration/AkkaPersistenceConfigTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/configuration/PekkoPersistenceConfigTest.scala similarity index 90% rename from core/src/test/scala/akka/persistence/jdbc/configuration/AkkaPersistenceConfigTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/configuration/PekkoPersistenceConfigTest.scala index 6dce8baa..7105ba9a 100644 --- a/core/src/test/scala/akka/persistence/jdbc/configuration/AkkaPersistenceConfigTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/configuration/PekkoPersistenceConfigTest.scala @@ -3,28 +3,28 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.configuration +package org.apache.pekko.persistence.jdbc.configuration -import akka.persistence.jdbc.config._ import com.typesafe.config.{ Config, ConfigFactory } +import org.apache.pekko.persistence.jdbc.config.{ JournalConfig, ReadJournalConfig, SlickConfiguration, SnapshotConfig } import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers import scala.concurrent.duration._ -class AkkaPersistenceConfigTest extends AnyFlatSpec with Matchers { +class PekkoPersistenceConfigTest extends AnyFlatSpec with Matchers { private val referenceConfig: Config = ConfigFactory.load("reference") val config: Config = ConfigFactory .parseString(""" - |akka-persistence-jdbc.slick.db { + |pekko-persistence-jdbc.slick.db { | host = | port = | name = |} | |jdbc-journal { - | class = "akka.persistence.jdbc.journal.JdbcAsyncWriteJournal" + | class = "org.apache.pekko.persistence.jdbc.journal.JdbcAsyncWriteJournal" | | tables { | journal { @@ -43,7 +43,7 @@ class AkkaPersistenceConfigTest extends AnyFlatSpec with Matchers { | | tagSeparator = "," | - | dao = "akka.persistence.jdbc.dao.bytea.journal.ByteArrayJournalDao" + | dao = "org.apache.pekko.persistence.jdbc.dao.bytea.journal.ByteArrayJournalDao" | | slick { | profile = "slick.jdbc.PostgresProfile$" @@ -54,7 +54,7 @@ class AkkaPersistenceConfigTest extends AnyFlatSpec with Matchers { | port = ${?POSTGRES_PORT} | name = "docker" | - | url = "jdbc:postgresql://"${akka-persistence-jdbc.slick.db.host}":"${akka-persistence-jdbc.slick.db.port}"/"${akka-persistence-jdbc.slick.db.name} + | url = "jdbc:postgresql://"${pekko-persistence-jdbc.slick.db.host}":"${pekko-persistence-jdbc.slick.db.port}"/"${pekko-persistence-jdbc.slick.db.name} | user = "docker" | password = "docker" | driver = "org.postgresql.Driver$" @@ -84,9 +84,9 @@ class AkkaPersistenceConfigTest extends AnyFlatSpec with Matchers { | } |} | - |# the akka-persistence-snapshot-store in use + |# the pekko-persistence-snapshot-store in use |jdbc-snapshot-store { - | class = "akka.persistence.jdbc.snapshot.JdbcSnapshotStore" + | class = "org.apache.pekko.persistence.jdbc.snapshot.JdbcSnapshotStore" | | tables { | snapshot { @@ -101,7 +101,7 @@ class AkkaPersistenceConfigTest extends AnyFlatSpec with Matchers { | } | } | - | dao = "akka.persistence.jdbc.dao.bytea.snapshot.ByteArraySnapshotDao" + | dao = "org.apache.pekko.persistence.jdbc.dao.bytea.snapshot.ByteArraySnapshotDao" | | slick { | profile = "slick.jdbc.MySQLProfile$" @@ -112,7 +112,7 @@ class AkkaPersistenceConfigTest extends AnyFlatSpec with Matchers { | port = ${?POSTGRES_PORT} | name = "docker" | - | url = "jdbc:postgresql://"${akka-persistence-jdbc.slick.db.host}":"${akka-persistence-jdbc.slick.db.port}"/"${akka-persistence-jdbc.slick.db.name} + | url = "jdbc:postgresql://"${pekko-persistence-jdbc.slick.db.host}":"${pekko-persistence-jdbc.slick.db.port}"/"${pekko-persistence-jdbc.slick.db.name} | user = "docker" | password = "docker" | driver = "org.postgresql.Driver" @@ -142,9 +142,9 @@ class AkkaPersistenceConfigTest extends AnyFlatSpec with Matchers { | } |} | - |# the akka-persistence-query provider in use + |# the pekko-persistence-query provider in use |jdbc-read-journal { - | class = "akka.persistence.jdbc.query.JdbcReadJournalProvider" + | class = "org.apache.pekko.persistence.jdbc.query.JdbcReadJournalProvider" | | # New events are retrieved (polled) with this interval. | refresh-interval = "300ms" @@ -153,7 +153,7 @@ class AkkaPersistenceConfigTest extends AnyFlatSpec with Matchers { | # are delivered downstreams. | max-buffer-size = "10" | - | dao = "akka.persistence.jdbc.dao.bytea.readjournal.ByteArrayReadJournalDao" + | dao = "org.apache.pekko.persistence.jdbc.dao.bytea.readjournal.ByteArrayReadJournalDao" | | tables { | journal { @@ -181,7 +181,7 @@ class AkkaPersistenceConfigTest extends AnyFlatSpec with Matchers { | port = ${?POSTGRES_PORT} | name = "docker" | - | url = "jdbc:postgresql://"${akka-persistence-jdbc.slick.db.host}":"${akka-persistence-jdbc.slick.db.port}"/"${akka-persistence-jdbc.slick.db.name} + | url = "jdbc:postgresql://"${pekko-persistence-jdbc.slick.db.host}":"${pekko-persistence-jdbc.slick.db.port}"/"${pekko-persistence-jdbc.slick.db.name} | user = "docker" | password = "docker" | driver = "org.postgresql.Driver" @@ -220,7 +220,7 @@ class AkkaPersistenceConfigTest extends AnyFlatSpec with Matchers { slickConfiguration.jndiName shouldBe None slickConfiguration.jndiDbName shouldBe None - cfg.pluginConfig.dao shouldBe "akka.persistence.jdbc.journal.dao.DefaultJournalDao" + cfg.pluginConfig.dao shouldBe "org.apache.pekko.persistence.jdbc.journal.dao.DefaultJournalDao" cfg.pluginConfig.tagSeparator shouldBe "," cfg.journalTableConfiguration.tableName shouldBe "journal" @@ -240,7 +240,7 @@ class AkkaPersistenceConfigTest extends AnyFlatSpec with Matchers { slickConfiguration.jndiName shouldBe None slickConfiguration.jndiDbName shouldBe None - cfg.pluginConfig.dao shouldBe "akka.persistence.jdbc.snapshot.dao.DefaultSnapshotDao" + cfg.pluginConfig.dao shouldBe "org.apache.pekko.persistence.jdbc.snapshot.dao.DefaultSnapshotDao" cfg.legacySnapshotTableConfiguration.tableName shouldBe "snapshot" cfg.legacySnapshotTableConfiguration.schemaName shouldBe None @@ -257,7 +257,7 @@ class AkkaPersistenceConfigTest extends AnyFlatSpec with Matchers { slickConfiguration.jndiName shouldBe None slickConfiguration.jndiDbName shouldBe None - cfg.pluginConfig.dao shouldBe "akka.persistence.jdbc.query.dao.DefaultReadJournalDao" + cfg.pluginConfig.dao shouldBe "org.apache.pekko.persistence.jdbc.query.dao.DefaultReadJournalDao" cfg.pluginConfig.tagSeparator shouldBe "," cfg.refreshInterval shouldBe 1.second cfg.maxBufferSize shouldBe 500 @@ -279,7 +279,7 @@ class AkkaPersistenceConfigTest extends AnyFlatSpec with Matchers { slickConfiguration.jndiName shouldBe None slickConfiguration.jndiDbName shouldBe None - cfg.pluginConfig.dao shouldBe "akka.persistence.jdbc.dao.bytea.journal.ByteArrayJournalDao" + cfg.pluginConfig.dao shouldBe "org.apache.pekko.persistence.jdbc.dao.bytea.journal.ByteArrayJournalDao" cfg.pluginConfig.tagSeparator shouldBe "," cfg.journalTableConfiguration.tableName shouldBe "journal" @@ -299,7 +299,7 @@ class AkkaPersistenceConfigTest extends AnyFlatSpec with Matchers { slickConfiguration.jndiName shouldBe None slickConfiguration.jndiDbName shouldBe None - cfg.pluginConfig.dao shouldBe "akka.persistence.jdbc.dao.bytea.snapshot.ByteArraySnapshotDao" + cfg.pluginConfig.dao shouldBe "org.apache.pekko.persistence.jdbc.dao.bytea.snapshot.ByteArraySnapshotDao" cfg.legacySnapshotTableConfiguration.tableName shouldBe "snapshot" cfg.legacySnapshotTableConfiguration.schemaName shouldBe None @@ -315,7 +315,7 @@ class AkkaPersistenceConfigTest extends AnyFlatSpec with Matchers { slickConfiguration.jndiName shouldBe None slickConfiguration.jndiDbName shouldBe None - cfg.pluginConfig.dao shouldBe "akka.persistence.jdbc.dao.bytea.readjournal.ByteArrayReadJournalDao" + cfg.pluginConfig.dao shouldBe "org.apache.pekko.persistence.jdbc.dao.bytea.readjournal.ByteArrayReadJournalDao" cfg.pluginConfig.tagSeparator shouldBe "," cfg.refreshInterval shouldBe 300.millis cfg.maxBufferSize shouldBe 10 diff --git a/core/src/test/scala/akka/persistence/jdbc/journal/JdbcJournalPerfSpec.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/JdbcJournalPerfSpec.scala similarity index 83% rename from core/src/test/scala/akka/persistence/jdbc/journal/JdbcJournalPerfSpec.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/JdbcJournalPerfSpec.scala index ed5fc61b..b535eac8 100644 --- a/core/src/test/scala/akka/persistence/jdbc/journal/JdbcJournalPerfSpec.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/JdbcJournalPerfSpec.scala @@ -3,17 +3,17 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal - -import akka.actor.Props -import akka.persistence.CapabilityFlag -import akka.persistence.jdbc.config._ -import akka.persistence.jdbc.db.SlickExtension -import akka.persistence.jdbc.testkit.internal.{ H2, SchemaType } -import akka.persistence.jdbc.util.{ ClasspathResources, DropCreate } -import akka.persistence.journal.JournalPerfSpec -import akka.persistence.journal.JournalPerfSpec.{ BenchActor, Cmd, ResetCounter } -import akka.testkit.TestProbe +package org.apache.pekko.persistence.jdbc.journal + +import org.apache.pekko.actor.Props +import org.apache.pekko.persistence.CapabilityFlag +import org.apache.pekko.persistence.journal.JournalPerfSpec +import org.apache.pekko.persistence.journal.JournalPerfSpec.{ BenchActor, Cmd, ResetCounter } +import org.apache.pekko.testkit.TestProbe +import org.apache.pekko.persistence.jdbc.testkit.internal.{ H2, SchemaType } +import org.apache.pekko.persistence.jdbc.util.{ ClasspathResources, DropCreate } +import org.apache.pekko.persistence.jdbc.config.JournalConfig +import org.apache.pekko.persistence.jdbc.db.SlickExtension import com.typesafe.config.{ Config, ConfigFactory } import org.scalatest.{ BeforeAndAfterAll, BeforeAndAfterEach } import org.scalatest.concurrent.ScalaFutures diff --git a/core/src/test/scala/akka/persistence/jdbc/journal/JdbcJournalSpec.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/JdbcJournalSpec.scala similarity index 77% rename from core/src/test/scala/akka/persistence/jdbc/journal/JdbcJournalSpec.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/JdbcJournalSpec.scala index ecfe352b..a7f8f6dc 100644 --- a/core/src/test/scala/akka/persistence/jdbc/journal/JdbcJournalSpec.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/JdbcJournalSpec.scala @@ -3,15 +3,15 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal - -import akka.persistence.CapabilityFlag -import akka.persistence.jdbc.config._ -import akka.persistence.jdbc.db.SlickExtension -import akka.persistence.jdbc.testkit.internal.{ H2, SchemaType } -import akka.persistence.jdbc.util.{ ClasspathResources, DropCreate } -import akka.persistence.journal.JournalSpec +package org.apache.pekko.persistence.jdbc.journal + import com.typesafe.config.{ Config, ConfigFactory } +import org.apache.pekko.persistence.CapabilityFlag +import org.apache.pekko.persistence.journal.JournalSpec +import org.apache.pekko.persistence.jdbc.config.JournalConfig +import org.apache.pekko.persistence.jdbc.db.SlickExtension +import org.apache.pekko.persistence.jdbc.testkit.internal.{ H2, SchemaType } +import org.apache.pekko.persistence.jdbc.util.{ ClasspathResources, DropCreate } import org.scalatest.{ BeforeAndAfterAll, BeforeAndAfterEach } import org.scalatest.concurrent.ScalaFutures diff --git a/core/src/test/scala/akka/persistence/jdbc/journal/dao/TrySeqTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/dao/TrySeqTest.scala similarity index 91% rename from core/src/test/scala/akka/persistence/jdbc/journal/dao/TrySeqTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/dao/TrySeqTest.scala index 403aa6c2..f8d5f06f 100644 --- a/core/src/test/scala/akka/persistence/jdbc/journal/dao/TrySeqTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/dao/TrySeqTest.scala @@ -3,10 +3,10 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal.dao +package org.apache.pekko.persistence.jdbc.journal.dao -import akka.persistence.jdbc.util.TrySeq -import akka.persistence.jdbc.SimpleSpec +import org.apache.pekko.persistence.jdbc.util.TrySeq +import org.apache.pekko.persistence.jdbc.SimpleSpec import scala.collection.immutable._ import scala.util.{ Failure, Success } diff --git a/core/src/test/scala/akka/persistence/jdbc/journal/dao/ByteArrayJournalSerializerTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/ByteArrayJournalSerializerTest.scala similarity index 93% rename from core/src/test/scala/akka/persistence/jdbc/journal/dao/ByteArrayJournalSerializerTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/ByteArrayJournalSerializerTest.scala index 55bb47a8..0971166b 100644 --- a/core/src/test/scala/akka/persistence/jdbc/journal/dao/ByteArrayJournalSerializerTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/ByteArrayJournalSerializerTest.scala @@ -3,10 +3,10 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc +package org.apache.pekko.persistence.jdbc package journal.dao.legacy -import akka.persistence.{ AtomicWrite, PersistentRepr } +import org.apache.pekko.persistence.{ AtomicWrite, PersistentRepr } import scala.collection.immutable._ diff --git a/core/src/test/scala/akka/persistence/jdbc/journal/dao/JournalTablesTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/JournalTablesTest.scala similarity index 92% rename from core/src/test/scala/akka/persistence/jdbc/journal/dao/JournalTablesTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/JournalTablesTest.scala index efcff392..3f79e059 100644 --- a/core/src/test/scala/akka/persistence/jdbc/journal/dao/JournalTablesTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/JournalTablesTest.scala @@ -3,9 +3,9 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal.dao.legacy +package org.apache.pekko.persistence.jdbc.journal.dao.legacy -import akka.persistence.jdbc.TablesTestSpec +import org.apache.pekko.persistence.jdbc.TablesTestSpec import slick.jdbc.JdbcProfile class JournalTablesTest extends TablesTestSpec { diff --git a/core/src/test/scala/akka/persistence/jdbc/journal/dao/TagsSerializationTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/TagsSerializationTest.scala similarity index 90% rename from core/src/test/scala/akka/persistence/jdbc/journal/dao/TagsSerializationTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/TagsSerializationTest.scala index db0dd6a3..ea63d7f1 100644 --- a/core/src/test/scala/akka/persistence/jdbc/journal/dao/TagsSerializationTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/journal/dao/legacy/TagsSerializationTest.scala @@ -3,9 +3,9 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.journal.dao.legacy +package org.apache.pekko.persistence.jdbc.journal.dao.legacy -import akka.persistence.jdbc.SharedActorSystemTestSpec +import org.apache.pekko.persistence.jdbc.SharedActorSystemTestSpec class TagsSerializationTest extends SharedActorSystemTestSpec { "Encode" should "no tags" in { diff --git a/core/src/test/scala/akka/persistence/jdbc/query/AllPersistenceIdsTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/AllPersistenceIdsTest.scala similarity index 97% rename from core/src/test/scala/akka/persistence/jdbc/query/AllPersistenceIdsTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/query/AllPersistenceIdsTest.scala index 693bb123..1990068f 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/AllPersistenceIdsTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/AllPersistenceIdsTest.scala @@ -3,7 +3,7 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query +package org.apache.pekko.persistence.jdbc.query import scala.concurrent.duration._ diff --git a/core/src/test/scala/akka/persistence/jdbc/query/CurrentEventsByPersistenceIdTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/CurrentEventsByPersistenceIdTest.scala similarity index 95% rename from core/src/test/scala/akka/persistence/jdbc/query/CurrentEventsByPersistenceIdTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/query/CurrentEventsByPersistenceIdTest.scala index 4a8cce00..0f7e9b96 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/CurrentEventsByPersistenceIdTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/CurrentEventsByPersistenceIdTest.scala @@ -3,14 +3,14 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query - -import akka.Done -import akka.persistence.Persistence -import akka.persistence.jdbc.journal.JdbcAsyncWriteJournal -import akka.persistence.query.Offset -import akka.persistence.query.{ EventEnvelope, Sequence } -import akka.testkit.TestProbe +package org.apache.pekko.persistence.jdbc.query + +import org.apache.pekko.Done +import org.apache.pekko.persistence.Persistence +import org.apache.pekko.persistence.jdbc.journal.JdbcAsyncWriteJournal +import org.apache.pekko.persistence.query.Offset +import org.apache.pekko.persistence.query.{ EventEnvelope, Sequence } +import org.apache.pekko.testkit.TestProbe abstract class CurrentEventsByPersistenceIdTest(config: String) extends QueryTestSpec(config) { import QueryTestSpec.EventEnvelopeProbeOps diff --git a/core/src/test/scala/akka/persistence/jdbc/query/CurrentEventsByTagTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/CurrentEventsByTagTest.scala similarity index 96% rename from core/src/test/scala/akka/persistence/jdbc/query/CurrentEventsByTagTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/query/CurrentEventsByTagTest.scala index 2591349e..529e8a48 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/CurrentEventsByTagTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/CurrentEventsByTagTest.scala @@ -3,15 +3,15 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query +package org.apache.pekko.persistence.jdbc.query -import akka.persistence.query.{ EventEnvelope, NoOffset, Sequence } -import akka.pattern.ask +import org.apache.pekko.persistence.query.{ EventEnvelope, NoOffset, Sequence } +import org.apache.pekko.pattern.ask import com.typesafe.config.{ ConfigValue, ConfigValueFactory } import scala.concurrent.duration._ -import akka.Done -import akka.persistence.jdbc.query.EventAdapterTest.{ Event, TaggedAsyncEvent } +import org.apache.pekko.Done +import org.apache.pekko.persistence.jdbc.query.EventAdapterTest.{ Event, TaggedAsyncEvent } import scala.concurrent.Future import CurrentEventsByTagTest._ diff --git a/core/src/test/scala/akka/persistence/jdbc/query/CurrentPersistenceIdsTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/CurrentPersistenceIdsTest.scala similarity index 96% rename from core/src/test/scala/akka/persistence/jdbc/query/CurrentPersistenceIdsTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/query/CurrentPersistenceIdsTest.scala index c7e347f3..b6d58ecc 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/CurrentPersistenceIdsTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/CurrentPersistenceIdsTest.scala @@ -3,7 +3,7 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query +package org.apache.pekko.persistence.jdbc.query abstract class CurrentPersistenceIdsTest(config: String) extends QueryTestSpec(config) { it should "not find any persistenceIds for empty journal" in withActorSystem { implicit system => diff --git a/core/src/test/scala/akka/persistence/jdbc/query/EventAdapterTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/EventAdapterTest.scala similarity index 96% rename from core/src/test/scala/akka/persistence/jdbc/query/EventAdapterTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/query/EventAdapterTest.scala index 7e89e9b0..8582c83e 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/EventAdapterTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/EventAdapterTest.scala @@ -3,13 +3,13 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query +package org.apache.pekko.persistence.jdbc.query -import akka.persistence.query.{ EventEnvelope, NoOffset, Sequence } +import org.apache.pekko.persistence.query.{ EventEnvelope, NoOffset, Sequence } import scala.concurrent.duration._ -import akka.pattern.ask -import akka.persistence.journal.{ EventSeq, ReadEventAdapter, Tagged, WriteEventAdapter } +import org.apache.pekko.pattern.ask +import org.apache.pekko.persistence.journal.{ EventSeq, ReadEventAdapter, Tagged, WriteEventAdapter } object EventAdapterTest { case class Event(value: String) { diff --git a/core/src/test/scala/akka/persistence/jdbc/query/EventsByPersistenceIdTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/EventsByPersistenceIdTest.scala similarity index 96% rename from core/src/test/scala/akka/persistence/jdbc/query/EventsByPersistenceIdTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/query/EventsByPersistenceIdTest.scala index 3d634370..a6058d5f 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/EventsByPersistenceIdTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/EventsByPersistenceIdTest.scala @@ -3,16 +3,16 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query +package org.apache.pekko.persistence.jdbc.query -import akka.Done -import akka.persistence.jdbc.query.EventAdapterTest.{ Event, TaggedAsyncEvent } -import akka.persistence.query.{ EventEnvelope, Sequence } +import org.apache.pekko.Done +import org.apache.pekko.persistence.jdbc.query.EventAdapterTest.{ Event, TaggedAsyncEvent } +import org.apache.pekko.persistence.query.{ EventEnvelope, Sequence } import scala.concurrent.Future import scala.concurrent.duration._ -import akka.pattern.ask -import akka.persistence.query.Offset +import org.apache.pekko.pattern.ask +import org.apache.pekko.persistence.query.Offset abstract class EventsByPersistenceIdTest(config: String) extends QueryTestSpec(config) { import QueryTestSpec.EventEnvelopeProbeOps @@ -304,7 +304,7 @@ abstract class EventsByPersistenceIdTest(config: String) extends QueryTestSpec(c } it should "find a large number of events quickly" in withActorSystem { implicit system => - import akka.pattern.ask + import org.apache.pekko.pattern.ask import system.dispatcher val journalOps = new JavaDslJdbcReadJournalOperations(system) withTestActors(replyToMessages = true) { (actor1, _, _) => diff --git a/core/src/test/scala/akka/persistence/jdbc/query/EventsByTagTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/EventsByTagTest.scala similarity index 98% rename from core/src/test/scala/akka/persistence/jdbc/query/EventsByTagTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/query/EventsByTagTest.scala index 0c14055f..1b3c571d 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/EventsByTagTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/EventsByTagTest.scala @@ -3,12 +3,12 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query +package org.apache.pekko.persistence.jdbc.query -import akka.Done -import akka.persistence.query.{ EventEnvelope, NoOffset, Sequence } -import akka.pattern.ask -import akka.persistence.jdbc.query.EventAdapterTest.{ Event, EventRestored, TaggedAsyncEvent, TaggedEvent } +import org.apache.pekko.Done +import org.apache.pekko.persistence.query.{ EventEnvelope, NoOffset, Sequence } +import org.apache.pekko.pattern.ask +import org.apache.pekko.persistence.jdbc.query.EventAdapterTest.{ Event, EventRestored, TaggedAsyncEvent, TaggedEvent } import com.typesafe.config.{ ConfigValue, ConfigValueFactory } import scala.concurrent.duration._ diff --git a/core/src/test/scala/akka/persistence/jdbc/query/HardDeleteQueryTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/HardDeleteQueryTest.scala similarity index 96% rename from core/src/test/scala/akka/persistence/jdbc/query/HardDeleteQueryTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/query/HardDeleteQueryTest.scala index c71a450e..8a939269 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/HardDeleteQueryTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/HardDeleteQueryTest.scala @@ -3,10 +3,10 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query +package org.apache.pekko.persistence.jdbc.query -import akka.persistence.query.NoOffset -import akka.pattern._ +import org.apache.pekko.persistence.query.NoOffset +import org.apache.pekko.pattern._ import scala.concurrent.duration._ import org.scalatest.matchers.should.Matchers diff --git a/core/src/test/scala/akka/persistence/jdbc/query/JournalDaoStreamMessagesMemoryTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/JournalDaoStreamMessagesMemoryTest.scala similarity index 91% rename from core/src/test/scala/akka/persistence/jdbc/query/JournalDaoStreamMessagesMemoryTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/query/JournalDaoStreamMessagesMemoryTest.scala index efc6643c..2d65c587 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/JournalDaoStreamMessagesMemoryTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/JournalDaoStreamMessagesMemoryTest.scala @@ -3,17 +3,17 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query +package org.apache.pekko.persistence.jdbc.query import java.lang.management.ManagementFactory import java.lang.management.MemoryMXBean import java.util.UUID -import akka.actor.ActorSystem -import akka.persistence.{ AtomicWrite, PersistentRepr } -import akka.persistence.jdbc.journal.dao.legacy.{ ByteArrayJournalDao, JournalTables } -import akka.serialization.SerializationExtension -import akka.stream.scaladsl.{ Sink, Source } +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.persistence.{ AtomicWrite, PersistentRepr } +import org.apache.pekko.persistence.jdbc.journal.dao.legacy.{ ByteArrayJournalDao, JournalTables } +import org.apache.pekko.serialization.SerializationExtension +import org.apache.pekko.stream.scaladsl.{ Sink, Source } import com.typesafe.config.{ ConfigValue, ConfigValueFactory } import org.scalatest.concurrent.PatienceConfiguration.Timeout import org.slf4j.LoggerFactory @@ -22,7 +22,7 @@ import scala.collection.immutable import scala.concurrent.ExecutionContextExecutor import scala.concurrent.duration._ import scala.util.{ Failure, Success } -import akka.stream.testkit.scaladsl.TestSink +import org.apache.pekko.stream.testkit.scaladsl.TestSink import org.scalatest.matchers.should.Matchers object JournalDaoStreamMessagesMemoryTest { diff --git a/core/src/test/scala/akka/persistence/jdbc/query/JournalSequenceActorTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/JournalSequenceActorTest.scala similarity index 93% rename from core/src/test/scala/akka/persistence/jdbc/query/JournalSequenceActorTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/query/JournalSequenceActorTest.scala index 749eb07e..eed85bbf 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/JournalSequenceActorTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/JournalSequenceActorTest.scala @@ -3,19 +3,19 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query - -import akka.actor.{ ActorRef, ActorSystem } -import akka.pattern.ask -import akka.persistence.jdbc.config.JournalSequenceRetrievalConfig -import akka.persistence.jdbc.journal.dao.legacy.{ JournalRow, JournalTables } -import akka.persistence.jdbc.query.JournalSequenceActor.{ GetMaxOrderingId, MaxOrderingId } -import akka.persistence.jdbc.query.dao.TestProbeReadJournalDao -import akka.persistence.jdbc.SharedActorSystemTestSpec -import akka.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao -import akka.serialization.SerializationExtension -import akka.stream.scaladsl.{ Sink, Source } -import akka.testkit.TestProbe +package org.apache.pekko.persistence.jdbc.query + +import org.apache.pekko.actor.{ ActorRef, ActorSystem } +import org.apache.pekko.pattern.ask +import org.apache.pekko.persistence.jdbc.config.JournalSequenceRetrievalConfig +import org.apache.pekko.persistence.jdbc.journal.dao.legacy.{ JournalRow, JournalTables } +import org.apache.pekko.persistence.jdbc.query.JournalSequenceActor.{ GetMaxOrderingId, MaxOrderingId } +import org.apache.pekko.persistence.jdbc.query.dao.TestProbeReadJournalDao +import org.apache.pekko.persistence.jdbc.SharedActorSystemTestSpec +import org.apache.pekko.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao +import org.apache.pekko.serialization.SerializationExtension +import org.apache.pekko.stream.scaladsl.{ Sink, Source } +import org.apache.pekko.testkit.TestProbe import org.slf4j.LoggerFactory import slick.jdbc.{ JdbcBackend, JdbcCapabilities } diff --git a/core/src/test/scala/akka/persistence/jdbc/query/MultipleReadJournalTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/MultipleReadJournalTest.scala similarity index 75% rename from core/src/test/scala/akka/persistence/jdbc/query/MultipleReadJournalTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/query/MultipleReadJournalTest.scala index 04519949..6b063705 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/MultipleReadJournalTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/MultipleReadJournalTest.scala @@ -3,12 +3,12 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query +package org.apache.pekko.persistence.jdbc.query -import akka.persistence.jdbc.query.EventsByTagTest._ -import akka.persistence.jdbc.query.scaladsl.JdbcReadJournal -import akka.persistence.query.{ NoOffset, PersistenceQuery } -import akka.stream.scaladsl.Sink +import org.apache.pekko.persistence.jdbc.query.EventsByTagTest._ +import org.apache.pekko.persistence.jdbc.query.scaladsl.JdbcReadJournal +import org.apache.pekko.persistence.query.{ NoOffset, PersistenceQuery } +import org.apache.pekko.stream.scaladsl.Sink class MultipleReadJournalTest extends QueryTestSpec("h2-two-read-journals-application.conf", configOverrides) diff --git a/core/src/test/scala/akka/persistence/jdbc/query/QueryTestSpec.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/QueryTestSpec.scala similarity index 82% rename from core/src/test/scala/akka/persistence/jdbc/query/QueryTestSpec.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/query/QueryTestSpec.scala index 42ccf9e7..c51c8b2d 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/QueryTestSpec.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/QueryTestSpec.scala @@ -3,32 +3,32 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query - -import akka.actor.{ ActorRef, ActorSystem, Props, Stash, Status } -import akka.pattern.ask -import akka.event.LoggingReceive -import akka.persistence.{ DeleteMessagesFailure, DeleteMessagesSuccess, PersistentActor } -import akka.persistence.jdbc.SingleActorSystemPerTestSpec -import akka.persistence.jdbc.query.EventAdapterTest.{ Event, TaggedAsyncEvent, TaggedEvent } -import akka.persistence.jdbc.query.javadsl.{ JdbcReadJournal => JavaJdbcReadJournal } -import akka.persistence.jdbc.query.scaladsl.JdbcReadJournal -import akka.persistence.journal.Tagged -import akka.persistence.query.{ EventEnvelope, Offset, PersistenceQuery } -import akka.stream.scaladsl.Sink -import akka.stream.testkit.TestSubscriber -import akka.stream.testkit.javadsl.{ TestSink => JavaSink } -import akka.stream.testkit.scaladsl.TestSink -import akka.stream.{ Materializer, SystemMaterializer } +package org.apache.pekko.persistence.jdbc.query + +import org.apache.pekko.actor.{ ActorRef, ActorSystem, Props, Stash, Status } +import org.apache.pekko.pattern.ask +import org.apache.pekko.event.LoggingReceive +import org.apache.pekko.persistence.{ DeleteMessagesFailure, DeleteMessagesSuccess, PersistentActor } +import org.apache.pekko.persistence.jdbc.SingleActorSystemPerTestSpec +import org.apache.pekko.persistence.jdbc.query.EventAdapterTest.{ Event, TaggedAsyncEvent, TaggedEvent } +import org.apache.pekko.persistence.jdbc.query.javadsl.{ JdbcReadJournal => JavaJdbcReadJournal } +import org.apache.pekko.persistence.jdbc.query.scaladsl.JdbcReadJournal +import org.apache.pekko.persistence.journal.Tagged +import org.apache.pekko.persistence.query.{ EventEnvelope, Offset, PersistenceQuery } +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.testkit.TestSubscriber +import org.apache.pekko.stream.testkit.javadsl.{ TestSink => JavaSink } +import org.apache.pekko.stream.testkit.scaladsl.TestSink +import org.apache.pekko.stream.{ Materializer, SystemMaterializer } import com.typesafe.config.ConfigValue import scala.concurrent.Future import scala.concurrent.duration.{ FiniteDuration, _ } -import akka.persistence.jdbc.testkit.internal.H2 -import akka.persistence.jdbc.testkit.internal.MySQL -import akka.persistence.jdbc.testkit.internal.Oracle -import akka.persistence.jdbc.testkit.internal.Postgres -import akka.persistence.jdbc.testkit.internal.SqlServer +import org.apache.pekko.persistence.jdbc.testkit.internal.H2 +import org.apache.pekko.persistence.jdbc.testkit.internal.MySQL +import org.apache.pekko.persistence.jdbc.testkit.internal.Oracle +import org.apache.pekko.persistence.jdbc.testkit.internal.Postgres +import org.apache.pekko.persistence.jdbc.testkit.internal.SqlServer trait ReadJournalOperations { def withCurrentPersistenceIds(within: FiniteDuration = 60.second)(f: TestSubscriber.Probe[String] => Unit): Unit @@ -121,13 +121,13 @@ class JavaDslJdbcReadJournalOperations(readJournal: javadsl.JdbcReadJournal)( import system.dispatcher def withCurrentPersistenceIds(within: FiniteDuration)(f: TestSubscriber.Probe[String] => Unit): Unit = { - val sink: akka.stream.javadsl.Sink[String, TestSubscriber.Probe[String]] = JavaSink.probe(system) + val sink: org.apache.pekko.stream.javadsl.Sink[String, TestSubscriber.Probe[String]] = JavaSink.probe(system) val tp = readJournal.currentPersistenceIds().runWith(sink, mat) tp.within(within)(f(tp)) } def withPersistenceIds(within: FiniteDuration)(f: TestSubscriber.Probe[String] => Unit): Unit = { - val sink: akka.stream.javadsl.Sink[String, TestSubscriber.Probe[String]] = JavaSink.probe(system) + val sink: org.apache.pekko.stream.javadsl.Sink[String, TestSubscriber.Probe[String]] = JavaSink.probe(system) val tp = readJournal.persistenceIds().runWith(sink, mat) tp.within(within)(f(tp)) } @@ -135,7 +135,8 @@ class JavaDslJdbcReadJournalOperations(readJournal: javadsl.JdbcReadJournal)( def withCurrentEventsByPersistenceId( within: FiniteDuration)(persistenceId: String, fromSequenceNr: Long = 0, toSequenceNr: Long = Long.MaxValue)( f: TestSubscriber.Probe[EventEnvelope] => Unit): Unit = { - val sink: akka.stream.javadsl.Sink[EventEnvelope, TestSubscriber.Probe[EventEnvelope]] = JavaSink.probe(system) + val sink: org.apache.pekko.stream.javadsl.Sink[EventEnvelope, TestSubscriber.Probe[EventEnvelope]] = + JavaSink.probe(system) val tp = readJournal.currentEventsByPersistenceId(persistenceId, fromSequenceNr, toSequenceNr).runWith(sink, mat) tp.within(within)(f(tp)) } @@ -143,21 +144,24 @@ class JavaDslJdbcReadJournalOperations(readJournal: javadsl.JdbcReadJournal)( def withEventsByPersistenceId( within: FiniteDuration)(persistenceId: String, fromSequenceNr: Long, toSequenceNr: Long)( f: TestSubscriber.Probe[EventEnvelope] => Unit): Unit = { - val sink: akka.stream.javadsl.Sink[EventEnvelope, TestSubscriber.Probe[EventEnvelope]] = JavaSink.probe(system) + val sink: org.apache.pekko.stream.javadsl.Sink[EventEnvelope, TestSubscriber.Probe[EventEnvelope]] = + JavaSink.probe(system) val tp = readJournal.eventsByPersistenceId(persistenceId, fromSequenceNr, toSequenceNr).runWith(sink, mat) tp.within(within)(f(tp)) } def withCurrentEventsByTag(within: FiniteDuration)(tag: String, offset: Offset)( f: TestSubscriber.Probe[EventEnvelope] => Unit): Unit = { - val sink: akka.stream.javadsl.Sink[EventEnvelope, TestSubscriber.Probe[EventEnvelope]] = JavaSink.probe(system) + val sink: org.apache.pekko.stream.javadsl.Sink[EventEnvelope, TestSubscriber.Probe[EventEnvelope]] = + JavaSink.probe(system) val tp = readJournal.currentEventsByTag(tag, offset).runWith(sink, mat) tp.within(within)(f(tp)) } def withEventsByTag(within: FiniteDuration)(tag: String, offset: Offset)( f: TestSubscriber.Probe[EventEnvelope] => Unit): Unit = { - val sink: akka.stream.javadsl.Sink[EventEnvelope, TestSubscriber.Probe[EventEnvelope]] = JavaSink.probe(system) + val sink: org.apache.pekko.stream.javadsl.Sink[EventEnvelope, TestSubscriber.Probe[EventEnvelope]] = + JavaSink.probe(system) val tp = readJournal.eventsByTag(tag, offset).runWith(sink, mat) tp.within(within)(f(tp)) } @@ -237,26 +241,26 @@ abstract class QueryTestSpec(config: String, configOverrides: Map[String, Config case event: Int => persist(event) { (event: Int) => updateState(event) - if (replyToMessages) sender() ! akka.actor.Status.Success(event) + if (replyToMessages) sender() ! org.apache.pekko.actor.Status.Success(event) } case event @ Tagged(payload: Int, tags) => persist(event) { _ => updateState(payload) - if (replyToMessages) sender() ! akka.actor.Status.Success((payload, tags)) + if (replyToMessages) sender() ! org.apache.pekko.actor.Status.Success((payload, tags)) } case event: Event => persist(event) { evt => - if (replyToMessages) sender() ! akka.actor.Status.Success(evt) + if (replyToMessages) sender() ! org.apache.pekko.actor.Status.Success(evt) } case event @ TaggedEvent(payload: Event, tag) => persist(event) { _ => - if (replyToMessages) sender() ! akka.actor.Status.Success((payload, tag)) + if (replyToMessages) sender() ! org.apache.pekko.actor.Status.Success((payload, tag)) } case event @ TaggedAsyncEvent(payload: Event, tag) => persistAsync(event) { _ => - if (replyToMessages) sender() ! akka.actor.Status.Success((payload, tag)) + if (replyToMessages) sender() ! org.apache.pekko.actor.Status.Success((payload, tag)) } } @@ -288,7 +292,7 @@ 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) + org.apache.pekko.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao].getName) pending // TODO https://github.com/akka/akka-persistence-jdbc/issues/673 } diff --git a/core/src/test/scala/akka/persistence/jdbc/query/TaggingEventAdapter.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/TaggingEventAdapter.scala similarity index 75% rename from core/src/test/scala/akka/persistence/jdbc/query/TaggingEventAdapter.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/query/TaggingEventAdapter.scala index ca038285..4335ef03 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/TaggingEventAdapter.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/TaggingEventAdapter.scala @@ -3,10 +3,10 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query +package org.apache.pekko.persistence.jdbc.query -import akka.persistence.jdbc.query.TaggingEventAdapter.TagEvent -import akka.persistence.journal.{ Tagged, WriteEventAdapter } +import org.apache.pekko.persistence.jdbc.query.TaggingEventAdapter.TagEvent +import org.apache.pekko.persistence.journal.{ Tagged, WriteEventAdapter } object TaggingEventAdapter { case class TagEvent(payload: Any, tags: Set[String]) diff --git a/core/src/test/scala/akka/persistence/jdbc/query/dao/ReadJournalTablesTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/dao/ReadJournalTablesTest.scala similarity index 88% rename from core/src/test/scala/akka/persistence/jdbc/query/dao/ReadJournalTablesTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/query/dao/ReadJournalTablesTest.scala index 9bb65354..dac47176 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/dao/ReadJournalTablesTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/dao/ReadJournalTablesTest.scala @@ -3,10 +3,10 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query.dao.legacy +package org.apache.pekko.persistence.jdbc.query.dao -import akka.persistence.jdbc.TablesTestSpec -import akka.persistence.jdbc.journal.dao.legacy.JournalTables +import org.apache.pekko.persistence.jdbc.TablesTestSpec +import org.apache.pekko.persistence.jdbc.journal.dao.legacy.JournalTables import slick.jdbc.JdbcProfile class ReadJournalTablesTest extends TablesTestSpec { diff --git a/core/src/test/scala/akka/persistence/jdbc/query/dao/TestProbeReadJournalDao.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/dao/TestProbeReadJournalDao.scala similarity index 83% rename from core/src/test/scala/akka/persistence/jdbc/query/dao/TestProbeReadJournalDao.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/query/dao/TestProbeReadJournalDao.scala index 4a8779ce..90b9f273 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/dao/TestProbeReadJournalDao.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/query/dao/TestProbeReadJournalDao.scala @@ -3,20 +3,20 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.query.dao +package org.apache.pekko.persistence.jdbc.query.dao -import akka.NotUsed -import akka.persistence.jdbc.query.dao.TestProbeReadJournalDao.JournalSequence -import akka.persistence.PersistentRepr -import akka.stream.scaladsl.Source -import akka.testkit.TestProbe -import akka.util.Timeout -import akka.pattern.ask +import org.apache.pekko.NotUsed +import org.apache.pekko.persistence.jdbc.query.dao.TestProbeReadJournalDao.JournalSequence +import org.apache.pekko.persistence.PersistentRepr +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.testkit.TestProbe +import org.apache.pekko.util.Timeout +import org.apache.pekko.pattern.ask import scala.concurrent.Future import scala.concurrent.duration._ import scala.util.Try -import akka.actor.Scheduler +import org.apache.pekko.actor.Scheduler object TestProbeReadJournalDao { case class JournalSequence(offset: Long, limit: Long) diff --git a/core/src/test/scala/akka/persistence/jdbc/serialization/StoreOnlySerializableMessagesTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/serialization/StoreOnlySerializableMessagesTest.scala similarity index 85% rename from core/src/test/scala/akka/persistence/jdbc/serialization/StoreOnlySerializableMessagesTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/serialization/StoreOnlySerializableMessagesTest.scala index d7ce3ef4..9b99a3d5 100644 --- a/core/src/test/scala/akka/persistence/jdbc/serialization/StoreOnlySerializableMessagesTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/serialization/StoreOnlySerializableMessagesTest.scala @@ -3,19 +3,19 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.serialization +package org.apache.pekko.persistence.jdbc.serialization import scala.concurrent.duration._ -import akka.actor.ActorRef -import akka.actor.Props -import akka.event.LoggingReceive -import akka.persistence.PersistentActor -import akka.persistence.RecoveryCompleted -import akka.persistence.jdbc.SharedActorSystemTestSpec -import akka.persistence.jdbc.testkit.internal.H2 -import akka.persistence.jdbc.testkit.internal.SchemaType -import akka.testkit.TestProbe +import org.apache.pekko.actor.ActorRef +import org.apache.pekko.actor.Props +import org.apache.pekko.event.LoggingReceive +import org.apache.pekko.persistence.PersistentActor +import org.apache.pekko.persistence.RecoveryCompleted +import org.apache.pekko.persistence.jdbc.SharedActorSystemTestSpec +import org.apache.pekko.persistence.jdbc.testkit.internal.H2 +import org.apache.pekko.persistence.jdbc.testkit.internal.SchemaType +import org.apache.pekko.testkit.TestProbe abstract class StoreOnlySerializableMessagesTest(config: String, schemaType: SchemaType) extends SharedActorSystemTestSpec(config) { @@ -34,7 +34,7 @@ abstract class StoreOnlySerializableMessagesTest(config: String, schemaType: Sch override val receiveCommand: Receive = LoggingReceive { case msg => persist(msg) { _ => - sender ! akka.actor.Status.Success("") + sender ! org.apache.pekko.actor.Status.Success("") } } @@ -65,7 +65,7 @@ abstract class StoreOnlySerializableMessagesTest(config: String, schemaType: Sch val tp = TestProbe() recover.expectMsg(RecoveryCompleted) tp.send(actor, "foo") // strings are serializable - tp.expectMsg(akka.actor.Status.Success("")) + tp.expectMsg(org.apache.pekko.actor.Status.Success("")) failure.expectNoMessage(100.millis) rejected.expectNoMessage(100.millis) } @@ -104,7 +104,7 @@ abstract class StoreOnlySerializableMessagesTest(config: String, schemaType: Sch val tp = TestProbe() recover.expectMsg(RecoveryCompleted) tp.send(actor, "foo") - tp.expectMsg(akka.actor.Status.Success("")) + tp.expectMsg(org.apache.pekko.actor.Status.Success("")) tp.send(actor, new NotSerializable) // the NotSerializable class cannot be serialized tp.expectNoMessage(300.millis) // the handler should not have been called, because persist has failed // the actor should call the OnPersistRejected diff --git a/core/src/test/scala/akka/persistence/jdbc/snapshot/JdbcSnapshotStoreSpec.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/snapshot/JdbcSnapshotStoreSpec.scala similarity index 72% rename from core/src/test/scala/akka/persistence/jdbc/snapshot/JdbcSnapshotStoreSpec.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/snapshot/JdbcSnapshotStoreSpec.scala index 1ec1b262..77ba42d9 100644 --- a/core/src/test/scala/akka/persistence/jdbc/snapshot/JdbcSnapshotStoreSpec.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/snapshot/JdbcSnapshotStoreSpec.scala @@ -3,20 +3,20 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.snapshot +package org.apache.pekko.persistence.jdbc.snapshot -import akka.persistence.CapabilityFlag -import akka.persistence.jdbc.config._ -import akka.persistence.jdbc.util.{ ClasspathResources, DropCreate } -import akka.persistence.jdbc.db.SlickDatabase -import akka.persistence.snapshot.SnapshotStoreSpec +import org.apache.pekko.persistence.CapabilityFlag +import org.apache.pekko.persistence.jdbc.config._ +import org.apache.pekko.persistence.jdbc.util.{ ClasspathResources, DropCreate } +import org.apache.pekko.persistence.jdbc.db.SlickDatabase +import org.apache.pekko.persistence.snapshot.SnapshotStoreSpec import com.typesafe.config.{ Config, ConfigFactory } import org.scalatest.BeforeAndAfterAll import org.scalatest.concurrent.ScalaFutures import scala.concurrent.duration._ -import akka.persistence.jdbc.testkit.internal.H2 -import akka.persistence.jdbc.testkit.internal.SchemaType +import org.apache.pekko.persistence.jdbc.testkit.internal.H2 +import org.apache.pekko.persistence.jdbc.testkit.internal.SchemaType abstract class JdbcSnapshotStoreSpec(config: Config, schemaType: SchemaType) extends SnapshotStoreSpec(config) diff --git a/core/src/test/scala/akka/persistence/jdbc/snapshot/dao/legacy/SnapshotTablesTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/legacy/SnapshotTablesTest.scala similarity index 93% rename from core/src/test/scala/akka/persistence/jdbc/snapshot/dao/legacy/SnapshotTablesTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/legacy/SnapshotTablesTest.scala index e8caf45b..25b46430 100644 --- a/core/src/test/scala/akka/persistence/jdbc/snapshot/dao/legacy/SnapshotTablesTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/snapshot/dao/legacy/SnapshotTablesTest.scala @@ -3,9 +3,9 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.snapshot.dao.legacy +package org.apache.pekko.persistence.jdbc.snapshot.dao.legacy -import akka.persistence.jdbc.TablesTestSpec +import org.apache.pekko.persistence.jdbc.TablesTestSpec import slick.jdbc.JdbcProfile class SnapshotTablesTest extends TablesTestSpec { diff --git a/core/src/test/scala/akka/persistence/jdbc/state/Payloads.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/Payloads.scala similarity index 90% rename from core/src/test/scala/akka/persistence/jdbc/state/Payloads.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/state/Payloads.scala index e36026f5..3259ed56 100644 --- a/core/src/test/scala/akka/persistence/jdbc/state/Payloads.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/Payloads.scala @@ -3,9 +3,9 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.state +package org.apache.pekko.persistence.jdbc.state -import akka.serialization._ +import org.apache.pekko.serialization._ final case class MyPayload(data: String) diff --git a/core/src/test/scala/akka/persistence/jdbc/state/ScaladslSnippets.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/ScaladslSnippets.scala similarity index 64% rename from core/src/test/scala/akka/persistence/jdbc/state/ScaladslSnippets.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/state/ScaladslSnippets.scala index 4537d661..e204a293 100644 --- a/core/src/test/scala/akka/persistence/jdbc/state/ScaladslSnippets.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/ScaladslSnippets.scala @@ -1,8 +1,8 @@ -package akka.persistence.jdbc.state +package org.apache.pekko.persistence.jdbc.state import scala.concurrent.Future -import akka.actor.ActorSystem -import akka.Done +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.Done import org.scalatest.concurrent.ScalaFutures import org.scalatest.matchers.should.Matchers @@ -10,7 +10,7 @@ object ScaladslSnippets extends ScalaFutures with Matchers { def create(): Unit = { // #create - import akka.persistence.jdbc.testkit.scaladsl.SchemaUtils + import org.apache.pekko.persistence.jdbc.testkit.scaladsl.SchemaUtils implicit val system: ActorSystem = ActorSystem("example") val _: Future[Done] = SchemaUtils.createIfNotExists() @@ -21,8 +21,8 @@ object ScaladslSnippets extends ScalaFutures with Matchers { implicit val system: ActorSystem = ActorSystem() // #jdbc-durable-state-store - import akka.persistence.state.DurableStateStoreRegistry - import akka.persistence.jdbc.state.scaladsl.JdbcDurableStateStore + import org.apache.pekko.persistence.state.DurableStateStoreRegistry + import org.apache.pekko.persistence.jdbc.state.scaladsl.JdbcDurableStateStore val store = DurableStateStoreRegistry .get(system) .durableStateStoreFor[JdbcDurableStateStore[String]](JdbcDurableStateStore.Identifier) @@ -33,9 +33,9 @@ object ScaladslSnippets extends ScalaFutures with Matchers { implicit val system: ActorSystem = ActorSystem() // #get-object - import akka.persistence.state.DurableStateStoreRegistry - import akka.persistence.jdbc.state.scaladsl.JdbcDurableStateStore - import akka.persistence.state.scaladsl.GetObjectResult + import org.apache.pekko.persistence.state.DurableStateStoreRegistry + import org.apache.pekko.persistence.jdbc.state.scaladsl.JdbcDurableStateStore + import org.apache.pekko.persistence.state.scaladsl.GetObjectResult val store = DurableStateStoreRegistry .get(system) @@ -51,9 +51,9 @@ object ScaladslSnippets extends ScalaFutures with Matchers { implicit val e = system.dispatcher // #upsert-get-object - import akka.persistence.state.DurableStateStoreRegistry - import akka.persistence.jdbc.state.scaladsl.JdbcDurableStateStore - import akka.persistence.state.scaladsl.GetObjectResult + import org.apache.pekko.persistence.state.DurableStateStoreRegistry + import org.apache.pekko.persistence.jdbc.state.scaladsl.JdbcDurableStateStore + import org.apache.pekko.persistence.state.scaladsl.GetObjectResult val store = DurableStateStoreRegistry .get(system) @@ -62,11 +62,11 @@ object ScaladslSnippets extends ScalaFutures with Matchers { val v: Future[GetObjectResult[String]] = for { n <- store.upsertObject("p234", 1, "a valid string", "t123") - _ = n shouldBe akka.Done + _ = n shouldBe org.apache.pekko.Done g <- store.getObject("p234") _ = g.value shouldBe Some("a valid string") u <- store.upsertObject("p234", 2, "updated valid string", "t123") - _ = u shouldBe akka.Done + _ = u shouldBe org.apache.pekko.Done h <- store.getObject("p234") } yield h @@ -78,8 +78,8 @@ object ScaladslSnippets extends ScalaFutures with Matchers { implicit val system: ActorSystem = ActorSystem() // #delete-object - import akka.persistence.state.DurableStateStoreRegistry - import akka.persistence.jdbc.state.scaladsl.JdbcDurableStateStore + import org.apache.pekko.persistence.state.DurableStateStoreRegistry + import org.apache.pekko.persistence.jdbc.state.scaladsl.JdbcDurableStateStore val store = DurableStateStoreRegistry .get(system) @@ -94,11 +94,11 @@ object ScaladslSnippets extends ScalaFutures with Matchers { implicit val system: ActorSystem = ActorSystem() // #current-changes - import akka.NotUsed - import akka.stream.scaladsl.Source - import akka.persistence.state.DurableStateStoreRegistry - import akka.persistence.jdbc.state.scaladsl.JdbcDurableStateStore - import akka.persistence.query.{ DurableStateChange, NoOffset } + import org.apache.pekko.NotUsed + import org.apache.pekko.stream.scaladsl.Source + import org.apache.pekko.persistence.state.DurableStateStoreRegistry + import org.apache.pekko.persistence.jdbc.state.scaladsl.JdbcDurableStateStore + import org.apache.pekko.persistence.query.{ DurableStateChange, NoOffset } val store = DurableStateStoreRegistry .get(system) @@ -113,11 +113,11 @@ object ScaladslSnippets extends ScalaFutures with Matchers { implicit val system: ActorSystem = ActorSystem() // #changes - import akka.NotUsed - import akka.stream.scaladsl.Source - import akka.persistence.state.DurableStateStoreRegistry - import akka.persistence.jdbc.state.scaladsl.JdbcDurableStateStore - import akka.persistence.query.{ DurableStateChange, NoOffset } + import org.apache.pekko.NotUsed + import org.apache.pekko.stream.scaladsl.Source + import org.apache.pekko.persistence.state.DurableStateStoreRegistry + import org.apache.pekko.persistence.jdbc.state.scaladsl.JdbcDurableStateStore + import org.apache.pekko.persistence.query.{ DurableStateChange, NoOffset } val store = DurableStateStoreRegistry .get(system) diff --git a/core/src/test/scala/akka/persistence/jdbc/state/scaladsl/DataGenerationHelper.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/DataGenerationHelper.scala similarity index 97% rename from core/src/test/scala/akka/persistence/jdbc/state/scaladsl/DataGenerationHelper.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/DataGenerationHelper.scala index abdc2b1c..25d5d667 100644 --- a/core/src/test/scala/akka/persistence/jdbc/state/scaladsl/DataGenerationHelper.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/DataGenerationHelper.scala @@ -3,7 +3,7 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.state.scaladsl +package org.apache.pekko.persistence.jdbc.state.scaladsl import org.scalatest.concurrent.ScalaFutures import scala.concurrent.{ ExecutionContext, Future } diff --git a/core/src/test/scala/akka/persistence/jdbc/state/scaladsl/DurableStateSequenceActorTest.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/DurableStateSequenceActorTest.scala similarity index 95% rename from core/src/test/scala/akka/persistence/jdbc/state/scaladsl/DurableStateSequenceActorTest.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/DurableStateSequenceActorTest.scala index e3c0104f..741249a6 100644 --- a/core/src/test/scala/akka/persistence/jdbc/state/scaladsl/DurableStateSequenceActorTest.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/DurableStateSequenceActorTest.scala @@ -3,20 +3,23 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.state.scaladsl +package org.apache.pekko.persistence.jdbc.state.scaladsl import scala.concurrent.Future import scala.concurrent.duration._ import com.typesafe.config.{ Config, ConfigFactory } -import akka.actor.{ ActorRef, ActorSystem, ExtendedActorSystem } -import akka.pattern.ask -import akka.persistence.jdbc.SharedActorSystemTestSpec -import akka.persistence.jdbc.state.scaladsl.DurableStateSequenceActor.VisitedElement -import akka.persistence.jdbc.state.scaladsl.DurableStateSequenceActor.{ GetMaxGlobalOffset, MaxGlobalOffset } -import akka.persistence.jdbc.testkit.internal.{ H2, SchemaType } -import akka.testkit.TestProbe -import akka.util.Timeout +import org.apache.pekko.actor.{ ActorRef, ActorSystem, ExtendedActorSystem } +import org.apache.pekko.pattern.ask +import org.apache.pekko.persistence.jdbc.SharedActorSystemTestSpec +import org.apache.pekko.persistence.jdbc.state.scaladsl.DurableStateSequenceActor.VisitedElement +import org.apache.pekko.persistence.jdbc.state.scaladsl.DurableStateSequenceActor.{ + GetMaxGlobalOffset, + MaxGlobalOffset +} +import org.apache.pekko.persistence.jdbc.testkit.internal.{ H2, SchemaType } +import org.apache.pekko.testkit.TestProbe +import org.apache.pekko.util.Timeout import org.scalatest.concurrent.Eventually abstract class DurableStateSequenceActorTest(config: Config, schemaType: SchemaType) @@ -359,7 +362,7 @@ class MockDurableStateSequenceActorTest extends SharedActorSystemTestSpec { } } - import akka.persistence.jdbc.config.DurableStateTableConfiguration + import org.apache.pekko.persistence.jdbc.config.DurableStateTableConfiguration def withTestProbeDurableStateSequenceActor( batchSize: Int, maxTries: Int, diff --git a/core/src/test/scala/akka/persistence/jdbc/state/scaladsl/DurableStateStorePluginSpec.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/DurableStateStorePluginSpec.scala similarity index 83% rename from core/src/test/scala/akka/persistence/jdbc/state/scaladsl/DurableStateStorePluginSpec.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/DurableStateStorePluginSpec.scala index da999b91..2af88ecc 100644 --- a/core/src/test/scala/akka/persistence/jdbc/state/scaladsl/DurableStateStorePluginSpec.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/DurableStateStorePluginSpec.scala @@ -1,13 +1,13 @@ -package akka.persistence.jdbc.state.scaladsl +package org.apache.pekko.persistence.jdbc.state.scaladsl import com.typesafe.config.{ Config, ConfigFactory } -import akka.actor._ +import org.apache.pekko.actor._ import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpecLike import org.scalatest.BeforeAndAfterAll import org.scalatest.concurrent.ScalaFutures -import akka.persistence.jdbc.state.scaladsl.JdbcDurableStateStore -import akka.persistence.state.DurableStateStoreRegistry +import org.apache.pekko.persistence.jdbc.state.scaladsl.JdbcDurableStateStore +import org.apache.pekko.persistence.state.DurableStateStoreRegistry import slick.jdbc.{ H2Profile, JdbcProfile } abstract class DurableStateStorePluginSpec(config: Config, profile: JdbcProfile) diff --git a/core/src/test/scala/akka/persistence/jdbc/state/scaladsl/JdbcDurableStateSpec.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/JdbcDurableStateSpec.scala similarity index 94% rename from core/src/test/scala/akka/persistence/jdbc/state/scaladsl/JdbcDurableStateSpec.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/JdbcDurableStateSpec.scala index 139768d8..a0c355bd 100644 --- a/core/src/test/scala/akka/persistence/jdbc/state/scaladsl/JdbcDurableStateSpec.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/JdbcDurableStateSpec.scala @@ -3,16 +3,16 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.state.scaladsl +package org.apache.pekko.persistence.jdbc.state.scaladsl import com.typesafe.config.{ Config, ConfigFactory } -import akka.actor._ -import akka.persistence.jdbc.state.{ MyPayload, OffsetSyntax } +import org.apache.pekko.actor._ +import org.apache.pekko.persistence.jdbc.state.{ MyPayload, OffsetSyntax } import OffsetSyntax._ -import akka.persistence.jdbc.testkit.internal.{ H2, Postgres, SchemaType } -import akka.persistence.query.UpdatedDurableState -import akka.persistence.query.{ NoOffset, Offset, Sequence } -import akka.stream.scaladsl.Sink +import org.apache.pekko.persistence.jdbc.testkit.internal.{ H2, Postgres, SchemaType } +import org.apache.pekko.persistence.query.UpdatedDurableState +import org.apache.pekko.persistence.query.{ NoOffset, Offset, Sequence } +import org.apache.pekko.stream.scaladsl.Sink import org.scalatest.time.Millis import org.scalatest.time.Seconds import org.scalatest.time.Span @@ -37,7 +37,7 @@ abstract class JdbcDurableStateSpec(config: Config, schemaType: SchemaType) exte whenReady { stateStoreString.upsertObject("p123", 1, "a valid string", "t123") } { v => - v shouldBe akka.Done + v shouldBe org.apache.pekko.Done } } "support composite upsert-fetch-repeat loop" in { @@ -45,11 +45,11 @@ abstract class JdbcDurableStateSpec(config: Config, schemaType: SchemaType) exte for { n <- stateStoreString.upsertObject("p234", 1, "a valid string", "t123") - _ = n shouldBe akka.Done + _ = n shouldBe org.apache.pekko.Done g <- stateStoreString.getObject("p234") _ = g.value shouldBe Some("a valid string") u <- stateStoreString.upsertObject("p234", 2, "updated valid string", "t123") - _ = u shouldBe akka.Done + _ = u shouldBe org.apache.pekko.Done h <- stateStoreString.getObject("p234") } yield h @@ -62,7 +62,7 @@ abstract class JdbcDurableStateSpec(config: Config, schemaType: SchemaType) exte (for { n <- stateStoreString.upsertObject("p345", 1, "a valid string", "t123") - _ = n shouldBe akka.Done + _ = n shouldBe org.apache.pekko.Done g <- stateStoreString.getObject("p345") _ = g.value shouldBe Some("a valid string") u <- stateStoreString.upsertObject("p345", 1, "updated valid string", "t123") @@ -96,7 +96,7 @@ abstract class JdbcDurableStateSpec(config: Config, schemaType: SchemaType) exte whenReady { stateStoreString.deleteObject("p123") } { v => - v shouldBe akka.Done + v shouldBe org.apache.pekko.Done whenReady { stateStoreString.getObject("p123") } { v => @@ -121,7 +121,7 @@ abstract class JdbcDurableStateSpec(config: Config, schemaType: SchemaType) exte whenReady { stateStorePayload.upsertObject("p123", 1, MyPayload("a valid string"), "t123") } { v => - v shouldBe akka.Done + v shouldBe org.apache.pekko.Done } } "support composite upsert-fetch-repeat loop" in { @@ -129,11 +129,11 @@ abstract class JdbcDurableStateSpec(config: Config, schemaType: SchemaType) exte for { n <- stateStorePayload.upsertObject("p234", 1, MyPayload("a valid string"), "t123") - _ = n shouldBe akka.Done + _ = n shouldBe org.apache.pekko.Done g <- stateStorePayload.getObject("p234") _ = g.value shouldBe Some(MyPayload("a valid string")) u <- stateStorePayload.upsertObject("p234", 2, MyPayload("updated valid string"), "t123") - _ = u shouldBe akka.Done + _ = u shouldBe org.apache.pekko.Done h <- stateStorePayload.getObject("p234") } yield h @@ -145,7 +145,7 @@ abstract class JdbcDurableStateSpec(config: Config, schemaType: SchemaType) exte whenReady { stateStorePayload.deleteObject("p234") } { v => - v shouldBe akka.Done + v shouldBe org.apache.pekko.Done whenReady { stateStorePayload.getObject("p234") } { v => diff --git a/core/src/test/scala/akka/persistence/jdbc/state/scaladsl/StateSpecBase.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/StateSpecBase.scala similarity index 76% rename from core/src/test/scala/akka/persistence/jdbc/state/scaladsl/StateSpecBase.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/StateSpecBase.scala index b774ab2f..7aaecbec 100644 --- a/core/src/test/scala/akka/persistence/jdbc/state/scaladsl/StateSpecBase.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/StateSpecBase.scala @@ -3,7 +3,7 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.state.scaladsl +package org.apache.pekko.persistence.jdbc.state.scaladsl import com.typesafe.config.{ Config, ConfigFactory } import scala.concurrent.duration._ @@ -14,13 +14,13 @@ import org.scalatest.{ BeforeAndAfterAll, BeforeAndAfterEach } import org.scalatest.concurrent.ScalaFutures import org.scalatest.time._ -import akka.actor._ -import akka.persistence.jdbc.db.SlickDatabase -import akka.persistence.jdbc.config._ -import akka.persistence.jdbc.testkit.internal.{ H2, Postgres, SchemaType } -import akka.persistence.jdbc.util.DropCreate -import akka.serialization.SerializationExtension -import akka.util.Timeout +import org.apache.pekko.actor._ +import org.apache.pekko.persistence.jdbc.db.SlickDatabase +import org.apache.pekko.persistence.jdbc.config._ +import org.apache.pekko.persistence.jdbc.testkit.internal.{ H2, Postgres, SchemaType } +import org.apache.pekko.persistence.jdbc.util.DropCreate +import org.apache.pekko.serialization.SerializationExtension +import org.apache.pekko.util.Timeout abstract class StateSpecBase(val config: Config, schemaType: SchemaType) extends AnyWordSpecLike @@ -41,12 +41,12 @@ abstract class StateSpecBase(val config: Config, schemaType: SchemaType) } val customSerializers = ConfigFactory.parseString(""" - akka.actor { + pekko.actor { serializers { - my-payload = "akka.persistence.jdbc.state.MyPayloadSerializer" + my-payload = "org.apache.pekko.persistence.jdbc.state.MyPayloadSerializer" } serialization-bindings { - "akka.persistence.jdbc.state.MyPayload" = my-payload + "org.apache.pekko.persistence.jdbc.state.MyPayload" = my-payload } } """) @@ -67,7 +67,7 @@ abstract class StateSpecBase(val config: Config, schemaType: SchemaType) .getConfig("jdbc-durable-state-store") .withFallback(system.settings.config.getConfig("jdbc-durable-state-store")) .withFallback(config.getConfig("jdbc-durable-state-store")) - .withFallback(customSerializers.getConfig("akka.actor")) + .withFallback(customSerializers.getConfig("pekko.actor")) lazy val db = if (cfg.hasPath("slick.profile")) { SlickDatabase.database(cfg, new SlickConfiguration(cfg.getConfig("slick")), "slick.db") @@ -75,8 +75,8 @@ abstract class StateSpecBase(val config: Config, schemaType: SchemaType) // needed for integration test where we use postgres-shared-db-application.conf SlickDatabase.database( config, - new SlickConfiguration(config.getConfig("akka-persistence-jdbc.shared-databases.slick")), - "akka-persistence-jdbc.shared-databases.slick.db") + new SlickConfiguration(config.getConfig("pekko-persistence-jdbc.shared-databases.slick")), + "pekko-persistence-jdbc.shared-databases.slick.db") } lazy val durableStateConfig = new DurableStateTableConfiguration(cfg) @@ -92,7 +92,7 @@ abstract class StateSpecBase(val config: Config, schemaType: SchemaType) try { f(system) } finally { - system.actorSelection("system/" + "akka-persistence-jdbc-durable-state-sequence-actor").resolveOne().onComplete { + system.actorSelection("system/" + "pekko-persistence-jdbc-durable-state-sequence-actor").resolveOne().onComplete { case Success(actorRef) => { system.stop(actorRef) Thread.sleep(1000) diff --git a/core/src/test/scala/akka/persistence/jdbc/state/scaladsl/TestProbeDurableStateStoreQuery.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/TestProbeDurableStateStoreQuery.scala similarity index 71% rename from core/src/test/scala/akka/persistence/jdbc/state/scaladsl/TestProbeDurableStateStoreQuery.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/TestProbeDurableStateStoreQuery.scala index ec163962..dd161e02 100644 --- a/core/src/test/scala/akka/persistence/jdbc/state/scaladsl/TestProbeDurableStateStoreQuery.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/TestProbeDurableStateStoreQuery.scala @@ -3,22 +3,22 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.state.scaladsl +package org.apache.pekko.persistence.jdbc.state.scaladsl import scala.concurrent.Future import scala.concurrent.duration._ -import akka.NotUsed -import akka.actor.ExtendedActorSystem -import akka.pattern.ask -import akka.persistence.jdbc.config.DurableStateTableConfiguration -import akka.persistence.query.DurableStateChange -import akka.persistence.query.Offset -import akka.persistence.state.scaladsl.GetObjectResult -import akka.stream.scaladsl.Source -import akka.testkit.TestProbe -import akka.util.Timeout +import org.apache.pekko.NotUsed +import org.apache.pekko.actor.ExtendedActorSystem +import org.apache.pekko.pattern.ask +import org.apache.pekko.persistence.jdbc.config.DurableStateTableConfiguration +import org.apache.pekko.persistence.query.DurableStateChange +import org.apache.pekko.persistence.query.Offset +import org.apache.pekko.persistence.state.scaladsl.GetObjectResult +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.testkit.TestProbe +import org.apache.pekko.util.Timeout import slick.jdbc.{ JdbcBackend, JdbcProfile } -import akka.serialization.Serialization +import org.apache.pekko.serialization.Serialization object TestProbeDurableStateStoreQuery { case class StateInfoSequence(offset: Long, limit: Long) diff --git a/core/src/test/scala/akka/persistence/jdbc/util/ClasspathResources.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/util/ClasspathResources.scala similarity index 93% rename from core/src/test/scala/akka/persistence/jdbc/util/ClasspathResources.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/util/ClasspathResources.scala index 111d4e9a..8efde3bc 100644 --- a/core/src/test/scala/akka/persistence/jdbc/util/ClasspathResources.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/util/ClasspathResources.scala @@ -3,7 +3,7 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.util +package org.apache.pekko.persistence.jdbc.util import java.io.InputStream diff --git a/core/src/test/scala/akka/persistence/jdbc/util/DropCreate.scala b/core/src/test/scala/org/apache/pekko/persistence/jdbc/util/DropCreate.scala similarity index 84% rename from core/src/test/scala/akka/persistence/jdbc/util/DropCreate.scala rename to core/src/test/scala/org/apache/pekko/persistence/jdbc/util/DropCreate.scala index c721799e..bd962c5a 100644 --- a/core/src/test/scala/akka/persistence/jdbc/util/DropCreate.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/jdbc/util/DropCreate.scala @@ -3,13 +3,13 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.util +package org.apache.pekko.persistence.jdbc.util import java.sql.Statement -import akka.annotation.InternalApi -import akka.persistence.jdbc.testkit.internal.SchemaType -import akka.persistence.jdbc.testkit.internal.SchemaUtilsImpl +import org.apache.pekko.annotation.InternalApi +import org.apache.pekko.persistence.jdbc.testkit.internal.SchemaType +import org.apache.pekko.persistence.jdbc.testkit.internal.SchemaUtilsImpl import com.typesafe.config.Config import org.slf4j.LoggerFactory import slick.jdbc.JdbcBackend.Database diff --git a/doc/deadlock.md b/doc/deadlock.md index 16b40a75..9af1a641 100644 --- a/doc/deadlock.md +++ b/doc/deadlock.md @@ -40,7 +40,7 @@ val db = Database.forURL("jdbc:h2:mem:test1;DB_CLOSE_DELAY=-1", driver="org.h2.D ``` ## Configuration -The object `akka.persistence.jdbc.util.SlickDatabase` reads the HikariJdbcDataSource configuration from typesafe +The object `org.apache.pekko.persistence.jdbc.util.SlickDatabase` reads the HikariJdbcDataSource configuration from typesafe configuration from the object `slick.db`. It expects a `connectionPool` field that has been set to `HikariCP` The class `slick.jdbc.hikaricp.HikariCPJdbcDataSource` reads the configured Hikari Connection Pool configuration. diff --git a/docs/src/main/paradox/configuration.md b/docs/src/main/paradox/configuration.md index d26828ef..8b6b5ffe 100644 --- a/docs/src/main/paradox/configuration.md +++ b/docs/src/main/paradox/configuration.md @@ -2,7 +2,7 @@ The plugin relies on @extref[Slick](slick:) to do create the SQL dialect for the database in use, therefore the following must be configured in `application.conf` -Configure `akka-persistence`: +Configure `pekko-persistence`: - instruct akka persistence to use the `jdbc-journal` plugin, - instruct akka persistence to use the `jdbc-snapshot-store` plugin, @@ -35,10 +35,10 @@ For testing purposes the journal and snapshot tables can be created programmatic Scala -: @@snip[snip](/core/src/test/scala/akka/persistence/jdbc/ScaladslSnippets.scala) { #create } +: @@snip[snip](/core/src/test/scala/org/apache/pekko/persistence/jdbc/ScaladslSnippets.scala) { #create } Java -: @@snip[snip](/core/src/test/java/akka/persistence/jdbc/JavadslSnippets.java) { #create } +: @@snip[snip](/core/src/test/java/org/apache/pekko/persistence/jdbc/JavadslSnippets.java) { #create } A `dropIfExists` variant is also available. @@ -47,7 +47,7 @@ A `dropIfExists` variant is also available. ## Reference Configuration -akka-persistence-jdbc provides the defaults as part of the @extref:[reference.conf](github:/core/src/main/resources/reference.conf). This file documents all the values which can be configured. +pekko-persistence-jdbc provides the defaults as part of the @extref:[reference.conf](github:/core/src/main/resources/reference.conf). This file documents all the values which can be configured. There are several possible ways to configure loading your database connections. Options will be explained below. @@ -94,7 +94,7 @@ SQL Server ### Customized loading of the db connection It is also possible to load a custom database connection. -In order to do so a custom implementation of @extref:[SlickDatabaseProvider](github:/core/src/main/scala/akka/persistence/jdbc/db/SlickExtension.scala) +In order to do so a custom implementation of @extref:[SlickDatabaseProvider](github:/core/src/main/scala/org/apache/pekko/persistence/jdbc/db/SlickExtension.scala) needs to be created. The methods that need to be implemented supply the Slick `Database` and `Profile` to the journals. To enable your custom `SlickDatabaseProvider`, the fully qualified class name of the `SlickDatabaseProvider` @@ -102,7 +102,7 @@ needs to be configured in the application.conf. In addition, you might want to c the database to be closed automatically: ```hocon -akka-persistence-jdbc { +pekko-persistence-jdbc { database-provider-fqcn = "com.mypackage.CustomSlickDatabaseProvider" } jdbc-journal { @@ -131,7 +131,7 @@ jdbc-journal { When using the `use-shared-db = slick` setting, the follow configuration can serve as an example: ```hocon -akka-persistence-jdbc { +pekko-persistence-jdbc { shared-databases { slick { profile = "slick.jdbc.PostgresProfile$" diff --git a/docs/src/main/paradox/custom-dao.md b/docs/src/main/paradox/custom-dao.md index 6b2e6d85..03054709 100644 --- a/docs/src/main/paradox/custom-dao.md +++ b/docs/src/main/paradox/custom-dao.md @@ -1,29 +1,29 @@ # Custom DAO Implementation The plugin supports loading a custom DAO for the journal and snapshot. You should implement a custom Data Access Object (DAO) if you wish to alter the default persistency strategy in -any way, but wish to reuse all the logic that the plugin already has in place, eg. the Akka Persistence Query API. For example, the default persistency strategy that the plugin +any way, but wish to reuse all the logic that the plugin already has in place, eg. the Apache Pekko Persistence Query API. For example, the default persistency strategy that the plugin supports serializes journal and snapshot messages using a serializer of your choice and stores them as byte arrays in the database. By means of configuration in `application.conf` a DAO can be configured, below the default DAOs are shown: ```hocon jdbc-journal { - dao = "akka.persistence.jdbc.journal.dao.DefaultJournalDao" + dao = "org.apache.pekko.persistence.jdbc.journal.dao.DefaultJournalDao" } jdbc-snapshot-store { - dao = "akka.persistence.jdbc.snapshot.dao.DefaultSnapshotDao" + dao = "org.apache.pekko.persistence.jdbc.snapshot.dao.DefaultSnapshotDao" } jdbc-read-journal { - dao = "akka.persistence.jdbc.query.dao.DefaultReadJournalDao" + dao = "org.apache.pekko.persistence.jdbc.query.dao.DefaultReadJournalDao" } ``` Storing messages as byte arrays in blobs is not the only way to store information in a database. For example, you could store messages with full type information as a normal database rows, each event type having its own table. For example, implementing a Journal Log table that stores all persistenceId, sequenceNumber and event type discriminator field, and storing the event data in another table with full typing -You only have to implement two interfaces `akka.persistence.jdbc.journal.dao.JournalDao` and/or `akka.persistence.jdbc.snapshot.dao.SnapshotDao`. +You only have to implement two interfaces `org.apache.pekko.persistence.jdbc.journal.dao.JournalDao` and/or `org.apache.pekko.persistence.jdbc.snapshot.dao.SnapshotDao`. For example, take a look at the following two custom DAOs: @@ -37,10 +37,10 @@ class MyCustomSnapshotDao(db: JdbcBackend#Database, val profile: JdbcProfile, sn } ``` -As you can see, the custom DAOs get a _Slick database_, a _Slick profile_, the journal or snapshot _configuration_, an _akka.serialization.Serialization_, an _ExecutionContext_ and _Materializer_ injected after constructed. +As you can see, the custom DAOs get a _Slick database_, a _Slick profile_, the journal or snapshot _configuration_, an _org.apache.pekko.serialization.Serialization_, an _ExecutionContext_ and _Materializer_ injected after constructed. You should register the Fully Qualified Class Name in `application.conf` so that the custom DAOs will be used. -For more information please review the two default implementations `akka.persistence.jdbc.dao.bytea.journal.ByteArrayJournalDao` and `akka.persistence.jdbc.dao.bytea.snapshot.ByteArraySnapshotDao` or the demo custom DAO example from the [demo-akka-persistence](https://github.com/dnvriend/demo-akka-persistence-jdbc) site. +For more information please review the two default implementations `org.apache.pekko.persistence.jdbc.dao.bytea.journal.ByteArrayJournalDao` and `org.apache.pekko.persistence.jdbc.dao.bytea.snapshot.ByteArraySnapshotDao` or the demo custom DAO example from the [demo-akka-persistence](https://github.com/dnvriend/demo-pekko-persistence-jdbc) site. @@@warning { title="Binary compatibility" } diff --git a/docs/src/main/paradox/durable-state-store.md b/docs/src/main/paradox/durable-state-store.md index b728b5b0..a1df6ed6 100644 --- a/docs/src/main/paradox/durable-state-store.md +++ b/docs/src/main/paradox/durable-state-store.md @@ -4,10 +4,10 @@ The `DurableStateStore` for JDBC plugin is obtained through the `DurableStateStoreRegistry` extension. Scala -: @@snip[snip](/core/src/test/scala/akka/persistence/jdbc/state/ScaladslSnippets.scala) { #jdbc-durable-state-store } +: @@snip[snip](/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/ScaladslSnippets.scala) { #jdbc-durable-state-store } Java -: @@snip[snip](/core/src/test/java/akka/persistence/jdbc/state/JavadslSnippets.java) { #jdbc-durable-state-store } +: @@snip[snip](/core/src/test/java/org/apache/pekko/persistence/jdbc/state/JavadslSnippets.java) { #jdbc-durable-state-store } ## APIs supported by DurableStateStore @@ -19,10 +19,10 @@ The plugin supports the following APIs: and is set to the value of the object if it exists with the passed in `persistenceId`. Otherwise `value` is empty. Scala -: @@snip[snip](/core/src/test/scala/akka/persistence/jdbc/state/ScaladslSnippets.scala) { #get-object } +: @@snip[snip](/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/ScaladslSnippets.scala) { #get-object } Java -: @@snip[snip](/core/src/test/java/akka/persistence/jdbc/state/JavadslSnippets.java) { #get-object } +: @@snip[snip](/core/src/test/java/org/apache/pekko/persistence/jdbc/state/JavadslSnippets.java) { #get-object } ### upsertObject @@ -32,20 +32,20 @@ incoming `revision` is 1 more than the already existing one. This snippet is an and `getObject`. Scala -: @@snip[snip](/core/src/test/scala/akka/persistence/jdbc/state/ScaladslSnippets.scala) { #upsert-get-object } +: @@snip[snip](/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/ScaladslSnippets.scala) { #upsert-get-object } Java -: @@snip[snip](/core/src/test/java/akka/persistence/jdbc/state/JavadslSnippets.java) { #upsert-get-object } +: @@snip[snip](/core/src/test/java/org/apache/pekko/persistence/jdbc/state/JavadslSnippets.java) { #upsert-get-object } ### deleteObject `deleteObject(persistenceId)` deletes the record with the input `persistenceId`. Scala -: @@snip[snip](/core/src/test/scala/akka/persistence/jdbc/state/ScaladslSnippets.scala) { #delete-object } +: @@snip[snip](/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/ScaladslSnippets.scala) { #delete-object } Java -: @@snip[snip](/core/src/test/java/akka/persistence/jdbc/state/JavadslSnippets.java) { #delete-object } +: @@snip[snip](/core/src/test/java/org/apache/pekko/persistence/jdbc/state/JavadslSnippets.java) { #delete-object } ### currentChanges @@ -53,10 +53,10 @@ Java the passed in `offset`. This api returns changes that occurred up to when the `Source` returned by this call is materialized. Scala -: @@snip[snip](/core/src/test/scala/akka/persistence/jdbc/state/ScaladslSnippets.scala) { #current-changes } +: @@snip[snip](/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/ScaladslSnippets.scala) { #current-changes } Java -: @@snip[snip](/core/src/test/java/akka/persistence/jdbc/state/JavadslSnippets.java) { #current-changes } +: @@snip[snip](/core/src/test/java/org/apache/pekko/persistence/jdbc/state/JavadslSnippets.java) { #current-changes } ### changes @@ -65,8 +65,8 @@ the passed in `offset`. The returned source will never terminate, it effectively and emits changes as they happen. Scala -: @@snip[snip](/core/src/test/scala/akka/persistence/jdbc/state/ScaladslSnippets.scala) { #changes } +: @@snip[snip](/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/ScaladslSnippets.scala) { #changes } Java -: @@snip[snip](/core/src/test/java/akka/persistence/jdbc/state/JavadslSnippets.java) { #changes } +: @@snip[snip](/core/src/test/java/org/apache/pekko/persistence/jdbc/state/JavadslSnippets.java) { #changes } diff --git a/docs/src/main/paradox/index.md b/docs/src/main/paradox/index.md index 636365fb..3c066f03 100644 --- a/docs/src/main/paradox/index.md +++ b/docs/src/main/paradox/index.md @@ -1,6 +1,6 @@ -# Akka Persistence JDBC +# Apache Pekko Persistence JDBC -The Akka Persistence JDBC plugin allows for using JDBC-compliant databases as backend for @extref:[Akka Persistence](akka:persistence.html) and @extref:[Akka Persistence Query](akka:persistence-query.html). +The Apache Pekko Persistence JDBC plugin allows for using JDBC-compliant databases as backend for @extref:[Apache Pekko Persistence](pekko:persistence.html) and @extref:[Apache Pekko Persistence Query](pekko:persistence-query.html). @@toc { depth=2 } diff --git a/docs/src/main/paradox/migration.md b/docs/src/main/paradox/migration.md index 4a76699b..4973c9b8 100644 --- a/docs/src/main/paradox/migration.md +++ b/docs/src/main/paradox/migration.md @@ -20,15 +20,15 @@ If you have existing data override the DAO to continue using the old schema: # Use the DAOs for the legacy (pre 5.0) database schema jdbc-journal { - dao = "akka.persistence.jdbc.journal.dao.legacy.ByteArrayJournalDao" + dao = "org.apache.pekko.persistence.jdbc.journal.dao.legacy.ByteArrayJournalDao" } jdbc-snapshot-store { - dao = "akka.persistence.jdbc.snapshot.dao.legacy.ByteArraySnapshotDao" + dao = "org.apache.pekko.persistence.jdbc.snapshot.dao.legacy.ByteArraySnapshotDao" } jdbc-read-journal { - dao = "akka.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao" + dao = "org.apache.pekko.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao" } ``` diff --git a/docs/src/main/paradox/overview.md b/docs/src/main/paradox/overview.md index 84918cf5..97976990 100644 --- a/docs/src/main/paradox/overview.md +++ b/docs/src/main/paradox/overview.md @@ -1,31 +1,31 @@ # Overview -The Akka Persistence JDBC plugin allows for using JDBC-compliant databases as backend for @extref:[Akka Persistence](akka:persistence.html) and @extref:[Akka Persistence Query](akka:persistence-query.html). +The Apache Pekko Persistence JDBC plugin allows for using JDBC-compliant databases as backend for @extref:[Apache Pekko Persistence](pekko:persistence.html) and @extref:[Apache Pekko Persistence Query](pekko:persistence-query.html). -akka-persistence-jdbc writes journal and snapshot entries to a configured JDBC store. It implements the full akka-persistence-query API and is therefore very useful for implementing DDD-style application models using Akka and Scala for creating reactive applications. +pekko-persistence-jdbc writes journal and snapshot entries to a configured JDBC store. It implements the full pekko-persistence-query API and is therefore very useful for implementing DDD-style application models using Akka and Scala for creating reactive applications. -Akka Persistence JDBC requires Akka $akka.version$ or later. It uses @extref:[Slick](slick:) $slick.version$ internally to access the database via JDBC, this does not require user code to make use of Slick. +Apache Pekko Persistence JDBC requires Akka $pekko.version$ or later. It uses @extref:[Slick](slick:) $slick.version$ internally to access the database via JDBC, this does not require user code to make use of Slick. ## Version history | Description | Version | Akka version | |-------------|---------|--------------| -| New database schema, see @ref:[Migration](migration.md) | [5.0.0](https://github.com/akka/akka-persistence-jdbc/releases) | Akka 2.6.+ | -| First release within the Akka organization | [4.0.0](https://github.com/akka/akka-persistence-jdbc/releases/tag/v4.0.0) | Akka 2.6.+ | -| Requires Akka 2.5.0 | [3.5.3+](https://github.com/akka/akka-persistence-jdbc/releases/tag/v3.5.3) | Akka 2.5.23+ or 2.6.x | +| New database schema, see @ref:[Migration](migration.md) | [5.0.0](https://github.com/apache/incubator-pekko-persistence-jdbc/releases) | Akka 2.6.+ | +| First release within the Akka organization | [4.0.0](https://github.com/apache/incubator-pekko-persistence-jdbc/releases/tag/v4.0.0) | Akka 2.6.+ | +| Requires Akka 2.5.0 | [3.5.3+](https://github.com/apache/incubator-pekko-persistence-jdbc/releases/tag/v3.5.3) | Akka 2.5.23+ or 2.6.x | -See the full release history at [GitHub releases](https://github.com/akka/akka-persistence-jdbc/releases). +See the full release history at [GitHub releases](https://github.com/apache/incubator-pekko-persistence-jdbc/releases). ## Module info @@dependency [sbt,Maven,Gradle] { - group=com.lightbend.akka - artifact=akka-persistence-jdbc_$scala.binary.version$ + group=org.apache.pekko + artifact=pekko-persistence-jdbc_$scala.binary.version$ version=$project.version$ symbol2=AkkaVersion - value2=$akka.version$ - group2=com.typesafe.akka - artifact2=akka-persistence-query_$scala.binary.version$ + value2=$pekko.version$ + group2=org.apache.pekko + artifact2=pekko-persistence-query_$scala.binary.version$ version2=AkkaVersion symbol3=SlickVersion value3=$slick.version$ @@ -45,7 +45,7 @@ Contributions via GitHub pull requests are gladly accepted from their original a ## Code of Conduct -Contributors all agree to follow the [Lightbend Community Code of Conduct](https://www.lightbend.com/conduct). +Contributors all agree to follow the [Apache Community Code of Conduct](https://www.apache.org/foundation/policies/conduct.html). ## License diff --git a/docs/src/main/paradox/query.md b/docs/src/main/paradox/query.md index e5f95398..057a13d8 100644 --- a/docs/src/main/paradox/query.md +++ b/docs/src/main/paradox/query.md @@ -2,13 +2,13 @@ ## How to get the ReadJournal -The `ReadJournal` is retrieved via the `akka.persistence.query.PersistenceQuery` extension: +The `ReadJournal` is retrieved via the `org.apache.pekko.persistence.query.PersistenceQuery` extension: Scala -: @@snip[snip](/core/src/test/scala/akka/persistence/jdbc/ScaladslSnippets.scala) { #read-journal } +: @@snip[snip](/core/src/test/scala/org/apache/pekko/persistence/jdbc/ScaladslSnippets.scala) { #read-journal } Java -: @@snip[snip](/core/src/test/java/akka/persistence/jdbc/JavadslSnippets.java) { #read-journal } +: @@snip[snip](/core/src/test/java/org/apache/pekko/persistence/jdbc/JavadslSnippets.java) { #read-journal } ## Persistence Query Plugin @@ -19,10 +19,10 @@ The plugin supports the following queries: `allPersistenceIds` and `currentPersistenceIds` are used for retrieving all persistenceIds of all persistent actors. Scala -: @@snip[snip](/core/src/test/scala/akka/persistence/jdbc/ScaladslSnippets.scala) { #persistence-ids } +: @@snip[snip](/core/src/test/scala/org/apache/pekko/persistence/jdbc/ScaladslSnippets.scala) { #persistence-ids } Java -: @@snip[snip](/core/src/test/java/akka/persistence/jdbc/JavadslSnippets.java) { #persistence-ids } +: @@snip[snip](/core/src/test/java/org/apache/pekko/persistence/jdbc/JavadslSnippets.java) { #persistence-ids } The returned event stream is unordered and you can expect different order for multiple executions of the query. @@ -40,10 +40,10 @@ The stream is completed with failure if there is a failure in executing the quer a specific PersistentActor identified by persistenceId. Scala -: @@snip[snip](/core/src/test/scala/akka/persistence/jdbc/ScaladslSnippets.scala) { #events-by-persistence-id } +: @@snip[snip](/core/src/test/scala/org/apache/pekko/persistence/jdbc/ScaladslSnippets.scala) { #events-by-persistence-id } Java -: @@snip[snip](/core/src/test/java/akka/persistence/jdbc/JavadslSnippets.java) { #events-by-persistence-id } +: @@snip[snip](/core/src/test/java/org/apache/pekko/persistence/jdbc/JavadslSnippets.java) { #events-by-persistence-id } You can retrieve a subset of all events by specifying `fromSequenceNr` and `toSequenceNr` or use `0L` and `Long.MaxValue` respectively to retrieve all events. Note that the corresponding sequence number of each event is provided in the `EventEnvelope`, which makes it possible to resume the stream at a later point from a given sequence number. @@ -57,7 +57,7 @@ The stream is completed with failure if there is a failure in executing the quer `tag`, e.g. all domain events of an Aggregate Root type. Scala -: @@snip[snip](/core/src/test/scala/akka/persistence/jdbc/ScaladslSnippets.scala) { #events-by-tag } +: @@snip[snip](/core/src/test/scala/org/apache/pekko/persistence/jdbc/ScaladslSnippets.scala) { #events-by-tag } Java -: @@snip[snip](/core/src/test/java/akka/persistence/jdbc/JavadslSnippets.java) { #events-by-tag } +: @@snip[snip](/core/src/test/java/org/apache/pekko/persistence/jdbc/JavadslSnippets.java) { #events-by-tag } diff --git a/docs/src/main/paradox/snapshots.md b/docs/src/main/paradox/snapshots.md index 0c1c042e..f6ca599e 100644 --- a/docs/src/main/paradox/snapshots.md +++ b/docs/src/main/paradox/snapshots.md @@ -1,13 +1,19 @@ --- -project.description: Snapshot builds of Akka Projection are provided via the Sonatype snapshot repository. +project.description: Snapshot builds of Apache Pekko Persistence JDBC are provided via the Apache snapshot repository. --- # Snapshots -[snapshots-badge]: https://img.shields.io/nexus/s/com.lightbend.akka/akka-persistence-jdbc_2.13?server=https%3A%2F%2Foss.sonatype.org -[snapshots]: https://oss.sonatype.org/content/repositories/snapshots/com/lightbend/akka/akka-persistence-jdbc_2.13/ +[snapshots]: https://https://repository.apache.org/content/groups/snapshots/org/apache/pekko/pekko-persistence-jdbc_2.13/ -Snapshots are published to the Sonatype Snapshot repository after every successful build on master. -Add the following to your project build definition to resolve Akka Persistence JDBC's snapshots: +Snapshots are published to the Apache Snapshot repository every night. + +@@@ warning + +The use of Pekko SNAPSHOTs, nightlies and milestone releases is discouraged unless you know what you are doing. + +@@@ + +Add the following to your project build definition to resolve Apache Pekko Persistence JDBC's snapshots: ## Configure repository @@ -18,8 +24,8 @@ Maven snapshots-repo - Sonatype snapshots - https://oss.sonatype.org/content/repositories/snapshots + Apache snapshots + https://repository.apache.org/content/groups/snapshots ... @@ -28,24 +34,24 @@ Maven sbt : ```scala - resolvers += Resolver.sonatypeRepo("snapshots") + resolvers += "Apache Nexus Snapshots".at("https://repository.apache.org/content/repositories/snapshots/") ``` Gradle : ```gradle repositories { maven { - url "https://oss.sonatype.org/content/repositories/snapshots" + url "https://repository.apache.org/content/groups/snapshots" } } ``` ## Documentation -The [snapshot documentation](https://doc.akka.io/docs/akka-persistence-jdbc/snapshot) is updated with every snapshot build. +The [snapshot documentation](https://pekko.apache.org/docs/pekko-persistence-jdbc/snapshot) is updated with every snapshot build. ## Versions -Latest published snapshot version is [![snapshots-badge][]][snapshots] +Latest published snapshot version is [snapshots] -The snapshot repository is cleaned from time to time with no further notice. Check [Sonatype snapshots Akka Projection files](https://oss.sonatype.org/content/repositories/snapshots/com/lightbend/akka/akka-persistence-jdbc_2.13/) to see what versions are currently available. +The snapshot repository is cleaned from time to time with no further notice. Check [Sonatype snapshots](https://repository.apache.org/content/groups/snapshots/org/apache/pekko/pekko-persistence-jdbc_2.13/) to see what versions are currently available. diff --git a/migrator/src/it/scala/akka/persistence/jdbc/migrator/integration/JournalMigratorTest.scala b/migrator/src/it/scala/org/apache/pekko/persistence/jdbc/migrator/integration/JournalMigratorTest.scala similarity index 69% rename from migrator/src/it/scala/akka/persistence/jdbc/migrator/integration/JournalMigratorTest.scala rename to migrator/src/it/scala/org/apache/pekko/persistence/jdbc/migrator/integration/JournalMigratorTest.scala index 1fdd34da..4454afd4 100644 --- a/migrator/src/it/scala/akka/persistence/jdbc/migrator/integration/JournalMigratorTest.scala +++ b/migrator/src/it/scala/org/apache/pekko/persistence/jdbc/migrator/integration/JournalMigratorTest.scala @@ -1,7 +1,7 @@ -package akka.persistence.jdbc.migrator.integration +package org.apache.pekko.persistence.jdbc.migrator.integration -import akka.persistence.jdbc.migrator.MigratorSpec._ -import akka.persistence.jdbc.migrator.JournalMigratorTest +import org.apache.pekko.persistence.jdbc.migrator.MigratorSpec._ +import org.apache.pekko.persistence.jdbc.migrator.JournalMigratorTest class PostgresJournalMigratorTest extends JournalMigratorTest("postgres-application.conf") with PostgresCleaner diff --git a/migrator/src/it/scala/akka/persistence/jdbc/migrator/integration/SnapshotMigratorTest.scala b/migrator/src/it/scala/org/apache/pekko/persistence/jdbc/migrator/integration/SnapshotMigratorTest.scala similarity index 69% rename from migrator/src/it/scala/akka/persistence/jdbc/migrator/integration/SnapshotMigratorTest.scala rename to migrator/src/it/scala/org/apache/pekko/persistence/jdbc/migrator/integration/SnapshotMigratorTest.scala index 434f093c..0cac25da 100644 --- a/migrator/src/it/scala/akka/persistence/jdbc/migrator/integration/SnapshotMigratorTest.scala +++ b/migrator/src/it/scala/org/apache/pekko/persistence/jdbc/migrator/integration/SnapshotMigratorTest.scala @@ -1,7 +1,7 @@ -package akka.persistence.jdbc.migrator.integration +package org.apache.pekko.persistence.jdbc.migrator.integration -import akka.persistence.jdbc.migrator.MigratorSpec._ -import akka.persistence.jdbc.migrator.SnapshotMigratorTest +import org.apache.pekko.persistence.jdbc.migrator.MigratorSpec._ +import org.apache.pekko.persistence.jdbc.migrator.SnapshotMigratorTest class PostgresSnapshotMigratorTest extends SnapshotMigratorTest("postgres-application.conf") with PostgresCleaner diff --git a/migrator/src/main/scala/akka/persistence/jdbc/migrator/JournalMigrator.scala b/migrator/src/main/scala/org/apache/pekko/persistence/jdbc/migrator/JournalMigrator.scala similarity index 73% rename from migrator/src/main/scala/akka/persistence/jdbc/migrator/JournalMigrator.scala rename to migrator/src/main/scala/org/apache/pekko/persistence/jdbc/migrator/JournalMigrator.scala index ed4fa8b9..a20e8476 100644 --- a/migrator/src/main/scala/akka/persistence/jdbc/migrator/JournalMigrator.scala +++ b/migrator/src/main/scala/org/apache/pekko/persistence/jdbc/migrator/JournalMigrator.scala @@ -3,21 +3,21 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.migrator - -import akka.Done -import akka.actor.ActorSystem -import akka.persistence.PersistentRepr -import akka.persistence.jdbc.AkkaSerialization -import akka.persistence.jdbc.config.{ JournalConfig, ReadJournalConfig } -import akka.persistence.jdbc.db.SlickExtension -import akka.persistence.jdbc.journal.dao.JournalQueries -import akka.persistence.jdbc.journal.dao.legacy.ByteArrayJournalSerializer -import akka.persistence.jdbc.journal.dao.JournalTables.{ JournalAkkaSerializationRow, TagRow } -import akka.persistence.jdbc.migrator.JournalMigrator.{ JournalConfig, ReadJournalConfig } -import akka.persistence.jdbc.query.dao.legacy.ReadJournalQueries -import akka.serialization.{ Serialization, SerializationExtension } -import akka.stream.scaladsl.Source +package org.apache.pekko.persistence.jdbc.migrator + +import org.apache.pekko.Done +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.persistence.PersistentRepr +import org.apache.pekko.persistence.jdbc.PekkoSerialization +import org.apache.pekko.persistence.jdbc.config.{ JournalConfig, ReadJournalConfig } +import org.apache.pekko.persistence.jdbc.db.SlickExtension +import org.apache.pekko.persistence.jdbc.journal.dao.JournalQueries +import org.apache.pekko.persistence.jdbc.journal.dao.legacy.ByteArrayJournalSerializer +import org.apache.pekko.persistence.jdbc.journal.dao.JournalTables.{ JournalPekkoSerializationRow, TagRow } +import org.apache.pekko.persistence.jdbc.migrator.JournalMigrator.{ JournalConfig, ReadJournalConfig } +import org.apache.pekko.persistence.jdbc.query.dao.legacy.ReadJournalQueries +import org.apache.pekko.serialization.{ Serialization, SerializationExtension } +import org.apache.pekko.stream.scaladsl.Source import org.slf4j.{ Logger, LoggerFactory } import slick.jdbc._ @@ -96,24 +96,24 @@ final case class JournalMigrator(profile: JdbcProfile)(implicit system: ActorSys .run() /** - * serialize the PersistentRepr and construct a JournalAkkaSerializationRow and set of matching tags + * serialize the PersistentRepr and construct a JournalPekkoSerializationRow and set of matching tags * * @param repr the PersistentRepr * @param tags the tags * @param ordering the ordering of the PersistentRepr - * @return the tuple of JournalAkkaSerializationRow and set of tags + * @return the tuple of JournalPekkoSerializationRow and set of tags */ private def serialize( repr: PersistentRepr, tags: Set[String], - ordering: Long): (JournalAkkaSerializationRow, Set[String]) = { + ordering: Long): (JournalPekkoSerializationRow, Set[String]) = { - val serializedPayload: AkkaSerialization.AkkaSerialized = - AkkaSerialization.serialize(serialization, repr.payload).get + val serializedPayload: PekkoSerialization.PekkoSerialized = + PekkoSerialization.serialize(serialization, repr.payload).get - val serializedMetadata: Option[AkkaSerialization.AkkaSerialized] = - repr.metadata.flatMap(m => AkkaSerialization.serialize(serialization, m).toOption) - val row: JournalAkkaSerializationRow = JournalAkkaSerializationRow( + val serializedMetadata: Option[PekkoSerialization.PekkoSerialized] = + repr.metadata.flatMap(m => PekkoSerialization.serialize(serialization, m).toOption) + val row: JournalPekkoSerializationRow = JournalPekkoSerializationRow( ordering, repr.deleted, repr.persistenceId, @@ -132,7 +132,7 @@ final case class JournalMigrator(profile: JdbcProfile)(implicit system: ActorSys } private def writeJournalRowsStatements( - journalSerializedRow: JournalAkkaSerializationRow, + journalSerializedRow: JournalPekkoSerializationRow, tags: Set[String]): DBIO[Unit] = { val journalInsert: DBIO[Long] = newJournalQueries.JournalTable .returning(newJournalQueries.JournalTable.map(_.ordering)) diff --git a/migrator/src/main/scala/akka/persistence/jdbc/migrator/SnapshotMigrator.scala b/migrator/src/main/scala/org/apache/pekko/persistence/jdbc/migrator/SnapshotMigrator.scala similarity index 76% rename from migrator/src/main/scala/akka/persistence/jdbc/migrator/SnapshotMigrator.scala rename to migrator/src/main/scala/org/apache/pekko/persistence/jdbc/migrator/SnapshotMigrator.scala index 99ad9768..dda2cb7d 100644 --- a/migrator/src/main/scala/akka/persistence/jdbc/migrator/SnapshotMigrator.scala +++ b/migrator/src/main/scala/org/apache/pekko/persistence/jdbc/migrator/SnapshotMigrator.scala @@ -3,21 +3,21 @@ * Copyright (C) 2019 - 2021 Lightbend Inc. */ -package akka.persistence.jdbc.migrator +package org.apache.pekko.persistence.jdbc.migrator -import akka.actor.ActorSystem -import akka.persistence.SnapshotMetadata -import akka.persistence.jdbc.config.{ ReadJournalConfig, SnapshotConfig } -import akka.persistence.jdbc.db.SlickExtension -import akka.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao -import akka.persistence.jdbc.snapshot.dao.DefaultSnapshotDao -import akka.persistence.jdbc.snapshot.dao.legacy.{ ByteArraySnapshotSerializer, SnapshotQueries } -import akka.persistence.jdbc.snapshot.dao.legacy.SnapshotTables.SnapshotRow -import akka.serialization.{ Serialization, SerializationExtension } -import akka.stream.scaladsl.{ Sink, Source } -import akka.Done -import akka.persistence.jdbc.migrator.JournalMigrator.ReadJournalConfig -import akka.persistence.jdbc.migrator.SnapshotMigrator.{ NoParallelism, SnapshotStoreConfig } +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.persistence.SnapshotMetadata +import org.apache.pekko.persistence.jdbc.config.{ ReadJournalConfig, SnapshotConfig } +import org.apache.pekko.persistence.jdbc.db.SlickExtension +import org.apache.pekko.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao +import org.apache.pekko.persistence.jdbc.snapshot.dao.DefaultSnapshotDao +import org.apache.pekko.persistence.jdbc.snapshot.dao.legacy.{ ByteArraySnapshotSerializer, SnapshotQueries } +import org.apache.pekko.persistence.jdbc.snapshot.dao.legacy.SnapshotTables.SnapshotRow +import org.apache.pekko.serialization.{ Serialization, SerializationExtension } +import org.apache.pekko.stream.scaladsl.{ Sink, Source } +import org.apache.pekko.Done +import org.apache.pekko.persistence.jdbc.migrator.JournalMigrator.ReadJournalConfig +import org.apache.pekko.persistence.jdbc.migrator.SnapshotMigrator.{ NoParallelism, SnapshotStoreConfig } import org.slf4j.{ Logger, LoggerFactory } import slick.jdbc import slick.jdbc.{ JdbcBackend, JdbcProfile } diff --git a/migrator/src/test/resources/general.conf b/migrator/src/test/resources/general.conf index 8680b4e7..36c7e2f4 100644 --- a/migrator/src/test/resources/general.conf +++ b/migrator/src/test/resources/general.conf @@ -1,17 +1,17 @@ # Copyright (C) 2019 - 2021 Lightbend Inc. # -// This file contains the general settings which are shared in all akka-persistence-jdbc tests +// This file contains the general settings which are shared in all pekko-persistence-jdbc tests -akka { +pekko { stdout-loglevel = off // defaults to WARNING can be disabled with off. The stdout-loglevel is only in effect during system startup and shutdown log-dead-letters-during-shutdown = on loglevel = debug log-dead-letters = on log-config-on-start = off // Log the complete configuration at INFO level when the actor system is started - loggers = ["akka.event.slf4j.Slf4jLogger"] - logging-filter = "akka.event.slf4j.Slf4jLoggingFilter" + loggers = ["org.apache.pekko.event.slf4j.Slf4jLogger"] + logging-filter = "org.apache.pekko.event.slf4j.Slf4jLoggingFilter" actor { // Required until https://github.com/akka/akka/pull/28333 is available @@ -33,11 +33,11 @@ docker { jdbc-journal { event-adapters { - event-adapter = "akka.persistence.jdbc.migrator.MigratorSpec$AccountEventAdapter" + event-adapter = "org.apache.pekko.persistence.jdbc.migrator.MigratorSpec$AccountEventAdapter" } event-adapter-bindings { - "akka.persistence.jdbc.migrator.MigratorSpec$AccountEvent" = event-adapter + "org.apache.pekko.persistence.jdbc.migrator.MigratorSpec$AccountEvent" = event-adapter } } diff --git a/migrator/src/test/resources/h2-application.conf b/migrator/src/test/resources/h2-application.conf index 2c7f048b..c4b750d6 100644 --- a/migrator/src/test/resources/h2-application.conf +++ b/migrator/src/test/resources/h2-application.conf @@ -1,9 +1,9 @@ # Copyright (C) 2019 - 2021 Lightbend Inc. -// general.conf is included only for shared settings used for the akka-persistence-jdbc tests +// general.conf is included only for shared settings used for the pekko-persistence-jdbc tests include "general.conf" -akka { +pekko { persistence { journal { plugin = "jdbc-journal" @@ -18,12 +18,12 @@ jdbc-journal { slick = ${slick} } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { slick = ${slick} } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { slick = ${slick} } diff --git a/migrator/src/test/resources/mysql-application.conf b/migrator/src/test/resources/mysql-application.conf index 6b9cf8b4..e2d95a0b 100644 --- a/migrator/src/test/resources/mysql-application.conf +++ b/migrator/src/test/resources/mysql-application.conf @@ -1,9 +1,9 @@ # Copyright (C) 2019 - 2021 Lightbend Inc. -// general.conf is included only for shared settings used for the akka-persistence-jdbc tests +// general.conf is included only for shared settings used for the pekko-persistence-jdbc tests include "general.conf" -akka { +pekko { persistence { journal { plugin = "jdbc-journal" @@ -22,12 +22,12 @@ jdbc-journal { slick = ${slick} } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { slick = ${slick} } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { slick = ${slick} } diff --git a/migrator/src/test/resources/oracle-application.conf b/migrator/src/test/resources/oracle-application.conf index c1e072b8..8f093080 100644 --- a/migrator/src/test/resources/oracle-application.conf +++ b/migrator/src/test/resources/oracle-application.conf @@ -1,10 +1,10 @@ # Copyright (C) 2019 - 2021 Lightbend Inc. -// general.conf is included only for shared settings used for the akka-persistence-jdbc tests +// general.conf is included only for shared settings used for the pekko-persistence-jdbc tests include "general.conf" include "oracle-schema-overrides.conf" -akka { +pekko { persistence { journal { plugin = "jdbc-journal" @@ -24,12 +24,12 @@ jdbc-journal { slick = ${slick} } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { slick = ${slick} } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { slick = ${slick} } diff --git a/migrator/src/test/resources/postgres-application.conf b/migrator/src/test/resources/postgres-application.conf index b93acaf2..138cadca 100644 --- a/migrator/src/test/resources/postgres-application.conf +++ b/migrator/src/test/resources/postgres-application.conf @@ -1,9 +1,9 @@ # Copyright (C) 2019 - 2021 Lightbend Inc. -// general.conf is included only for shared settings used for the akka-persistence-jdbc tests +// general.conf is included only for shared settings used for the pekko-persistence-jdbc tests include "general.conf" -akka { +pekko { persistence { journal { plugin = "jdbc-journal" @@ -22,12 +22,12 @@ jdbc-journal { slick = ${slick} } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { slick = ${slick} } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { slick = ${slick} } diff --git a/migrator/src/test/resources/sqlserver-application.conf b/migrator/src/test/resources/sqlserver-application.conf index 0298fd82..231ace36 100644 --- a/migrator/src/test/resources/sqlserver-application.conf +++ b/migrator/src/test/resources/sqlserver-application.conf @@ -2,7 +2,7 @@ include "general.conf" -akka { +pekko { persistence { journal { plugin = "jdbc-journal" @@ -27,7 +27,7 @@ jdbc-journal { slick = ${slick} } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { tables { snapshot { @@ -38,7 +38,7 @@ jdbc-snapshot-store { slick = ${slick} } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { tables { journal { diff --git a/migrator/src/test/scala/akka/persistence/jdbc/migrator/JournalMigratorTest.scala b/migrator/src/test/scala/org/apache/pekko/persistence/jdbc/migrator/JournalMigratorTest.scala similarity index 95% rename from migrator/src/test/scala/akka/persistence/jdbc/migrator/JournalMigratorTest.scala rename to migrator/src/test/scala/org/apache/pekko/persistence/jdbc/migrator/JournalMigratorTest.scala index b7430a41..fc9109b2 100644 --- a/migrator/src/test/scala/akka/persistence/jdbc/migrator/JournalMigratorTest.scala +++ b/migrator/src/test/scala/org/apache/pekko/persistence/jdbc/migrator/JournalMigratorTest.scala @@ -1,9 +1,9 @@ -package akka.persistence.jdbc.migrator +package org.apache.pekko.persistence.jdbc.migrator -import akka.Done -import akka.pattern.ask -import akka.persistence.jdbc.db.SlickDatabase -import akka.persistence.jdbc.migrator.MigratorSpec._ +import org.apache.pekko.Done +import org.apache.pekko.pattern.ask +import org.apache.pekko.persistence.jdbc.db.SlickDatabase +import org.apache.pekko.persistence.jdbc.migrator.MigratorSpec._ abstract class JournalMigratorTest(configName: String) extends MigratorSpec(configName) { diff --git a/migrator/src/test/scala/akka/persistence/jdbc/migrator/MigratorSpec.scala b/migrator/src/test/scala/org/apache/pekko/persistence/jdbc/migrator/MigratorSpec.scala similarity index 87% rename from migrator/src/test/scala/akka/persistence/jdbc/migrator/MigratorSpec.scala rename to migrator/src/test/scala/org/apache/pekko/persistence/jdbc/migrator/MigratorSpec.scala index 1f512aa8..a8d38ce1 100644 --- a/migrator/src/test/scala/akka/persistence/jdbc/migrator/MigratorSpec.scala +++ b/migrator/src/test/scala/org/apache/pekko/persistence/jdbc/migrator/MigratorSpec.scala @@ -1,21 +1,21 @@ -package akka.persistence.jdbc.migrator - -import akka.actor.{ ActorRef, ActorSystem, Props, Stash } -import akka.event.LoggingReceive -import akka.pattern.ask -import akka.persistence.jdbc.SimpleSpec -import akka.persistence.jdbc.config.{ JournalConfig, SlickConfiguration } -import akka.persistence.jdbc.db.SlickDatabase -import akka.persistence.jdbc.migrator.MigratorSpec._ -import akka.persistence.jdbc.query.scaladsl.JdbcReadJournal -import akka.persistence.jdbc.testkit.internal._ -import akka.persistence.journal.EventSeq.single -import akka.persistence.journal.{ EventAdapter, EventSeq, Tagged } -import akka.persistence.query.PersistenceQuery -import akka.persistence.{ PersistentActor, SaveSnapshotSuccess, SnapshotMetadata, SnapshotOffer } -import akka.stream.Materializer -import akka.stream.scaladsl.Sink -import akka.util.Timeout +package org.apache.pekko.persistence.jdbc.migrator + +import org.apache.pekko.actor.{ ActorRef, ActorSystem, Props, Stash } +import org.apache.pekko.event.LoggingReceive +import org.apache.pekko.pattern.ask +import org.apache.pekko.persistence.jdbc.SimpleSpec +import org.apache.pekko.persistence.jdbc.config.{ JournalConfig, SlickConfiguration } +import org.apache.pekko.persistence.jdbc.db.SlickDatabase +import org.apache.pekko.persistence.jdbc.migrator.MigratorSpec._ +import org.apache.pekko.persistence.jdbc.query.scaladsl.JdbcReadJournal +import org.apache.pekko.persistence.jdbc.testkit.internal._ +import org.apache.pekko.persistence.journal.EventSeq.single +import org.apache.pekko.persistence.journal.{ EventAdapter, EventSeq, Tagged } +import org.apache.pekko.persistence.query.PersistenceQuery +import org.apache.pekko.persistence.{ PersistentActor, SaveSnapshotSuccess, SnapshotMetadata, SnapshotOffer } +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.util.Timeout import com.typesafe.config.{ Config, ConfigFactory, ConfigValue, ConfigValueFactory } import org.scalatest.BeforeAndAfterEach import org.slf4j.{ Logger, LoggerFactory } @@ -116,11 +116,11 @@ abstract class MigratorSpec(val config: Config) extends SimpleSpec with BeforeAn val configOverrides: Map[String, ConfigValue] = Map( "jdbc-journal.dao" -> ConfigValueFactory.fromAnyRef( - "akka.persistence.jdbc.journal.dao.legacy.ByteArrayJournalDao"), + "org.apache.pekko.persistence.jdbc.journal.dao.legacy.ByteArrayJournalDao"), "jdbc-snapshot-store.dao" -> ConfigValueFactory.fromAnyRef( - "akka.persistence.jdbc.snapshot.dao.legacy.ByteArraySnapshotDao"), + "org.apache.pekko.persistence.jdbc.snapshot.dao.legacy.ByteArraySnapshotDao"), "jdbc-read-journal.dao" -> ConfigValueFactory.fromAnyRef( - "akka.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao")) + "org.apache.pekko.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao")) val legacyDAOConfig = configOverrides.foldLeft(ConfigFactory.load(config)) { case (conf, (path, configValue)) => conf.withValue(path, configValue) @@ -254,22 +254,22 @@ object MigratorSpec { persist(AccountCreated(balance)) { (event: AccountCreated) => updateState(event) saveSnapshot() - sender() ! akka.actor.Status.Success(event) + sender() ! org.apache.pekko.actor.Status.Success(event) } case Deposit(balance) => persist(Deposited(balance)) { (event: Deposited) => updateState(event) saveSnapshot() - sender() ! akka.actor.Status.Success(event) + sender() ! org.apache.pekko.actor.Status.Success(event) } case Withdraw(balance) => persist(Withdrawn(balance)) { (event: Withdrawn) => updateState(event) saveSnapshot() - sender() ! akka.actor.Status.Success(event) + sender() ! org.apache.pekko.actor.Status.Success(event) } case State => - sender() ! akka.actor.Status.Success(state) + sender() ! org.apache.pekko.actor.Status.Success(state) } def updateState(event: AccountEvent): Unit = event match { diff --git a/migrator/src/test/scala/akka/persistence/jdbc/migrator/SnapshotMigratorTest.scala b/migrator/src/test/scala/org/apache/pekko/persistence/jdbc/migrator/SnapshotMigratorTest.scala similarity index 88% rename from migrator/src/test/scala/akka/persistence/jdbc/migrator/SnapshotMigratorTest.scala rename to migrator/src/test/scala/org/apache/pekko/persistence/jdbc/migrator/SnapshotMigratorTest.scala index 8682cf9a..48adc0dd 100644 --- a/migrator/src/test/scala/akka/persistence/jdbc/migrator/SnapshotMigratorTest.scala +++ b/migrator/src/test/scala/org/apache/pekko/persistence/jdbc/migrator/SnapshotMigratorTest.scala @@ -1,9 +1,9 @@ -package akka.persistence.jdbc.migrator +package org.apache.pekko.persistence.jdbc.migrator -import akka.Done -import akka.pattern.ask -import akka.persistence.jdbc.db.SlickDatabase -import akka.persistence.jdbc.migrator.MigratorSpec._ +import org.apache.pekko.Done +import org.apache.pekko.pattern.ask +import org.apache.pekko.persistence.jdbc.db.SlickDatabase +import org.apache.pekko.persistence.jdbc.migrator.MigratorSpec._ abstract class SnapshotMigratorTest(configName: String) extends MigratorSpec(configName) { diff --git a/project/Dependencies.scala b/project/Dependencies.scala index d37521d1..d490a2ca 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -1,15 +1,12 @@ import sbt._ object Dependencies { - val Nightly = sys.env.get("TRAVIS_EVENT_TYPE").contains("cron") - - // Keep in sync with .travis.yml + // Keep in sync with .github CI build val Scala212 = "2.12.16" val Scala213 = "2.13.8" val ScalaVersions = Seq(Scala212, Scala213) - val AkkaVersion = "2.6.16" - val AkkaBinaryVersion = AkkaVersion.take(3) + val PekkoVersion = "0.0.0+26546-767209a8-SNAPSHOT" val SlickVersion = "3.3.3" val ScalaTestVersion = "3.2.10" @@ -21,14 +18,14 @@ object Dependencies { "com.microsoft.sqlserver" % "mssql-jdbc" % "7.4.1.jre8") val Libraries: Seq[ModuleID] = Seq( - "com.typesafe.akka" %% "akka-persistence-query" % AkkaVersion, + "org.apache.pekko" %% "pekko-persistence-query" % PekkoVersion, "com.typesafe.slick" %% "slick" % SlickVersion, "com.typesafe.slick" %% "slick-hikaricp" % SlickVersion, "ch.qos.logback" % "logback-classic" % "1.2.10" % Test, - "com.typesafe.akka" %% "akka-slf4j" % AkkaVersion % Test, - "com.typesafe.akka" %% "akka-persistence-tck" % AkkaVersion % Test, - "com.typesafe.akka" %% "akka-stream-testkit" % AkkaVersion % Test, - "com.typesafe.akka" %% "akka-testkit" % AkkaVersion % Test, + "org.apache.pekko" %% "pekko-slf4j" % PekkoVersion % Test, + "org.apache.pekko" %% "pekko-persistence-tck" % PekkoVersion % Test, + "org.apache.pekko" %% "pekko-stream-testkit" % PekkoVersion % Test, + "org.apache.pekko" %% "pekko-testkit" % PekkoVersion % Test, "org.scalatest" %% "scalatest" % ScalaTestVersion % Test) ++ JdbcDrivers.map(_ % Test) val Migration: Seq[ModuleID] = Seq( diff --git a/project/ProjectAutoPlugin.scala b/project/ProjectAutoPlugin.scala index c8035937..9caf84d6 100644 --- a/project/ProjectAutoPlugin.scala +++ b/project/ProjectAutoPlugin.scala @@ -13,20 +13,21 @@ object ProjectAutoPlugin extends AutoPlugin { override def globalSettings = Seq( - organization := "com.lightbend.akka", - organizationName := "Lightbend Inc.", - organizationHomepage := Some(url("https://www.lightbend.com/")), - homepage := Some(url("https://doc.akka.io/docs/akka-persistence-jdbc/current/")), + organization := "org.apache.pekko", + organizationName := "Apache Software Foundation", + organizationHomepage := Some(url("https://www.apache.org/")), + homepage := Some(url("https://pekko.apache.org/docs/pekko-persistence-jdbc/current/")), scmInfo := Some( - ScmInfo(url("https://github.com/akka/akka-persistence-jdbc"), "git@github.com:akka/akka-persistence-jdbc.git")), + ScmInfo(url("https://github.com/apache/incubator-pekko-persistence-jdbc"), + "git@github.com:apache/incubator-pekko-persistence-jdbc.git")), developers += Developer( "contributors", "Contributors", - "https://gitter.im/akka/dev", - url("https://github.com/akka/akka-persistence-jdbc/graphs/contributors")), + "dev@pekko.apache.org", + url("https://github.com/apache/incubator-pekko-persistence-jdbc/graphs/contributors")), licenses := Seq("Apache-2.0" -> url("https://opensource.org/licenses/Apache-2.0")), - description := "A plugin for storing events in an event journal akka-persistence-jdbc", - startYear := Some(2014)) + description := "A plugin for storing events in an event journal pekko-persistence-jdbc", + startYear := Some(2022)) override val trigger: PluginTrigger = allRequirements @@ -62,26 +63,26 @@ object ProjectAutoPlugin extends AutoPlugin { scalacOptions += "-Ydelambdafy:method", Compile / doc / scalacOptions := scalacOptions.value ++ Seq( "-doc-title", - "Akka Persistence JDBC", + "Apache Pekko Persistence JDBC", "-doc-version", version.value, "-sourcepath", (baseDirectory in ThisBuild).value.toString, "-skip-packages", - "akka.pattern", // for some reason Scaladoc creates this + "pekko.pattern", // for some reason Scaladoc creates this "-doc-source-url", { val branch = if (isSnapshot.value) "master" else s"v${version.value}" - s"https://github.com/akka/akka-persistence-jdbc/tree/${branch}€{FILE_PATH_EXT}#L€{FILE_LINE}" + s"https://github.com/apache/incubator-pekko-persistence-jdbc/tree/${branch}€{FILE_PATH_EXT}#L€{FILE_LINE}" }, "-doc-canonical-base-url", - "https://doc.akka.io/api/akka-persistence-jdbc/current/"), + "https://pekko.apache.org/api/pekko-persistence-jdbc/current/"), // show full stack traces and test case durations Test / testOptions += Tests.Argument("-oDF"), headerLicense := Some(HeaderLicense.Custom("""|Copyright (C) 2014 - 2019 Dennis Vriend |Copyright (C) 2019 - 2021 Lightbend Inc. |""".stripMargin)), resolvers += Resolver.jcenterRepo, - sonatypeProfileName := "com.lightbend") + sonatypeProfileName := "org.apache.pekko") val disciplineScalacOptions = Set( // "-Xfatal-warnings", diff --git a/project/plugins.sbt b/project/plugins.sbt index ab9b9804..1de56a92 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,3 +1,5 @@ +resolvers += "Apache Nexus Snapshots".at("https://repository.apache.org/content/repositories/snapshots/") + // compliance addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") @@ -8,7 +10,16 @@ addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.7.0") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10") addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1") // docs -addSbtPlugin("com.lightbend.akka" % "sbt-paradox-akka" % "0.44") addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.1") addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0") addSbtPlugin("com.lightbend.sbt" % "sbt-publish-rsync" % "0.2") + +// We have to deliberately use older versions of sbt-paradox because current Pekko sbt build +// only loads on JDK 1.8 so we need to bring in older versions of parboiled which support JDK 1.8 +addSbtPlugin(("org.apache.pekko" % "pekko-sbt-paradox" % "0.0.0+19-f498f7c0-SNAPSHOT").excludeAll( + "com.lightbend.paradox", "sbt-paradox", + "com.lightbend.paradox" % "sbt-paradox-apidoc", + "com.lightbend.paradox" % "sbt-paradox-project-info")) +addSbtPlugin(("com.lightbend.paradox" % "sbt-paradox" % "0.9.2").force()) +addSbtPlugin(("com.lightbend.paradox" % "sbt-paradox-apidoc" % "0.10.1").force()) +addSbtPlugin(("com.lightbend.paradox" % "sbt-paradox-project-info" % "2.0.0").force()) diff --git a/project/project-info.conf b/project/project-info.conf index 24ca2b56..157fe5ea 100644 --- a/project/project-info.conf +++ b/project/project-info.conf @@ -1,6 +1,6 @@ project-info { version: "current" - scaladoc: "https://doc.akka.io/api/akka-persistence-jdbc/"${project-info.version}"/akka/persistence/jdbc/" + scaladoc: "https://pekko.apache.org/api/pekko-persistence-jdbc/"${project-info.version}"/org/apache/pekko/persistence/jdbc/" shared-info { jdk-versions: ["Adopt OpenJDK 8", "Adopt OpenJDK 11"] snapshots: { @@ -9,48 +9,26 @@ project-info { new-tab: false } issues: { - url: "https://github.com/akka/akka-persistence-jdbc/issues" + url: "https://github.com/apache/incubator-pekko-persistence-jdbc/issues" text: "GitHub issues" } release-notes: { - url: "https://github.com/akka/akka-persistence-jdbc/releases" + url: "https://github.com/apache/incubator-pekko-persistence-jdbc/releases" text: "GitHub releases" } forums: [ { - text: "Lightbend Discuss" - url: "https://discuss.lightbend.com/c/akka/" + text: "Apache Pekko Dev mailing list" + url: "https://lists.apache.org/list.html?dev@pekko.apache.org" } { - text: "akka/akka Gitter channel" - url: "https://gitter.im/akka/akka" + text: "apache/incubator-pekko-persistence-jdbc discussion" + url: "https://github.com/apache/incubator-pekko-persistence-jdbc/discussions" } ] } core: ${project-info.shared-info} { - title: "Akka Persistence JDBC" - jpms-name: "akka.persistence.jdbc" - levels: [ - { - readiness: Supported - since: "2022-10-05" - since-version: "5.1.0" - }, - { - readiness: Supported - since: "2021-01-21" - since-version: "5.0.0" - }, - { - readiness: Supported - since: "2020-06-09" - since-version: "4.0.0" - }, - { - readiness: CommunityDriven - since: "2014-07-04" - since-version: "1.0.0" - } - ] + title: "Apache Pekko Persistence JDBC" + jpms-name: "pekko.persistence.jdbc" } } diff --git a/scripts/link-validator.conf b/scripts/link-validator.conf index e45a0302..b41af894 100644 --- a/scripts/link-validator.conf +++ b/scripts/link-validator.conf @@ -2,17 +2,17 @@ site-link-validator { root-dir = "./docs/target/site/" # relative to `root-dir` - start-file = "docs/akka-persistence-jdbc/snapshot/index.html" + start-file = "docs/pekko-persistence-jdbc/snapshot/index.html" # Resolves URLs with the given prefix as local files instead link-mappings = [ { - prefix = "https://doc.akka.io/docs/akka-persistence-jdbc/snapshot/" - replace = "/docs/akka-persistence-jdbc/snapshot/" + prefix = "https://pekko.apache.org/docs/pekko-persistence-jdbc/snapshot/" + replace = "/docs/pekko-persistence-jdbc/snapshot/" } { - prefix = "https://doc.akka.io/api/akka-persistence-jdbc/snapshot/" - replace = "/api/akka-persistence-jdbc/snapshot/" + prefix = "https://pekko.apache.org/api/pekko-persistence-jdbc/snapshot/" + replace = "/api/pekko-persistence-jdbc/snapshot/" } ] @@ -20,7 +20,7 @@ site-link-validator { ignore-prefixes = [ # GitHub will block with "429 Too Many Requests" - "https://github.com/akka/akka-persistence-jdbc/" + "https://github.com/apache/incubator-pekko-persistence-jdbc/" # MVN repository forbids access after a few requests "https://mvnrepository.com/artifact/" ]