DVV
public struct DVV : Equatable
extension DVV: CustomStringConvertible
A dotted version vector. The dot represents a server-side counter that is incremented at every write/store/put action.
-
The collection of counters that define the version history for key
Declaration
Swift
internal let vv: DotVector -
The server/replica counter
Declaration
Swift
internal let dot: Dot? -
Declaration
Swift
public var description: String { get } -
Obtain a new DVV with the given key incremented by 1
Declaration
Swift
public func increment(key: String) -> DVVParameters
keythe key to increment
Return Value
new DVV instance
-
Determine if this DVV descends from another. Note that this is true when
rhsis nil.Declaration
Swift
public func descends(_ rhs: DVV?) -> BoolParameters
rhsthe DVV to check against
Return Value
true if this instance descends from or is equal to
rhs -
Determine if this DVV strictly descends from another, where strictly means the two instances cannot be equal. Note that this is true when
rhsis nil.Declaration
Swift
public func descendsStrictly(_ rhs: DVV?) -> BoolParameters
rhsthe DVV to check against.
Return Value
true if this instance descends from
rhs
-
Obtain a DotVector containing the merge of the version vector and the dot
Declaration
Swift
internal func mergeDot() -> DotVectorReturn Value
new DotVector
-
Obtain the counter for a given key. Looks first in the
dotand then in the version vector.Declaration
Swift
internal func counter(of key: String) -> UInt64Parameters
keythe key to fetch
Return Value
the counter value
-
Obtain a new Dot instance containing the counter of the given key
Declaration
Swift
internal func dot(of key: String) -> DotParameters
keythe key to use
Return Value
the new Dot instance
-
Obtain a clock that is newer than the client and server clocks at the given
keycounter.Declaration
Swift
public static func update(client: DVV?, server: DVV?, key: String) -> DVVParameters
clientthe version vector from a client
serverthe version vector from a server
keythe server key
Return Value
new DVV
-
Obtain a clock that is newer than the client and server clocks at the given
keycounter.Declaration
Swift
public static func update(client: [DVV], server: [DVV], key: String) -> DVVParameters
clientone or more version vectors from a client
serverone or more version vectors from a server
keythe server key
Return Value
new DVV
-
Merges a collection of clocks into a new DVV, removing redundant information (old entries).
Declaration
Swift
public static func merge(_ dvvs: [DVV]) -> DVVParameters
dvvscollection of DVV instances to merge
Return Value
new DVV
-
Takes two clock sets and returns a set of concurrent clocks, each belonging to one of the sets, and that together cover both sets while discarding obsolete knowledge.
Declaration
Swift
public static func sync(_ lhs: [DVV], _ rhs: [DVV]) -> [DVV]Parameters
lhscollection of DVV instances to sync
rhscollection of DVV instances to sync
Return Value
new DVV collection that represents the two input collections
View on GitHub
DVV Structure Reference