pt.unl.fct.di.novasys.babel.crdts.state.utils

Class VVContext

    • Constructor Detail

      • VVContext

        public VVContext(ReplicaID replicaID)
        Creates a simple replica state. Creates a new version vector accordingly.
        Parameters:
        replicaID - the replica identifier
    • Method Detail

      • getVV

        public VersionVector getVV()
        Description copied from interface: VVState
        Gets the version vector stored in the state.
        Specified by:
        getVV in interface VVState
        Returns:
        the version vector
      • getVVCopy

        public VersionVector getVVCopy()
        Description copied from interface: VVState
        Gets a copy of the version vector stored in the state.
        Specified by:
        getVVCopy in interface VVState
        Returns:
        the version vector
      • incClock

        public Timestamp incClock()
        Description copied from interface: VVState
        Increments the "clock" of the replica (i.e., increments the specific entry of the replica in question) by generating a new timestamp
        Specified by:
        incClock in interface VVState
        Returns:
        the newly created timestamp
      • updateTs

        public void updateTs(Timestamp ts)
        Description copied from interface: VVState
        Updates the replica's version vector with a given timestamp. The update only occurs if the timestamp is superior to the entry of the replica.
        Specified by:
        updateTs in interface VVState
        Parameters:
        ts - the timestamp to integrate into the version vector.
      • updateVV

        public void updateVV(VersionVector vv)
        Description copied from interface: VVState
        Updates the replica's version vector with a given version vector. The update only occurs if the any of the entries are superior to replica own entries.
        Specified by:
        updateVV in interface VVState
        Parameters:
        vv - the version vector received.
      • mergeTs

        public void mergeTs(Timestamp ts)
        Description copied from interface: VVState
        Method called when merging the state with other replica. It acts as a wrapper to updateTs when the argument passed is not a null.
        Specified by:
        mergeTs in interface VVState
        Parameters:
        ts - the timestamp to update.

Copyright © 2024. All rights reserved.