Class DatabaseReconciliator


  • public class DatabaseReconciliator
    extends java.lang.Object
    The database reconciliator implements various parts of the sync down algorithm (see also: DownOperation). Its main responsibility is to compare the local database to the other clients' delta databases. The final goal of the algorithms described in this class is to determine a winning MemoryDatabase (or better: a winning DatabaseBranch) of a client.

    All algorithm parts largely rely on the comparison of a client's database branch, i.e. its committed set of DatabaseVersions. Instead of comparing the entire database versions of the different clients, however, the comparisons solely rely on the DatabaseVersionHeaders. In particular, most of them only compare the VectorClock. If the vector clocks are in conflict (= simultaneous), the local timestamp is used as a final decision (oldest wins).

    Algorithm:

    1. Input: Local branch, unknown remote branches
    2. Sort the databaseversions by vectorclocks, tiebreaking with timestamps.
    3. Walk through the sorted list and construct the winning branch.
    See Also:
    DownOperation, VectorClock