!clu #3599 Use counter in VectorClock

* No reason to use the System.currentTimeMillis base
* Remove the global VectorClock counter completely,
  current count for a node is in the VectorClock itself
This commit is contained in:
Patrik Nordwall 2013-09-10 17:54:48 +02:00
parent c51df6658d
commit bd4d1d775f
4 changed files with 21 additions and 45 deletions

View file

@ -185,7 +185,7 @@ class ClusterMessageSerializer(val system: ExtendedActorSystem) extends Serializ
private def vectorClockToProto(version: VectorClock, hashMapping: Map[String, Int]): msg.VectorClock = {
val versions: Vector[msg.VectorClock.Version] = version.versions.map({
case (n, t) msg.VectorClock.Version(mapWithErrorMessage(hashMapping, n, "hash"), t.time)
case (n, t) msg.VectorClock.Version(mapWithErrorMessage(hashMapping, n, "hash"), t)
})(breakOut)
msg.VectorClock(None, versions)
}
@ -242,7 +242,7 @@ class ClusterMessageSerializer(val system: ExtendedActorSystem) extends Serializ
private def vectorClockFromProto(version: msg.VectorClock, hashMapping: immutable.Seq[String]) = {
VectorClock(version.versions.map({
case msg.VectorClock.Version(h, t) (VectorClock.Node.fromHash(hashMapping(h)), VectorClock.Timestamp(t))
case msg.VectorClock.Version(h, t) (VectorClock.Node.fromHash(hashMapping(h)), t)
})(breakOut))
}