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

Nicolas Capponi
19.06.2014 174074dccd4a4731728bfb274ed982534c45fde1
refs
author Nicolas Capponi <nicolas.capponi@forgerock.com>
Tuesday, August 19, 2014 12:06 +0200
committer Nicolas Capponi <nicolas.capponi@forgerock.com>
Tuesday, August 19, 2014 12:06 +0200
commit174074dccd4a4731728bfb274ed982534c45fde1
tree 8cab2f3e8d582658ccb4e2ef6688ad8dc24cb537 tree | zip | gz
parent f5022c52afe0870d9069897a152a60ce25a1e2eb view | diff
Forward port of 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.

* 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

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

* 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
9 files modified
132 ■■■■ changed files
opendj3-server-dev/src/server/org/opends/server/replication/server/ReplicationServerDomain.java 5 ●●●●● diff | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/api/DBCursor.java 23 ●●●●● diff | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/api/ReplicationDomainDB.java 32 ●●●●● diff | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/ChangeNumberIndexer.java 3 ●●●● diff | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/DomainDBCursor.java 13 ●●●● diff | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/JEChangelogDB.java 32 ●●●●● diff | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/MultiDomainDBCursor.java 10 ●●●● diff | view | raw | blame | history
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/replication/server/changelog/je/ChangeNumberIndexerTest.java 13 ●●●● diff | view | raw | blame | history
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/replication/server/changelog/je/CompositeDBCursorTest.java 1 ●●●● diff | view | raw | blame | history