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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ChangeNumberIndexDB
getChangeNumberIndexDB()
Returns theChangeNumberIndexDB
object.ReplicationDomainDB
getReplicationDomainDB()
Returns theReplicationDomainDB
object.void
initializeDB()
Initializes the replication database by reading its previous state and building the relevant ReplicaDBs according to the previous state.void
removeDB()
Removes the changelog database directory.void
setComputeChangeNumber(boolean computeChangeNumber)
Sets whether the replication database must compute change numbers for replicated changes.void
setPurgeDelay(Duration purgeDelay)
Sets the purge delay for the replication database.void
shutdownDB()
Shutdown the replication database.
-
-
-
Method Detail
-
initializeDB
void 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.
-
setPurgeDelay
void setPurgeDelay(Duration purgeDelay)
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.ZERO
disables purging.
-
setComputeChangeNumber
void setComputeChangeNumber(boolean computeChangeNumber) throws ChangelogException
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- Throws:
ChangelogException
- If a database problem happened
-
shutdownDB
void shutdownDB() throws ChangelogException
Shutdown the replication database.- Throws:
ChangelogException
- If a database problem happened
-
removeDB
void removeDB() throws ChangelogException
Removes the changelog database directory.- Throws:
ChangelogException
- If a database problem happened
-
getChangeNumberIndexDB
ChangeNumberIndexDB getChangeNumberIndexDB()
Returns theChangeNumberIndexDB
object.- Returns:
- the
ChangeNumberIndexDB
object
-
getReplicationDomainDB
ReplicationDomainDB getReplicationDomainDB()
Returns theReplicationDomainDB
object.- Returns:
- the
ReplicationDomainDB
object
-
-