Trait cnr::LogMapper [−][src]
Expand description
Every data structure must implement LogMapper trait for ReadOperation and WriteOperation.
Data structure implement hash
that is used to map each operation to a log.
All the conflicting operations must map to a single log and the commutative
operations can map to same or different logs based on the operation argument.
Replica internally performs a modulo operation on hash
return value with the total number of logs. The data structure can implement
trait to return a value between 0 and (#logs-1) to avoid the modulo operation.
When the replica calls hash
, the implementor can assume that the capacity
of logs
>= nlogs
and that logs
is empty.