Class GenerationIdChecksum

  • All Implemented Interfaces:
    Checksum

    public class GenerationIdChecksum
    extends Object
    implements Checksum
    This class computes the generation id used for a replication domain. It is a checksum based on some special entries/attributes of the domain. The written stream to this class is the LDIF representation of the entries we are interested in for computing the generation id. The current implementation simply does the sum of each written byte and stores the value in a long. We do not care about the cycling long as the probability of 2 data sets having the same checksum is very low.
    • Field Detail

      • EMPTY_BACKEND_GENERATION_ID

        public static final long EMPTY_BACKEND_GENERATION_ID
        This is the generation id for an empty backend.

        It corresponds to a backend entry count of zero, i.e. we encode 0 in ASCII which gives 48.

        See Also:
        Constant Field Values
    • Constructor Detail

      • GenerationIdChecksum

        public GenerationIdChecksum()
    • Method Detail

      • update

        public void update​(int b)
        Specified by:
        update in interface Checksum
      • update

        public void update​(byte[] b,
                           int off,
                           int len)
        Specified by:
        update in interface Checksum
      • getValue

        public long getValue()
        Specified by:
        getValue in interface Checksum
      • reset

        public void reset()
        Specified by:
        reset in interface Checksum