Record Class ChangelogState
java.lang.Object
java.lang.Record
org.opends.server.replication.server.ChangelogState
- Record Components:
domainToGenerationId
- Maps domains base DNs to their generation IDsreplicas
- All the replicas which have a dedicated replica DB.The returned value is an unmodifiable set of replicas. If the set of replicas known to this RS does not change, then the returned set is always the same. This ensures equality tests on the set return
true
very quickly in case nothing changed. The change number indexer uses this trick to avoid spending too much comparing sets ofDomainReplicaId
s that rarely change.purgedReplicasNotProperlyStopped
- The replicas whose changelog has been purged and did not send aReplicaOfflineMsg
when they stopped.
@Immutable
public record ChangelogState(Map<Dn,GenerationId> domainToGenerationId, Set<DomainReplicaId> replicas, Set<DomainReplicaId> purgedReplicasNotProperlyStopped)
extends Record
This is the changelog state stored in the changelogStateDB. For each replication domain, it contains:
- its generationId
- the list of replicaIds composing it
This class is used during replication initialization to decouple the code that reads the changelogStateDB from the code that makes use of its data.
-
Constructor Summary
ConstructorsConstructorDescriptionChangelogState
(Map<Dn, GenerationId> domainToGenerationId, Set<DomainReplicaId> replicas, Set<DomainReplicaId> purgedReplicasNotProperlyStopped) Builds a changelog state. -
Method Summary
Modifier and TypeMethodDescriptionaddReplica
(DomainReplicaId replica) Returns a changelog state with the specified replica added if it is not already present.Returns the value of thedomainToGenerationId
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thepurgedReplicasNotProperlyStopped
record component.removeDomain
(Dn baseDn) Returns a new changelog state where supplied replication domain has been removed.removeReplica
(DomainReplicaId replica) Returns a changelog state with the specified replica removed if it was present.replicas()
Returns the value of thereplicas
record component.setDomainGenerationId
(Dn baseDn, GenerationId generationId) Returns a new changelog state with the generationId associated to the supplied replication domain.toString()
Returns a string representation of this record class.
-
Constructor Details
-
ChangelogState
public ChangelogState(Map<Dn, GenerationId> domainToGenerationId, Set<DomainReplicaId> replicas, Set<DomainReplicaId> purgedReplicasNotProperlyStopped) Builds a changelog state.
-
-
Method Details
-
setDomainGenerationId
Returns a new changelog state with the generationId associated to the supplied replication domain.- Parameters:
baseDn
- the targeted replication domain baseDNgenerationId
- the generation Id to set- Returns:
- a new changelog state
-
removeDomain
Returns a new changelog state where supplied replication domain has been removed.- Parameters:
baseDn
- the replication domain base DN to remove- Returns:
- a new changelog state
-
addReplica
Returns a changelog state with the specified replica added if it is not already present.- Parameters:
replica
- the replica to add- Returns:
- a changelog state
-
removeReplica
Returns a changelog state with the specified replica removed if it was present.- Parameters:
replica
- the replica to remove- Returns:
- a new changelog state
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
domainToGenerationId
Returns the value of thedomainToGenerationId
record component.- Returns:
- the value of the
domainToGenerationId
record component
-
replicas
Returns the value of thereplicas
record component.- Returns:
- the value of the
replicas
record component
-
purgedReplicasNotProperlyStopped
Returns the value of thepurgedReplicasNotProperlyStopped
record component.- Returns:
- the value of the
purgedReplicasNotProperlyStopped
record component
-