Specialized ORMap with LWWRegister values.
LWWRegister
relies on synchronized clocks and should only be used when the choice of
value is not important for concurrent updates occurring within the clock skew.
Instead of using timestamps based on System.currentTimeMillis()
time it is possible to
use a timestamp value based on something else, for example an increasing version number
from a database record that is used for optimistic concurrency control.
The defaultClock
is using max value of System.currentTimeMillis()
and currentTimestamp + 1
.
This means that the timestamp is increased for changes on the same node that occurs within
the same millisecond. It also means that it is safe to use the LWWMap
without
synchronized clocks when there is only one active writer, e.g. a Cluster Singleton. Such a
single writer should then first read current value with ReadMajority
(or more) before
changing and writing the value with WriteMajority
(or more).
For first-write-wins semantics you can use the LWWRegister#reverseClock instead of the LWWRegister#defaultClock
This class is immutable, i.e. "modifying" methods return a new instance.
- Companion:
- object
- Source:
- LWWMap.scala
Type members
Value members
Concrete methods
Adds an entry to the map.
Adds an entry to the map.
You can provide your clock
implementation instead of using timestamps based
on System.currentTimeMillis()
time. The timestamp can for example be an
increasing version number from a database record that is used for optimistic
concurrency control.
- Source:
- LWWMap.scala
Removes an entry from the map. Note that if there is a conflicting update on another node the entry will not be removed after merge.
Removes an entry from the map. Note that if there is a conflicting update on another node the entry will not be removed after merge.
- Source:
- LWWMap.scala
Deprecated methods
- Deprecated
[Since version 2.5.20]
- Source:
- LWWMap.scala
Removes an entry from the map. Note that if there is a conflicting update on another node the entry will not be removed after merge.
Removes an entry from the map. Note that if there is a conflicting update on another node the entry will not be removed after merge.
- Deprecated
[Since version 2.5.20]
- Source:
- LWWMap.scala
- Deprecated
[Since version 2.5.20]
- Source:
- LWWMap.scala
- Deprecated
[Since version 2.5.20]
- Source:
- LWWMap.scala
Adds an entry to the map.
Adds an entry to the map.
You can provide your clock
implementation instead of using timestamps based
on System.currentTimeMillis()
time. The timestamp can for example be an
increasing version number from a database record that is used for optimistic
concurrency control.
- Deprecated
[Since version 2.5.20]
- Source:
- LWWMap.scala
- Deprecated
[Since version 2.5.20]
- Source:
- LWWMap.scala