Package

io.atlassian.event

source

Permalink

package source

Visibility
  1. Public
  2. All

Type Members

  1. trait EventSource[K, V, S] extends AnyRef

    Permalink

    The main trait that implementations of an event source need to extend.

    The main trait that implementations of an event source need to extend.

    K

    The key against which values are stored.

    V

    Values to be store

    S

    Type of the sequence. Needs to have a Sequence type class implementation.

  2. trait LongSequencedEventSource[K, V] extends EventSource[K, V, Long]

    Permalink

    Trait that implementations of an event source need to extend where the sequence number is just a long.

    Trait that implementations of an event source need to extend where the sequence number is just a long.

    K

    The key against which values are stored.

    V

    Values to be store

  3. case class Operation[A](run: (Option[A]) ⇒ Result[A]) extends Product with Serializable

    Permalink

    Data-type that represents an operation that can be saved to an EventSource.API.

    Data-type that represents an operation that can be saved to an EventSource.API.

    This type represents conditionally applied transformations of the data, so it is possible to have check-then-act semantics for all updates, including insert only if absent, and replace if value matches.

    There is syntax for creating Operations, eg. "foo".insertOp and deleteOp that is accessible via import Operation.syntax._

  4. sealed trait Transform[+A] extends AnyRef

    Permalink

    Transform essentially wraps a function from Option[A] => Option[A], but adds a little structure so that it can be stored easily in a commit object.

Value Members

  1. object EventSource

    Permalink

    An event source is an append-only store of data.

    An event source is an append-only store of data. Data is represented as a series of events that when replayed in order provides a view of the data at that point in time.

    In this implementation, an event is represented by a Transform that is contained within an event (strictly speaking a Event could contain a series of Transforms, but we're not doing that here to keep things simple).

    To implement an event source, one needs to:

    • Extend the EventSource trait. An event source provides data of type V for a given key of type K
    • Provide an API implementation that creates a suitable Transform for a new value to be saved when given an existing view of the data.
    • Provide Events implementation that wraps persistence of events (e.g. DynamoDB, in-memory map, Cassandra). Persistence stores only need to support the following key-value operations:
      • Records are keyed against a hash key (typically a unique identifier of business value) and a numeric range key
      • querying for a given hash key
      • conditional saves against a given hash and range key to prevent overwriting of a given record.

    TODO - make EventSource sit on top of EventStream

  2. object Operation extends Serializable

    Permalink
  3. object Transform

    Permalink

Ungrouped