Class CsnFactory

    • Constructor Detail

      • CsnFactory

        public CsnFactory​(int replicaId)
        Creates a new CsnFactory instance
        Parameters:
        replicaId - The replica ID
    • Method Detail

      • newInstance

        public Csn newInstance()
        Returns a new Csn. Generated CSN can be duplicate if user generates CSNs more than 2G times a milliseconds.
        Returns:
        The new generated CSN
      • newInstance

        public Csn newInstance​(long timestamp,
                               int changeCount)
        Returns a new Csn created from the given values. This method is not to be used except for test purposes.
        Parameters:
        timestamp - The timestamp to use
        changeCount - The change count to use
        Returns:
        The new generated CSN
      • newPurgeCsn

        public Csn newPurgeCsn​(long expirationDate)
        Generates a CSN used to purge data. Its replicaID is not associated to a server.
        Parameters:
        expirationDate - The time up to the first CSN we want to keep
        Returns:
        The new generated CSN
      • setReplicaId

        public void setReplicaId​(int replicaId)
        Sets the replica ID
        Parameters:
        replicaId - The replica ID