OPENDJ-1174 (CR-2631) Transfer responsibility for populating the ChangeNumberIndexDB to ChangelogDB
Hooked the ChangeNumberIndexer thread into our code base.
Managed thread lifecycle.
Added configuration to turn it on / off.
Removed code that builds the ChangeNumberIndexDB from ECLServerHandler.
ChangeNumberIndexer.java:
Added clear() + doClear field for unit tests
Used thread safe versions of MultiDomainServerState.
In run(), merged all the try blocks to factorize the catch blocks + supported doClear + fixed a bug with the mediumConsistencyRUV.
In removeCursor(), closed the cursors.
Added removeAllCursors(), getPrecedingCSN().
Renamed crossDomainDBCursor to nextChangeForInsertDBCursor and newCompositeDBCursor() to resetNextChangeForInsertDBCursor().
Changed newCursors from ConcurrentMap<CSN, DN> to ConcurrentMap<Pair<DN, Integer>, CSN> to ensure minimum memory consumption.
JEChangelogDB.java:
Removed dbDirectoryName field.
Added config, cnIndexer fields.
Changed ctor to accept ReplicationServerCfg.
In initializeDB(), shutdownDB(), clearDB(), publishUpdateMsg() took appropriate actions with the cnIndexer thread.
Added setComputeChangeNumber().
In getCursorFrom(), accept null parameter.
In setPurgeDelay(), also call it on the cnIndexDB.
MultiDomainServerState.java:
Made implementation to be fully thread safe.
Changed list from Map to ConcurrentMap + removed synchrnoized blocks.
Renamed update(DN, ServerState) to replace(DN, ServerState).
Added new version of update(DN, ServerState).
ECLServerHandler.java:
Removed assignNewChangeNumberAndStore() that builds the ChangeNumberIndexDB + adapted the code that was using this method.
Used MultiDomainServerState.replace().
ReplicationServerConfiguration.xml, ReplicationServerCfgDefn.properties:
Added ds-cfg-compute-changenumber.
ExternalChangelogDomainConfiguration.xml, ExternalChangelogDomainCfgDefn.properties:
Updated description
ReplicationServer.java:
In applyConfigurationChange(), handled computeChangenumber config.
Used MultiDomainServerState.replace().
ChangelogDB.java:
Added setComputeChangeNumber().
ReplServerFakeConfiguration.java:
Added isComputeChangenumber() and setComputeChangenumber().
ExternalChangeLogTest.java:
Adapted the code to the use of the ChangeNumberIndexer thread.
JEChangeNumberIndexDB.java:
Extracted runPurge() from run().
ReplicationDbEnv.java
Code cleanup.