Class ReplicaChangelogImpl
java.lang.Object
org.forgerock.opendj.server.leaderbasedreplication.ReplicaChangelogImpl
- All Implemented Interfaces:
ReplicaChangelog, ChangelogContext
Class responsible for interactions with the changelog of a replica in the context of LAR.
- it handles the communication with core registry to retrieve the topology
- it fetches changes from remote replicas and appends them to the changelog
- it triggers the purge of outdated changes from the changelog
- it appends local changes received from the replica clients to the changelog
-
Field Summary
FieldsFields inherited from interface ReplicaChangelog
EMPTY_CHANGELOG -
Constructor Summary
ConstructorsConstructorDescriptionReplicaChangelogImpl(ServerContext serverContext, ReplicaId replicaId, ReplicaClient replicaClient, Stoppable parent) Creates a new ReplicaChangelogImpl. -
Method Summary
Modifier and TypeMethodDescriptionbooleanappendUserRequest(ReplicatedDomain domain, PreOperationOperation operation) Appends a user request to the changelog.csnNow()Returns a Csn representing the current time, not attached to an update.voidNotify the disk is full.booleanReturns whether after disk space recovers, we should consider the disk still full for internal management..voidfetchChangelogChanges(Dn domain, ReplicaState fromStartingPoint, SearchResultHandler handler) Fetches changelog changes for the specified domain starting from the given replica state.Returns the changelog state.getGenerationId(Dn baseDn) Returns the generation id of the replica.getOldestChangeOfStream(Domain domain, StreamId streamId) Returns the oldest change of the provided stream for the given domain.Returns the purge delay.Returns the replication server id.voidRemoves all the changes from the changelog which have aCsnolder than the one specified.voidsetGenerationId(Dn baseDn, GenerationId generationId) Set the generation id of the provided replication domain.voidshutdown()Shutdown replication.voidstart()Starts the changelog.voidstop()Stops the changelog.
-
Field Details
-
REPLICATION_CFG_NAME
- See Also:
-
-
Constructor Details
-
ReplicaChangelogImpl
public ReplicaChangelogImpl(ServerContext serverContext, ReplicaId replicaId, ReplicaClient replicaClient, Stoppable parent) throws ConfigException Creates a new ReplicaChangelogImpl.- Parameters:
serverContext- server contextreplicaId- replica idreplicaClient- replica clientparent- parent- Throws:
ConfigException- if a problem occurs
-
-
Method Details
-
start
public void start()Description copied from interface:ReplicaChangelogStarts the changelog.- Specified by:
startin interfaceReplicaChangelog
-
stop
public void stop()Description copied from interface:ReplicaChangelogStops the changelog.- Specified by:
stopin interfaceReplicaChangelog
-
shutdown
public void shutdown()Description copied from interface:ChangelogContextShutdown replication.- Specified by:
shutdownin interfaceChangelogContext- Specified by:
shutdownin interfaceReplicaChangelog
-
csnNow
Description copied from interface:ReplicaChangelogReturns a Csn representing the current time, not attached to an update. It has a similar function to the ChangeTime heartbeat we used to have in MultiMaster Replication- Specified by:
csnNowin interfaceReplicaChangelog- Returns:
- a Csn representing the current time
-
getChangelogState
Description copied from interface:ReplicaChangelogReturns the changelog state.- Specified by:
getChangelogStatein interfaceReplicaChangelog- Returns:
- the changelog state
-
purgeUpTo
Removes all the changes from the changelog which have aCsnolder than the one specified.- Specified by:
purgeUpToin interfaceReplicaChangelog- Parameters:
purgeCsn- TheCsnof the oldest change to keep in the changelog. All changes which are older than thisCsnwill be deleted.
-
getOldestChangeOfStream
Description copied from interface:ReplicaChangelogReturns the oldest change of the provided stream for the given domain.- Specified by:
getOldestChangeOfStreamin interfaceReplicaChangelog- Parameters:
domain- the domain to get the oldest change fromstreamId- the stream to get the oldest change from- Returns:
- the oldest change of the provided stream
-
appendUserRequest
Description copied from interface:ReplicaChangelogAppends a user request to the changelog.- Specified by:
appendUserRequestin interfaceReplicaChangelog- Parameters:
domain- the replicated domainoperation- the operation to append- Returns:
- the Csn of the appended operation
-
getReplicationServerId
Description copied from interface:ChangelogContextReturns the replication server id.- Specified by:
getReplicationServerIdin interfaceChangelogContext- Returns:
- the replication server id
-
getPurgeDelay
Description copied from interface:ChangelogContextReturns the purge delay.- Specified by:
getPurgeDelayin interfaceChangelogContext- Returns:
- the purge delay
-
getGenerationId
Description copied from interface:ChangelogContextReturns the generation id of the replica.- Specified by:
getGenerationIdin interfaceChangelogContext- Parameters:
baseDn- the base dn of the replication domain- Returns:
- the generation id of the replica
-
setGenerationId
Description copied from interface:ChangelogContextSet the generation id of the provided replication domain.- Specified by:
setGenerationIdin interfaceChangelogContext- Parameters:
baseDn- the base dn of the replication domaingenerationId- the generation id to set
-
fetchChangelogChanges
public void fetchChangelogChanges(Dn domain, ReplicaState fromStartingPoint, SearchResultHandler handler) throws LdapException Description copied from interface:ReplicaChangelogFetches changelog changes for the specified domain starting from the given replica state.- Specified by:
fetchChangelogChangesin interfaceReplicaChangelog- Parameters:
domain- the base DN of the domainfromStartingPoint- the starting point of the changes to fetchhandler- the handler to process the fetched results- Throws:
LdapException
-
diskFullThresholdReached
public void diskFullThresholdReached()Description copied from interface:ChangelogContextNotify the disk is full.- Specified by:
diskFullThresholdReachedin interfaceChangelogContext
-
failedToRestartAfterDiskFullRecovers
public boolean failedToRestartAfterDiskFullRecovers()Description copied from interface:ChangelogContextReturns whether after disk space recovers, we should consider the disk still full for internal management..- Specified by:
failedToRestartAfterDiskFullRecoversin interfaceChangelogContext- Returns:
- whether after disk space recovers, we should consider the disk still full for internal management.
-