OPENDJ-1259 (CR-3443) Make the Medium Consistency Point support replicas temporarily leaving the topology
Changed ChangeTimeHeartbeatMsg to be able to send timestamps for a replica stopping. This is done by adding an event type to cover both normal heartbeat and temporarily offline replica.
This allows RSs to compute medium consistency accurately by using the stop time from the originating server.
Because of this change, incremented protocol version to v8.
ProtocolVersion.java:
Added REPLICATION_PROTOCOL_V8.
Fixed javadocs by using lists.
ByteArrayBuilder.java, ByteArrayScanner.java, ByteArrayTest.java: ADDED
ChangeTimeHeartbeatMsg.java:
Added eventType field + added isReplicaOfflineMsg().
Made ctor private + added factory methods heartbeatMsg() and replicaOfflineMsg().
Used ByteArrayBuilder and ByteArrayScanner.
CTHeartbeatPublisherThread.java:
In run(), on shutdown, handle sending a replica offline message.
SynchronizationMsgTest.java:
Added changeTimeHeartbeatMsgTest() and assertCTHearbeatMsg().
Code cleanup + used static import for ProtocolVersion.
DataServerHandler.java:
Consequence of the change to StopMsg ctor.
Extracted method publishStopMsg() for increased readability.
ReplicationServerDomain.java:
In processChangeTimeHeartbeatMsg(), added support for offline replica messages + declared DirectoryException checked exception.
ServerHandler.java:
Consequence of the change to ReplicationServerDomain.processChangeTimeHeartbeatMsg() checked exception.
ChangeNumberIndexer.java:
In initialize(), handle offline replicas.
In moveForwardMediumConsistencyPoint(), now throw ChangelogException.
In removeCursor(), now call resetNextChangeForInsertDBCursor().
ChangeNumberIndexerTest.java:
Expanded the emptyDBTwoDSsOneGoingOffline() test.
JEChangelogDB.java, ReplicationDomainDB.java:
In replicaOffline(), now throw ChangelogException and call ReplicationDbEnv.addOfflineReplica()
Added ChangelogDBPurger.initiateShutdown().
ReplicationDbEnv.java:
Added OFFLINE_TAG constant, toReplicaOfflineEntry(), addOfflineReplica() and putInChangelogStateDB(), toByteArray()().
In decodeChangelogState(), handle offline replica information.
Changed several method signature to use Entry<byte[], byte[]> instead of Entry<String, String>.
ReplicationDbEnvTest.java:
Fixed indentation + added tests.
ChangelogState.java:
Added offlineReplicas field + addOfflineReplica() and getOfflineReplicas() + changed toString() to display it.
StopMsg.java:
Added toString().
JEReplicaDBCursor.java:
Improved comments and javadocs.