Interface ChangelogDB
- All Known Implementing Classes:
FileChangelogDB
public interface ChangelogDB
This interface is the entry point for the changelog database which stores the replication data on persistent storage.
It allows to control the overall database or access more specialized interfaces.
-
Method Summary
Modifier and TypeMethodDescriptionReturns theChangeNumberIndexDBobject.longReturns the newest changelog change number.longReturns the oldest changelog change number.Returns theReplicationDomainDBobject.voidInitializes the replication database by reading its previous state and building the relevant ReplicaDBs according to the previous state.voidNotifies the change number indexer that the list of excluded domains has changed.voidremoveDB()Removes the changelog database directory.voidsetComputeChangeNumber(boolean computeChangeNumber) Sets whether the replication database must compute change numbers for replicated changes.voidsetPurgeDelay(Duration purgeDelay) Sets the purge delay for the replication database.voidShutdown the replication database.
-
Method Details
-
initializeDB
Initializes the replication database by reading its previous state and building the relevant ReplicaDBs according to the previous state. This method must be called once before using the ChangelogDB.- Throws:
ChangelogException- if initialization fails
-
setPurgeDelay
Sets the purge delay for the replication database. Can be called while the database is running.Purging happens on a best effort basis, i.e. the purge delay is used by the replication database to know which data can be purged, but there are no guarantees on when the purging will actually happen.
- Parameters:
purgeDelay- the purge delay.Duration.ZEROdisables purging.
-
setComputeChangeNumber
void setComputeChangeNumber(boolean computeChangeNumber) Sets whether the replication database must compute change numbers for replicated changes. Change numbers are computed using a separate new thread.- Parameters:
computeChangeNumber- whether to compute change numbers for replicated changes
-
shutdownDB
Shutdown the replication database.- Throws:
ChangelogException- If a database problem happened
-
removeDB
Removes the changelog database directory.- Throws:
ChangelogException- If a database problem happened
-
getChangeNumberIndexDB
ChangeNumberIndexDB getChangeNumberIndexDB()Returns theChangeNumberIndexDBobject.- Returns:
- the
ChangeNumberIndexDBobject
-
getReplicationDomainDB
ReplicationDomainDB getReplicationDomainDB()Returns theReplicationDomainDBobject.- Returns:
- the
ReplicationDomainDBobject
-
getNewestChangeNumber
Returns the newest changelog change number.- Returns:
- returns the newest changelog change number
- Throws:
ChangelogException- if an error occurs
-
getOldestChangeNumber
Returns the oldest changelog change number.- Returns:
- returns the oldest changelog change number
- Throws:
ChangelogException- if an error occurs
-
notifyEclExcludedDomainsChanged
void notifyEclExcludedDomainsChanged()Notifies the change number indexer that the list of excluded domains has changed.
-