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

Nicolas Capponi
21.06.2014 ab3cac04319c920ba14be59ea874e6e35f730655
refs
author Nicolas Capponi <nicolas.capponi@forgerock.com>
Monday, July 21, 2014 19:06 +0200
committer Nicolas Capponi <nicolas.capponi@forgerock.com>
Monday, July 21, 2014 19:06 +0200
commitab3cac04319c920ba14be59ea874e6e35f730655
tree a8070030ecd55bacae6631f9807b908ae02aaa9a tree | zip | gz
parent b367c9116aa754542377720f8ba8680191d04ce2 view | diff
Checkpoint commit for OPENDJ-1206 : Create a new ReplicationBackend/ChangelogBackend 
to support cn=changelog
CR-4053

Preparatory work for the changelog backend: add a new behavior to cursors, in order to be
able to start cursor at a given key instead of starting just after.
In order to avoid introducing another boolean in the methods, I created two enums to
define the behavior of a cursor.

Note that JE implementation does not yet implement the new behavior.

* DBCursor class : add two enums KeyMatchingStrategy and PositionStrategy
** The new behavior corresponds to PositionStrategy.ON_MATCHING_KEY, which allow
to position on the record with the given key (while AFTER_MATCHING_KEY position
just after the record with the given key).

* ReplicationDomainDB : add PositionStrategy argument for all methods that returns a cursor

* ReplicationServerDomain : getCursorFrom(DN, ServerState) method calls underlying method
with PositionStrategy.AFTER_MATCHING_KEY

* FileChangelogDB : add PositionStrategy argument for all methods that returns a cursor

* FileReplicaDB : add PositionStrategy argument to generateCursorFrom(CSN) method

* FileReplicaDBCursor : add PositionStrategy argument to the constructor, implement the
new behavior when position strategy is ON_MATCHING_KEY

* DomainDBCursor, MultiDomainDBCursor : add PositionStrategy argument to the constructor,
pass the strategy to underlying cursors

* Log, LogFile, BlockLogReader : implement the new behavior when position strategy
is ON_MATCHING_KEY

* ChangeNumberIndexer : use AFTER_MATCHING_KEY strategy when retrieving the
cursor (no behavior change)

* JEChangelogDB : add PositionStrategy argument for all methods that returns a cursor,
but getCursorFrom(DN, int, CSN, PositionStrategy) method does NOT implement the
new ON_MATCHING_KEY strategy.

* Update of tests classes to match method signature but no new tests added for the
new behavior (ON_MATCHING_KEY) - to be done later

18 files modified
403 ■■■■■ changed files
opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java 5 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/api/DBCursor.java 23 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/api/ReplicationDomainDB.java 32 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/file/BlockLogReader.java 64 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/file/FileChangelogDB.java 32 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/file/FileReplicaDB.java 19 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/file/FileReplicaDBCursor.java 27 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/file/Log.java 63 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/file/LogFile.java 21 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/je/ChangeNumberIndexer.java 3 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/je/DomainDBCursor.java 13 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/je/JEChangelogDB.java 33 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/je/MultiDomainDBCursor.java 10 ●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/changelog/file/BlockLogReaderWriterTest.java 16 ●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/changelog/file/FileReplicaDBTest.java 14 ●●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/changelog/file/LogTest.java 13 ●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/changelog/je/ChangeNumberIndexerTest.java 14 ●●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/changelog/je/CompositeDBCursorTest.java 1 ●●●● diff | view | raw | blame | history