mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
28.50.2014 53058e19e0f41acf6303cdac234b47311556dfc5
refs
author Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Friday, March 28, 2014 12:50 +0100
committer Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Friday, March 28, 2014 12:50 +0100
commit53058e19e0f41acf6303cdac234b47311556dfc5
tree 432388f13bf1ba6153c0ada2bbb833a0c028514d tree | zip | gz
parent 1eee8af77481429c64b60c1d21b276d43e704547 view | diff
OPENDJ-1177 (CR-3278) Re-implement changelog purging logic

In JEReplicaDB, simplified the logic that handled the internal queue that is used before actually persisting UpdateMsg changes to the underlying Berkeley JE DB.
Simplified the publisher/consumer model (msgQueue.add() / msgQueue.remove()) by relying on a LinkedBlockingQueue and a semaphore, instead of many synchronized blocks and fields that cluttered this code.



JEReplicaDB.java:
Changed msgQueue from LinkedList to LinkedBlockingQueue.
Removed fields queueMaxSize, queueLowmark, queueHimark, queueLowmarkBytes, queueHimarkBytes, queueByteSize and replaced them all with queueSizeBytes Semaphore.
Removed clearQueue() and getChanges().
Added collectAllPermits().
Added immutable CSNLimits class to remove the need for synchronizing on oldest and newest CSNs.

ReplicationDB.java:
In addEntries(), now return the total size of the persisted messages (return type was void).

JEReplicaDBTest.java:
In testTrim(), allowed the test to finish + made the code clearer.

replication.properties:
Added an error message for adding a change to the JEReplicaDB.
4 files modified
452 ■■■■ changed files
opendj-sdk/opends/src/messages/messages/replication.properties 6 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/server/changelog/je/JEReplicaDB.java 354 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/server/changelog/je/ReplicationDB.java 11 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/changelog/je/JEReplicaDBTest.java 81 ●●●● diff | view | raw | blame | history