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

Jean-Noel Rouvignac
08.37.2013 8170a25a086fb89f90a2b2b8613e7b7d82a47208
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
commit8170a25a086fb89f90a2b2b8613e7b7d82a47208
tree b9301b2d9f146d33603bd23074dc1e626f948a9e tree | zip | gz
parent 5f751b9bbcfd18baabab8c0096d78679bd737f70 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
opends/src/server/org/opends/server/replication/server/DbHandler.java 4 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/ReplicationDB.java 625 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/ReplicationDbEnv.java 15 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/ReplicationIterator.java 15 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/ReplicationKey.java 59 ●●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java 106 ●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/DbHandlerTest.java 300 ●●●●● diff | view | raw | blame | history