p

kalix.scalasdk

replicatedentity

package replicatedentity

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. trait CommandContext extends ReplicatedEntityContext with MetadataContext
  2. trait InternalReplicatedData extends javasdk.impl.replicatedentity.InternalReplicatedData
  3. class ReplicatedCounter extends InternalReplicatedData

    A counter that can be incremented and decremented.

  4. class ReplicatedCounterEntity extends ReplicatedEntity[ReplicatedCounter]
  5. class ReplicatedCounterMap[K] extends InternalReplicatedData

    A Map of counters.

    A Map of counters. Uses kalix.scalasdk.replicatedentity.ReplicatedCounter 's as values.

    K

    The type for keys.

  6. class ReplicatedCounterMapEntity[K] extends ReplicatedEntity[ReplicatedCounterMap[K]]
  7. trait ReplicatedDataFactory extends AnyRef
  8. abstract class ReplicatedEntity[D <: ReplicatedData] extends AnyRef
  9. trait ReplicatedEntityContext extends EntityContext

    Root context for all Replicated Entity contexts.

  10. trait ReplicatedEntityOptions extends EntityOptions
  11. trait ReplicatedEntityProvider[D <: ReplicatedData, E <: ReplicatedEntity[D]] extends AnyRef
  12. class ReplicatedMap[K, V <: ReplicatedData] extends InternalReplicatedData

    A Replicated Map that allows both the addition and removal of kalix.replicatedentity.ReplicatedData objects.

    A Replicated Map that allows both the addition and removal of kalix.replicatedentity.ReplicatedData objects.

    Use the more specialized maps if possible, such as kalix.scalasdk.replicatedentity.ReplicatedCounterMap, kalix.scalasdk.replicatedentity.ReplicatedRegisterMap, and kalix.scalasdk.replicatedentity.ReplicatedMultiMap.

    A removal can only be done if all of the additions that caused the key to be in the map have been seen by this node. This means that, for example, if node 1 adds key A, and node 2 also adds key A, then node 1's addition is replicated to node 3, and node 3 deletes it before node 2's addition is replicated, then the item will still be in the map because node 2's addition had not yet been observed by node 3. However, if both additions had been replicated to node 3, then the key will be removed.

    The values of the map are themselves kalix.replicatedentity.ReplicatedData types, and hence allow concurrent updates that will eventually converge. New kalix.replicatedentity.ReplicatedData objects may only be created when using the kalix.scalasdk.replicatedentity.ReplicatedMap.getOrElse* method, using the provided kalix.scalasdk.replicatedentity.ReplicatedDataFactory for the create function.

    While removing entries from the map is supported, if the entries are added back again, it is possible that the value of the deleted entry may be merged into the value of the current entry, depending on whether the removal has been replicated to all nodes before the addition is performed.

    The map may contain different data types as values, however, for a given key, the type must never change. If two different types for the same key are inserted on different nodes, the replicated entity will enter an invalid state that can never be merged, and behavior of the replicated entity is undefined.

    Care needs to be taken to ensure that the serialized value of keys in the set is stable. For example, if using protobufs, the serialized value of any maps contained in the protobuf is not stable, and can yield a different set of bytes for the same logically equal element. Hence maps should be avoided. Additionally, some changes in protobuf schemas which are backwards compatible from a protobuf perspective, such as changing from sint32 to int32, do result in different serialized bytes, and so must be avoided.

    K

    The type of keys.

    V

    The replicated data type to be used for values.

  13. class ReplicatedMapEntity[K, V <: ReplicatedData] extends ReplicatedEntity[ReplicatedMap[K, V]]
  14. class ReplicatedMultiMap[K, V] extends InternalReplicatedData

    A replicated map that maps keys to values, where each key may be associated with multiple values.

    A replicated map that maps keys to values, where each key may be associated with multiple values. Effectively a ReplicatedMap with ReplicatedSet s as values.

    K

    The type for keys.

    V

    The type for values.

  15. class ReplicatedMultiMapEntity[K, V] extends ReplicatedEntity[ReplicatedMultiMap[K, V]]
  16. class ReplicatedRegister[T] extends InternalReplicatedData

    A Last-Write-Wins Register.

    A Last-Write-Wins Register.

    This uses a clock value to determine which of two concurrent writes should win. When both clock values are the same, an ordering defined over the node addresses is used to break the tie.

    By default, the clock used is the clock of the node that set the value. This can be affected by clock skew, which means two successive writes delegated to two separate nodes could result in the first one winning. This can be avoided by using a custom clock with a domain specific clock value, if such a causally ordered value is available.

  17. abstract class ReplicatedRegisterEntity[T] extends ReplicatedEntity[ReplicatedRegister[T]]
  18. class ReplicatedRegisterMap[K, V] extends InternalReplicatedData

    A Map of registers.

    A Map of registers. Uses ReplicatedRegister 's as values.

    K

    The type for keys.

    V

    The type for values.

  19. class ReplicatedRegisterMapEntity[K, V] extends ReplicatedEntity[ReplicatedRegisterMap[K, V]]
  20. class ReplicatedSet[E] extends InternalReplicatedData

    A Replicated Set that allows both the addition and removal of elements in a set.

    A Replicated Set that allows both the addition and removal of elements in a set.

    A removal can only be done if all of the additions that added the key have been seen by this node. This means that, for example if node 1 adds element A, and node 2 also adds element A, then node 1's addition is replicated to node 3, and node 3 deletes it before node 2's addition is replicated, then the element will still be in the map because node 2's addition had not yet been observed by node 3, and will cause the element to be re-added when node 3 receives it. However, if both * additions had been replicated to node 3, then the element will be removed.

    Care needs to be taken to ensure that the serialized value of elements in the set is stable. For example, if using protobufs, the serialized value of any maps contained in the protobuf is not stable, and can yield a different set of bytes for the same logically equal element. Hence maps should be avoided. Additionally, some changes in protobuf schemas which are backwards compatible from a protobuf perspective, such as changing from sint32 to int32, do result in different serialized bytes, and so must be avoided.

    E

    The type of elements.

  21. class ReplicatedSetEntity[E] extends ReplicatedEntity[ReplicatedSet[E]]
  22. class ReplicatedVote extends InternalReplicatedData

    A Vote replicated data type.

    A Vote replicated data type.

    This replicated data type is used to allow all the nodes in a cluster to vote on a condition.

  23. class ReplicatedVoteEntity extends ReplicatedEntity[ReplicatedVote]
  24. sealed trait WriteConsistency extends AnyRef

    Write consistency setting for replication of state updates for Replicated Entities.

Ungrouped