public class VVContext extends Object implements VVState
| Modifier and Type | Field and Description |
|---|---|
protected ReplicaID |
replicaID |
protected VersionVector |
vv |
| Constructor and Description |
|---|
VVContext(ReplicaID replicaID)
Creates a simple replica state.
|
| Modifier and Type | Method and Description |
|---|---|
ReplicaID |
getReplicaID() |
VersionVector |
getVV()
Gets the version vector stored in the state.
|
VersionVector |
getVVCopy()
Gets a copy of the version vector stored in the state.
|
Integer |
getVVEntry(ReplicaID otherReplicaID) |
Timestamp |
incClock()
Increments the "clock" of the replica (i.e., increments the specific entry of the replica in question) by generating a new timestamp
|
void |
mergeTs(Timestamp ts)
Method called when merging the state with other replica.
|
void |
updateTs(Timestamp ts)
Updates the replica's version vector with a given timestamp.
|
void |
updateVV(VersionVector vv)
Updates the replica's version vector with a given version vector.
|
protected ReplicaID replicaID
protected VersionVector vv
public VVContext(ReplicaID replicaID)
replicaID - the replica identifierpublic ReplicaID getReplicaID()
getReplicaID in interface GenericReplicaStatepublic Integer getVVEntry(ReplicaID otherReplicaID)
getVVEntry in interface VVStatepublic VersionVector getVV()
VVStatepublic VersionVector getVVCopy()
VVStatepublic Timestamp incClock()
VVStatepublic void updateTs(Timestamp ts)
VVStatepublic void updateVV(VersionVector vv)
VVStateCopyright © 2024. All rights reserved.