Hi Konrad,
So I want to create a distributed state machine based on RAFT which I know
you're pretty familiar with. I want to use this facility when reconciling
logs. My understanding is that when an AppendEntries fails the Leader tries
to send the Follower a previous entry from the log till we reach the point
where the previous term and sequence match in the two logs. I want to use
the read facility in that scenario.
I'm not sure reading until a certain sequence number will be performant.
I know you must have done more thinking on this since you have worked both
on akka-persistence and akka-raft :) so I would appreciate your input.
Thanks,
-Moiz
On Monday, 7 July 2014 10:18:31 UTC-7, Konrad Malawski wrote:
>
> Hello Moiz,
> an event detached from it’s lineage does not make much sense for building
> up state - which is how persistent actors are designed to be used.
> An persistent actor’s state, and your “domain state”, should be built up
> from such series of events (and snapshots).
>
> We do support playback “until” a given sequence number, you can achieve
> this via:
>
> class Peter extends PersistentActor {
> override def preStart() {
> self ! Recover(toSequenceNr = 20)
> }
>
> def receiveCommand = { }
> def receiveRecover = {
> case m if lastSequenceNr == 15 => // ...
>
> case _ => // ...
> }
>
> If you only want one of these items, you can just ignore the others like
> shown in the example above.
> But reading out one specific event is not something we will want to
> support (we are actively removing methods that target “one message” in
> favour of ranged operations (see deprecated deleteMessage vs.
> deleteMessages(toSequenceNr)).
>
>
> May I ask why you need to read exactly one event?
> It would help to understand your use case, and then advice. :-)
>
>
>
> On Mon, Jul 7, 2014 at 7:00 PM, Moiz Raja <[email protected] <javascript:>
> > wrote:
>
>> I am using akka-persistence and I have a need to read a specific journal
>> entry but I do not see a way in akka-persistence to do that.
>>
>> Is there any reason why an API has not been provided for this? Are there
>> any plans to provide this in an upcoming release?
>>
>> Thanks,
>> -Moiz
>>
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ:
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Cheers,
> Konrad 'ktoso' Malawski
> hAkker @ Typesafe
>
> <http://typesafe.com>
>
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.