Class ReplicationEnvironment

  • All Implemented Interfaces:
    ChangelogStateProvider

    public class ReplicationEnvironment
    extends Object
    implements ChangelogStateProvider
    Represents the replication environment, which allows to manage the lifecycle of the replication changelog.

    A changelog has a root directory, under which the following directories and files are created :

    • A "changenumberindex" directory containing the log files for ChangeNumberIndexDB, and a file named "rotationtime[millis].last" where [millis] is the time of the last log file rotation in milliseconds
    • A "domains.state" file containing a mapping of each domain DN to an id. The id is used to name the corresponding domain directory.
    • One directory per domain, named after "[id].domain" where [id] is the id assigned to the domain, as specified in the "domains.state" file.

    Each domain directory contains the following directories and files :

    • A "generation[id].id" file, where [id] is the generation id
    • One directory per server id, named after "[id].server" where [id] is the id of the server.
    Each server id directory contains the following files:
    • the most recent log file (also known as "head" log file), if present, where new records are appended.
    • Zero to many read-only log files named after the lowest key present in the log file (they all end with the ".log" suffix.
    See Log class for details on the log files.

    Layout example with two domains "o=test1" and "o=test2", each having server ids 22 and 33, with server id 33 for domain "o=test1" being offline :

     
     +---changelog
     |   \---domains.state  [contains mapping: 1 => "o=test1", 2 => "o=test2"]
     |   \---changenumberindex
     |      \--- 1.log [contains records with keys greater than or equal to 1
     |      \--- 51.log [contains last records written with keys greater than or equal to 51
     |      \--- rotationtime198745512.last
     |   \---1.domain
     |       \---generation1.id
     |       \---22.server
     |           \---00000163bbcbb2b0001600000001.log [contains last records written]
     |       \---33.server
     |           \---00000163bbcbb2b000210000002a.log [contains last records written]
     |   \---2.domain
     |       \---generation1.id
     |       \---22.server
     |           \---00000163bbcbeffb00160000002a.log [contains last records written]
     |       \---33.server
     |           \---00000163bbcbeffb002100000044.log [contains last records written]