Class EntryHistorical
java.lang.Object
org.opends.server.replication.plugin.EntryHistorical
This class is used to store historical information that is used to resolve modify conflicts:
it is effectively the content of the
ds-sync-hist
attribute.
It is assumed that the common case is not to have conflict and therefore is optimized (in order of importance) for:
- detecting potential conflict
- fast update of historical information for non-conflicting change
- fast and efficient purge
- compact
- solve conflict. This should also be as fast as possible but not at the cost of any of the other previous objectives
ds-sync-hist
attribute must always converge
Note: the content of the ds-sync-hist
attribute is considered the same as user data: any divergence in its
content is considered a serious bug that should be fixed immediately.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Name of the attribute used to store historical information. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttrHistoricalAddValue
(AttributeDescription attributeDescription, CSN csn, ByteString value) Updates this entry historical information with the provided add modification.void
addAttrHistoricalDeleteAttr
(AttributeDescription attributeDescription, CSN csn) Updates this entry historical information with the provided delete attribute modification.void
addAttrHistoricalDeleteValue
(AttributeDescription attributeDescription, CSN csn, ByteString value) Updates this entry historical information with the provided delete modification.void
addAttrHistoricalReplaceValue
(AttributeDescription attributeDescription, CSN csn, ByteString value) Updates this entry historical information with the provided replace modification.Returns the historical information for all attributes.getAttrHistorical
(AttributeDescription attributeDescription) Returns the historical information for the named attribute.Returns the CSN of the operation that added this entry.Returns the CSN of the operation that renamed this entry.static UUID
getEntryUUID
(Entry entry) Get the entry unique Id in String form.static boolean
Check if a given attribute is an attribute used to store historical information.static EntryHistorical
newInstanceFromEntry
(Entry entry) Construct an Historical object from the provided entry by reading the historical attribute.void
setEntryADDDate
(CSN csn) Sets the CSN of the operation that added this entry.void
setEntryMODDNDate
(CSN csn) Sets the CSN of the operation that renamed this entry.toString()
-
Field Details
-
HISTORICAL_ATTRIBUTE_NAME
Name of the attribute used to store historical information.- See Also:
-
-
Constructor Details
-
EntryHistorical
public EntryHistorical()Default constructor used before decoding.
-
-
Method Details
-
toString
-
newInstanceFromEntry
Construct an Historical object from the provided entry by reading the historical attribute. Return an empty object when the entry does not contain any historical attribute.- Parameters:
entry
- The entry which historical information must be loaded- Returns:
- The constructed Historical information object
-
getEntryUUID
Get the entry unique Id in String form.- Parameters:
entry
- The entry for which the unique id should be returned.- Returns:
- The Unique Id of the entry, or a fake one if none is found.
-
isHistoricalAttribute
Check if a given attribute is an attribute used to store historical information.- Parameters:
attr
- The attribute that needs to be checked.- Returns:
- a boolean indicating if the given attribute is used to store historical information.
-
getEntryADDDate
Returns the CSN of the operation that added this entry.- Returns:
- The CSN of the operation that added this entry.
-
setEntryADDDate
Sets the CSN of the operation that added this entry.- Parameters:
csn
- The CSN of the operation that added this entry.
-
getEntryMODDNDate
Returns the CSN of the operation that renamed this entry.- Returns:
- The CSN of the operation that renamed this entry.
-
setEntryMODDNDate
Sets the CSN of the operation that renamed this entry.- Parameters:
csn
- The CSN of the operation that renamed this entry.
-
getAllAttrHistorical
Returns the historical information for all attributes.- Returns:
- The historical information for all attributes.
-
getAttrHistorical
Returns the historical information for the named attribute.- Parameters:
attributeDescription
- The attribute name.- Returns:
- The historical information for the named attribute, or
null
if there isn't any.
-
addAttrHistoricalAddValue
public void addAttrHistoricalAddValue(AttributeDescription attributeDescription, CSN csn, ByteString value) Updates this entry historical information with the provided add modification.- Parameters:
attributeDescription
- The attribute description.csn
- The CSN of the modification.value
- The value that was added.
-
addAttrHistoricalDeleteValue
public void addAttrHistoricalDeleteValue(AttributeDescription attributeDescription, CSN csn, ByteString value) Updates this entry historical information with the provided delete modification.- Parameters:
attributeDescription
- The attribute description.csn
- The CSN of the modification.value
- The value that was deleted.
-
addAttrHistoricalReplaceValue
public void addAttrHistoricalReplaceValue(AttributeDescription attributeDescription, CSN csn, ByteString value) Updates this entry historical information with the provided replace modification.- Parameters:
attributeDescription
- The attribute description.csn
- The CSN of the modification.value
- The value that was replaced.
-
addAttrHistoricalDeleteAttr
Updates this entry historical information with the provided delete attribute modification.- Parameters:
attributeDescription
- The attribute description.csn
- The CSN of the modification.
-