insert

abstract fun insert(    seqno: SequenceNumber,     site: SiteIdentifier,     event: ByteArray,     from: Int = 0,     until: Int = event.size)

Inserts the provided event in the MutableEventLog at the appropriate index. If the event is already present, or an event with the same SiteIdentifier has already been inserted, the insertion will simply be ignored.

This also means that if you have multiple events with the same SiteIdentifier at your disposal, you should make sure to insert them in the increasing SequenceNumber order.

Parameters

seqno

the SequenceNumber for the inserted event.

site

the SiteIdentifier for the inserted event.

event

the body of the event.

from

where the event body should be read.

until

where the event body should be read.


open fun insert(event: Event)

Inserts the provided Event in the MutableEventLog at the appropriate index. If the event is already present, or an event with the same EventIdentifier has already been inserted, the insertion will simply be ignored.

This also means that if you have multiple events with the same SiteIdentifier at your disposal, you should make sure to insert them in the increasing SequenceNumber order.

Parameters

event

the Event that is inserted.