trait ORMap[K, V <: Crdt] extends Crdt with Map[K, V]

An Observed-Removed Map.

An Observed-Removed Map allows both the addition and removal of objects in a map. 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 CRDTs, and hence allow concurrent updates that will eventually converge. Values may only be inserted using the Function) function, using the CrdtFactory passed in to the creation callback. Invoking Crdt) or any other insertion method will throw a UnsupportedOperationException.

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 CRDT 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 CRDT will enter an invalid state that can never be merged, and behavior of the CRDT 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.

Linear Supertypes
Map[K, V], Crdt, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ORMap
  2. Map
  3. Crdt
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def clear(): Unit
    Definition Classes
    Map
  2. abstract def containsKey(arg0: Any): Boolean
    Definition Classes
    Map
  3. abstract def containsValue(arg0: Any): Boolean
    Definition Classes
    Map
  4. abstract def entrySet(): Set[Entry[K, V]]
    Definition Classes
    Map
  5. abstract def get(arg0: Any): V
    Definition Classes
    Map
  6. abstract def getOrCreate(key: K, create: Function[CrdtFactory, V]): V

    Get or create an entry in the map with the given key.

    Get or create an entry in the map with the given key.

    key

    The key of the entry.

    create

    A callback used to create the value using the given CrdtFactory if an entry for the key is not currently in the map.

    returns

    The existing or newly created value for the given key.

  7. abstract def isEmpty(): Boolean
    Definition Classes
    Map
  8. abstract def keySet(): Set[K]
    Definition Classes
    Map
  9. abstract def putAll(arg0: Map[_ <: K, _ <: V]): Unit
    Definition Classes
    Map
  10. abstract def remove(arg0: Any): V
    Definition Classes
    Map
  11. abstract def size(): Int
    Definition Classes
    Map
  12. abstract def values(): Collection[V]
    Definition Classes
    Map

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. def compute(arg0: K, arg1: BiFunction[_ >: K, _ >: V, _ <: V]): V
    Definition Classes
    Map
  7. def computeIfAbsent(arg0: K, arg1: Function[_ >: K, _ <: V]): V
    Definition Classes
    Map
  8. def computeIfPresent(arg0: K, arg1: BiFunction[_ >: K, _ >: V, _ <: V]): V
    Definition Classes
    Map
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def forEach(arg0: BiConsumer[_ >: K, _ >: V]): Unit
    Definition Classes
    Map
  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. def getOrDefault(arg0: Any, arg1: V): V
    Definition Classes
    Map
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. def merge(arg0: K, arg1: V, arg2: BiFunction[_ >: V, _ >: V, _ <: V]): V
    Definition Classes
    Map
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. def put(key: K, value: V): V

    Not supported on ORMap.

    Not supported on ORMap. Use Function) instead.

    Definition Classes
    ORMap → Map
  22. def putIfAbsent(arg0: K, arg1: V): V
    Definition Classes
    Map
  23. def remove(arg0: Any, arg1: Any): Boolean
    Definition Classes
    Map
  24. def replace(arg0: K, arg1: V): V
    Definition Classes
    Map
  25. def replace(arg0: K, arg1: V, arg2: V): Boolean
    Definition Classes
    Map
  26. def replaceAll(arg0: BiFunction[_ >: K, _ >: V, _ <: V]): Unit
    Definition Classes
    Map
  27. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  28. def toString(): String
    Definition Classes
    AnyRef → Any
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from Map[K, V]

Inherited from Crdt

Inherited from AnyRef

Inherited from Any

Ungrouped