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

Jean-Noel Rouvignac
11.04.2014 37fd83b785c0993b0e1f0fb93777943a9ec46d83
refs
author Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Friday, July 11, 2014 12:04 +0200
committer Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Friday, July 11, 2014 12:04 +0200
commit37fd83b785c0993b0e1f0fb93777943a9ec46d83
tree ac0bdef0721152c79a648da5799efe2ff3c27b7b tree | zip | gz
parent aea0892feca2fd3d56c9c810debed6d22389454e view | diff
OPENDJ-1453 Replica offline messages should be synced with updates

In r10840, the change to JE/FileChangelogDB.getCursorFrom(DN, ServerState) unnecessarily triggers a lot of calls to the underlying DB (JE or file based) to retrieve the ChangelogState.
As an optimization, keeping an in-memory version of the ChangelogState in synch with the on-disk version will help.


ChangelogState.java:
Now thread safe.
Added removeOfflineReplica(), isEqualTo().
Changed domainToServerIds from Map<DN, List<Integer>> to Map<DN, Set<Integer>>.
In getOfflineReplicas(), now return a MultiDomainServerState.

ChangeNumberIndexer.java:
Consequence of the changes to ChangelogState.


ReplicationDbEnv.java:
Added changelogState field, updated at the same time as the on-disk changelogstate DB
Added getChangelogState(), called by client code instead of readChangelogState().
Renamed readChangelogState() to private readOnDiskChangelogState().
Added stateLock field to sync updates to in-memory and on-disk changelog state.

ReplicationEnvironment.java:
Added changelogState field, updated at the same time as the on-disk changelogstate DB
Added getChangelogState(), called by client code instead of readChangelogState().
Renamed readChangelogState() to private readOnDiskChangelogState().
Renamed domainLock field to domainsLock.

replication.properties:
Removed now unused error message.

FileChangelogDB.java, JEChangelogDB.java:
Consequence of the changes to ChangelogState and ReplicationEnvironment/ReplicationDbEnv.


MultiDomainServerState.java, ServerState.java:
Added getSnapshot() for unit tests.

ReplicationEnvironmentTest.java, ReplicationDbEnvTest.java:
Consequence of the changes to ReplicationEnvironment and ChangelogState.
Used the fake server.
7 files modified
249 ■■■■ changed files
opendj3-server-dev/src/server/org/opends/server/replication/common/MultiDomainServerState.java 27 ●●●●● diff | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/replication/common/ServerState.java 14 ●●●●● diff | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/replication/server/ChangelogState.java 89 ●●●● diff | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/ChangeNumberIndexer.java 18 ●●●●● diff | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/JEChangelogDB.java 19 ●●●● diff | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/ReplicationDbEnv.java 64 ●●●● diff | view | raw | blame | history
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/replication/server/changelog/je/ReplicationDbEnvTest.java 18 ●●●●● diff | view | raw | blame | history