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
FieldsModifier and TypeFieldDescriptionstatic final Dn
The DN of the internal changelog backend.static final ReplicaChangelog
An empty changelog.static final String
The DN of the internal changelog backend. -
Method Summary
Modifier and TypeMethodDescriptionboolean
appendUserRequest
(PreOperationOperation operation) Appends a user request to the changelog.csnNow()
Returns a CSN representing the current time, not attached to an update.Returns the changelog state.getOldestChangeOfStream
(StreamId streamId) Returns the oldest change of the provided stream.void
handleRequest
(Request request, Consumer<Response> responseProcessor) Handles a search request to changelog backend.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
-
INTERNAL_CHANGELOG
The DN of the internal changelog backend.- See Also:
-
DN_INTERNAL_CHANGELOG
The DN of the internal changelog backend. -
EMPTY_CHANGELOG
An empty changelog.
-
-
Method Details
-
appendUserRequest
Appends a user request to the changelog.- Parameters:
operation
- 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
ReplicaState getChangelogState()Returns the changelog state.- Returns:
- the changelog state
-
getOldestChangeOfStream
Returns the oldest change of the provided stream.- Parameters:
streamId
- the stream to get the oldest change from- Returns:
- the oldest change of the provided stream
- Throws:
ChangelogException
-
handleRequest
Handles a search request to changelog backend.- Parameters:
request
- the request to handleresponseProcessor
- the response processor
-
purge
Purges the changelog up to the provided point.- Parameters:
purgePoint
- the minimum CSN to keep in the changelog
-
shutdown
void shutdown()Shuts down the changelog. -
start
void start()Starts the changelog. -
stop
void stop()Stops the changelog.
-