Commit graph

95 commits

Author SHA1 Message Date
Matthew de Detrich
f84e8db3cb Rename akka package to org.apache.pekko 2022-11-30 16:45:15 +01:00
Auto Format
15b163da74 format source with scalafmt, #2 2022-11-05 15:01:03 +01:00
PJ Fanning
a8ee7c4239
remove mima checks (#13)
* remove mima checks

* Update binary-compatibility-checks.yml
2022-11-05 10:19:44 +01:00
Joseph Ausmann
66afe3fefb Delete effect in durable state, #30446 (#31529)
* Add reset effect to the state dsl.
* The effect calls deleteObject in the durable state store.
* The effect updates state to the empty state.
* Implement DeletedDurableState for persistence query.
* Update PersistenceTestKitDurableStateStore so that deleteObject sets the Record payload to None, ie delete the payload.
* update documentation for delete effect
* increment the revision by one when deleting state
* Overload deleteObject with revision and deprecate deleteObject.
* add bin-comp exclude

(cherry picked from commit 34a621a7cd)
2022-09-02 09:05:19 +02:00
Patrik Nordwall
1414566930 Revert "Delete effect in durable state, #30446 (#31529)"
This reverts commit 34a621a7cd.

Wrong author
2022-09-02 09:03:40 +02:00
Patrik Nordwall
34a621a7cd
Delete effect in durable state, #30446 (#31529)
* Add reset effect to the state dsl.
* The effect calls deleteObject in the durable state store.
* The effect updates state to the empty state.
* Implement DeletedDurableState for persistence query.
* Update PersistenceTestKitDurableStateStore so that deleteObject sets the Record payload to None, ie delete the payload.
* update documentation for delete effect
* increment the revision by one when deleting state
* Overload deleteObject with revision and deprecate deleteObject.
* add bin-comp exclude
2022-09-02 08:56:35 +02:00
Arnout Engelen
31d632e82e
Delay run-time dependency from persistence-query to remote (#31199)
Scala 3 refers to the types of lazy fields in the `clinit` since
https://docs.scala-lang.org/scala3/reference/changed-features/lazy-vals-init.html

6c9c733896 (r62879336)
2022-03-07 10:22:28 +01:00
Renato Cavalcanti
7abc41cf4e
update copyright year to 2022 (#31057) 2022-02-04 12:36:44 +01:00
Patrik Nordwall
6c9c733896
Optional akka-remote dependency from akka-persistence-query, #30980 (#30987)
* akka-protobuf-v3 is anyway a dependency from akka-stream
* akka-remote can remain provided by adding lazy on the WrappedPayloadSupport
* tested with a sample with only akka-persistence and akka-persistence-query
2021-12-14 12:47:45 +01:00
Patrik Nordwall
f946655ad5
Serializer for EventEnvelope and Offset (#30970) 2021-12-09 13:30:59 +01:00
Patrik Nordwall
da564dc7ce
Remove optional traits in EventsBySliceQuery (#30953)
* EventTimestampQuery and LoadEventQuery are optional, and it was an
  oversight to add them to EventsBySliceQuery
* javadsl is ok
2021-12-01 14:34:30 +01:00
Patrik Nordwall
03b1584477
NoSuchElementException in LoadEventQuery (#30895)
* better than IllegalArgumentException
2021-11-16 15:40:34 +01:00
Patrik Nordwall
20b684f04f
New Persistence Query interfaces for bySlices queries (#30882)
* and addition of TimestampOffset
* ApiMayChange
* small mention in docs

eventsBySlices is intended to be a better way to retrieve all events for an entity type
than eventsByTag.

The usage of `eventsByTag` for Projections has the major drawback that the number of tags
must be decided up-front and can't easily be changed afterwards. Starting with too many
tags means much overhead since many projection instances would be running on each node
in a small Akka Cluster. Each projection instance polling the database periodically.
Starting with too few tags means that it can't be scaled later to more Akka nodes.

Instead of tags we can store a slice number by hashing the persistence id.
Like `math.abs(persistenceId.hashCode % numberOfSlices)`.

Then the Projection query can be a range query of the slices. For example if using 128
slices and running 4 Projection instances the slice ranges would be 0-31, 32-63, 64-95,
96-128. That can easily be split to more Projection instances when needed and still
reuse the offsets for the previous range distributions.
2021-11-15 17:31:23 +01:00
Arnout Engelen
14bf4655f3
Allow 'currentPersistenceIds' for ReadJournal (#30878)
* allow 'currentPersistenceIds' for eventsourced journals

This allows `currentPersistenceIds(afterId, limit)`
to be mixed in with ReadJournal as well as with
DurableStateStore.

Instead of duplicating `CurrentDurableStatePersistenceIdsQuery` I
renamed it to `PagedPersistenceIdsQuery` and removed the restriction
that it must be a `DurableStateStore`. The downside is that it is less
obvious where it should/can be mixed in, that is now only communicated
through the java/scaladoc and the testkit example.

* Split Journal and DurableState traits
2021-11-15 11:54:47 +01:00
James Roper
33052e3abc
Added durable state current persistence ids query (#30811) 2021-10-25 17:42:21 +02:00
Patrik Nordwall
e0ce825a55
Remove ApiMayChange from Durable State (#30733) 2021-10-06 17:22:07 +02:00
Arnout Engelen
6c2ed1b17d
Build akka-persistence-query on scala3 (#30663)
* Build akka-persistence-query on scala3

* Build and test on scala3 on GHA

* scalafmt

* Also akka-persistence-shared

* Add mima exclusions

* Add type to implicit, not to probe
2021-09-10 14:53:57 +02:00
Patrik Nordwall
835c9b85f0
AST for DurableStateChange to support deletes (#30549)
* UpdatedDurableState and future DeletedDurableState
2021-08-19 08:46:37 +02:00
Debasish Ghosh
4fc0e66c4a sepaarte folder for durable-state docs as per PR review feedback 2021-08-05 15:11:16 +05:30
Debasish Ghosh
dbafc24fda Misc changes as suggested in the PR review 2021-08-02 17:00:11 +05:30
Patrik Nordwall
942982a900 sprinkle ApiMayChange over durable state 2021-07-08 15:55:12 +02:00
Raymond Roestenburg
c4903ebe1e Moved inmem temporarily to query because of DurableStateStoreQuery.
* move to akka-persistence-testkit
* Delegating to scaladsl InMemDurableStateStore.
* InMemDurableStateStore -> PersistenceTestKitDurableStateStore
* implement changes query
2021-07-08 14:19:09 +02:00
Debasish Ghosh
b1f5aa88e3
Changed seqNr to revision for all durable state APIs and implementations (#30344) 2021-06-28 18:58:35 +05:30
Debasish Ghosh
26f8eba4c7
Fixed typo - replaced scaladsl with javadsl (#30316) 2021-06-11 19:03:55 +05:30
Patrik Nordwall
2168cec497 First implementation of DurableStateBehavior, #30277
* implementation is based on a copy of the EventSourcedBehavior and then
  refactoring all things that are not needed or different such as:
  * remove replicated event sourcing
  * remove ReplayingEvents recovery phase
  * remove retention and snapshotting
  * remove SnapshotSelectionCriteria and snapshots
  * remove PersistAll
  * remove event handler, event types
  * rename EventSourced
  * single static tag
  * DurableStateAdapter
  * DurableStateSignal

* DurableStateStore plugin api with similar extension mechanism as query plugins
  * DurableStateStore, DurableStateUpdateStore
  * DurableStateStoreQuery

* note that the DurableStateStore can be pretty useful for other things also
2021-06-03 13:21:55 +02:00
Johan Andrén
d4fdf5639e
Deprecate LevelDB (#30213)
* Deprecate LevelDB

In preparation of moving into the testing infra (or deleting it completely) at some distant future point in time

* Remove leveldb tests where there also is an inmem one

* More details in deprecation text, recommend inmem + journal proxy for testing etc.
2021-06-02 13:37:52 +02:00
Andrei Arlou
258bac491b
Remove unused imports in tests (#30265) 2021-06-01 13:34:43 +02:00
Johan Andrén
c5655a9ce6
Upgrade to Scala 2.13.5 (#30072) 2021-03-30 20:57:23 +02:00
Arnout Engelen
31f654768f
Update copyright to 2021 2021-01-08 17:55:38 +01:00
Christopher Batey
e98f1311f3 Alternative approach for storing metadata (#29309) 2020-08-17 07:30:12 +01:00
Christopher Batey
08182bbdeb ActiveActive: Events with metadata and events by persistence id for (#29287) 2020-08-17 07:27:57 +01:00
Arnout Engelen
c41c0420ad
Update scala to 2.13.3 and silencer to 1.7.0 (#28991)
* Update scala to 2.13.3 and silencer to 1.7.0
* Also travis
* Fix various warnings
2020-08-10 12:54:38 +02:00
Christopher Batey
7dfcc0bfd0
Validate leveldb write plugin is enabled for leveldb read plugin (#29288)
* Validate leveldb write plugin is enabled for leveldb read plugin

And remove some weird overriding

* mima
2020-06-24 08:01:03 +01:00
kerr
0e4d41ad33
+build Add sort imports support. (#28780)
* Add scalafix plugin for jdk 9.
* Add command alias sortImports.
* Excludes some sources from SortImports.
* Update SortImports to 0.4.0
* Sort imports with `sortImports` command.
2020-04-27 14:32:18 +02:00
Bùi Việt Thành
4df76d6bce scalafix FinalObject 2020-04-20 17:59:49 +07:00
Nicolas Vollmar
3635e78755 Fixes EventEnvelope unapply 2020-01-28 10:30:04 +01:00
Johannes Rudolph
ec208cad08
Merge branch 'master' into scalatest310 2020-01-14 12:03:32 +01:00
Arnout Engelen
44ad322a56 Deprecate EventEnvelope ctor without timestamp (#28454) 2020-01-14 10:22:07 +00:00
Mike Limansky
d9ed927df0 Update to ScalaTest 3.1.0, fix #28289. 2020-01-11 15:15:10 +03:00
Nicolas Vollmar
795bf1c3bf Keeps live stream open for empty persistence ids #28428 (#28429) 2020-01-07 13:18:44 +01:00
Patrik Nordwall
efa856bc17 Timestamp in EventEnvelope, #28331 (#28383)
* added to EventEnvolope and therefore include case class stuff
  for binary compatibility
* also added in PersistentRepr, which for example is the serialized format in
  LeveldbJournal
2020-01-07 11:32:15 +01:00
Helena Edelson
6bf20f4117 Update all copyright headers to 2020 after new year's #27881 (#28434) 2020-01-02 13:24:59 +01:00
Didac
da0a906b08 Added correct ordering for TimeBasedUUID offset (#28387) 2019-12-17 16:39:45 -08:00
Johannes Rudolph
702b6a7f41 actor: allow seamless access to untyped extensions given typed ActorSystem (#28294)
* actor: allow seamless access to untyped extensions given typed ActorSystem

* add overrides with concrete type for Java API everywhere
2019-12-05 16:01:22 +01:00
James Roper
43ec699b77 Improved docs for some queries (#28033)
Made it clear whether offset/to/fromSequenceNr are inclusive or
exclusive.
 
Co-Authored-By: Helena Edelson <helena@users.noreply.github.com>
2019-11-06 10:30:20 -08:00
Patrik Nordwall
4e8a5d333b
More structured logger names, #27922 (#27934)
* some cluster logging improvements
* most logger names are actually good, when using ActorLogging since
  config can be setup on the package (prefix)
* override logSource when StageLogging is used
* replace system.log with more specific logger
2019-10-14 17:55:12 +02:00
Johannes Rudolph
650068aa45
Convert 2.5.x MiMa excludes to subdirectory style
Using this script:

```sh

set -ex

FILE=$1
DIR=`dirname $FILE`
TMP_FILE=$DIR/_existing.excludes
FINAL_FILE=$DIR/2.5.x.backwards.excludes/_existing.excludes

mv $FILE $TMP_FILE
mkdir $DIR/2.5.x.backwards.excludes
(echo "# This file contains all excludes added before changing to the subdirectory style" && cat $TMP_FILE) > $FINAL_FILE
rm $TMP_FILE
git add $FINAL_FILE
```
2019-10-01 13:59:56 +02:00
Arnout Engelen
e6859253e5 Update to MiMa 0.6.0 (#27558) 2019-09-11 11:28:12 +02:00
Johan Andrén
b68d67008a
Deprecate actor materializer (#27538) 2019-09-05 16:08:37 +02:00
Patrik Nordwall
3efc1c2877
Disable Java serialization by default, #22333 (#27285)
* akka.actor.allow-java-serialization = off
* Moved primitive (Long, Int, String, ByteString) serializers
  from akka-remote to akka-actor since they had no dependency
  and are useful also in local systems, e.g. persistence.
  * e.g. needed for persistence-tck
  * less allow-java-serialization=on in tests
* CborSerializable in Jackson/test module for ease of use
* JavaSerializable for Java serialization in tests, already in akka-testkit,
  but misconfigured
* Made tests pass
  * allow-java-serialization=on in akka-persistence
  * allow-java-serialization=on in classic remoting tests
  * JavaSerializable and CborSerializable in other remoting tests
* Added serialization for
  * Boolean
  * java.util.concurrent.TimeoutException, AskTimeoutException
* support for testing serialization with the inmem journal
* utility to verifySerialization, in SerializationTestKit
* remove AccountExampleWithCommandHandlersInState becuase not possible to serialize State when it's not static
  * Effect() is factory in EventSourcedBehavior  class
* test the account examples
* SharedLeveldbJournal.configToEnableJavaSerializationForTest
* support for exceptions from remote deployed child actors
  * fallback to akka.remote.serialization.ThrowableNotSerializableException
    if exception is not serializable when wrapped in system messages from
    remote deployed child actors and Status.Failure messages
  * it's implemented in `WrappedPayloadSupport.payloadBuilder`
* update reference documentation
* serialize-messages=off in most places, separate ticket for
  improving or removing that feature
* migration guide, including description of rolling update

* fix 2.13 compiler error

* minor review feedback
2019-07-11 14:04:24 +02:00