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

Jean-Noel Rouvignac
08.37.2013 0667279a02d2cc651ebcac518e50b773a4aa9412
refs
author Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Thursday, August 8, 2013 15:37 +0200
committer Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Thursday, August 8, 2013 15:37 +0200
commit0667279a02d2cc651ebcac518e50b773a4aa9412
tree cd353a2797132790a93709da916c43649ba0d32e tree | zip | gz
parent 13449c45617c5f162f8ef5116ceaeb2278292a0f view | diff
Big refactoring of ReplicationDB to make it readable.
Changed count() return type from int to long.
Removed a useless parameter from ReplicationIterator ctor.
Various code cleanups in other classes.



ReplicationDB.java:
Extracted methods:
- intializeCounters() from ctor.
- insertCounterRecordIfNeeded() and newCounterRecord() from addEntries().
- toChangeNumber(byte[])
- getRegularRecord() from getPreviousChangeNumber().
- findFirstCounterRecordAfterStartPoint(), findFirstCounterRecordBeforeStopPoint() and computeDistance() from count().
Created method createReplicationKey() and moved ReplicationKey code there.
In readFirstChange(), readLastChange(), getPreviousChangeNumber(),
Renamed closeLockedCursor() to closeAndReleaseReadLock().
Renamed isaCounter() to isACounterRecord().
Changed count() return type from int to long.

ReplicationKey.java: REMOVED
Moved code to ReplicationDB.createReplicationKey().


ReplicationIterator.java
In ctor, removed unused parameter id.

DbHandler.java:
Consequence of the change to ReplicationIterator ctor.
Consequence of the change to ReplicationDB.count().

DbHandlerTest.java:
Consequence of the change to ReplicationDB.count().
Extracted methods configureReplicationServer(), getReplicationDbPath(), createDirectory(), assertFoundInOrder(), assertNotFound().

TestCaseUtils.java:
Added findFreePort(), findFreePorts().
bindFreePort() now delegates to bindPort().


ReplicationDbEnv.java:
Renamed local variables for increased readability.
1 files deleted
6 files modified
1124 ■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/replication/server/DbHandler.java 4 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationDB.java 625 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationDbEnv.java 15 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationIterator.java 15 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationKey.java 59 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java 106 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/DbHandlerTest.java 300 ●●●●● diff | view | raw | blame | history