Interface ReplicaChangelog
public interface ReplicaChangelog
It represents the changelog of the replica.
Temporary interface to be able to test the leader based replication in the simulator, which implements fakes objects.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
appendUserRequest
(ReplicatedDomain domain, PreOperationOperation operation) Appends a user request to the changelog.csnNow()
Returns a CSN representing the current time, not attached to an update.void
fetchChangelogChanges
(Dn domain, ReplicaState fromStartingPoint, SearchResultHandler handler) Fetches changelog changes for the specified domain starting from the given replica state.Returns the changelog state.getOldestChangeOfStream
(Domain domain, StreamId streamId) Returns the oldest change of the provided stream for the given domain.void
Purges the changelog up to the provided point.void
shutdown()
Shuts down the changelog.void
start()
Starts the changelog.void
stop()
Stops the changelog.
-
Field Details
-
EMPTY_CHANGELOG
An empty changelog.
-
-
Method Details
-
appendUserRequest
Appends a user request to the changelog.- Parameters:
domain
- the replicated domainoperation
- the operation to append- Returns:
- the CSN of the appended operation
-
csnNow
CSN csnNow()Returns 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- Returns:
- a CSN representing the current time
-
getChangelogState
Map<Domain,ReplicaState> getChangelogState()Returns the changelog state.- Returns:
- the changelog state
-
getOldestChangeOfStream
Returns the oldest change of the provided stream for the given domain.- 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
-
purge
Purges the changelog up to the provided point.- Parameters:
purgePointByDomain
- the minimum CSN to keep in the changelog by domain
-
shutdown
void shutdown()Shuts down the changelog. -
start
void start()Starts the changelog. -
stop
void stop()Stops the changelog. -
fetchChangelogChanges
void fetchChangelogChanges(Dn domain, ReplicaState fromStartingPoint, SearchResultHandler handler) throws LdapException Fetches changelog changes for the specified domain starting from the given replica state.- 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
-