Class EntryHistorical

java.lang.Object
org.opends.server.replication.plugin.EntryHistorical

public final class EntryHistorical extends Object
Stores historical information that is used to resolve modify conflicts over any attribute of an entry. It represents the content of the ds-sync-hist attribute for a whole entry.

It is assumed that the common case is not to have conflict and therefore is optimized (in order of importance) for:

  1. detecting potential conflict
  2. fast update of historical information for non-conflicting change
  3. fast and efficient purge
  4. compact
  5. solve conflict. This should also be as fast as possible but not at the cost of any of the other previous objectives
One Historical object is created for each entry in the entry cache and each Historical Object contains a list of attribute historical information

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 Details

    • DS_SYNC_HIST

      public static final String DS_SYNC_HIST
      Name of the attribute used to store historical information.
      See Also:
  • Constructor Details

    • EntryHistorical

      public EntryHistorical()
      Default constructor.
    • EntryHistorical

      public EntryHistorical(Csn entryAddDate, Csn entryModDnDate)
      Constructor.
      Parameters:
      entryAddDate - the CSN when the entry was created
      entryModDnDate - the CSN when the entry was last renamed
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • attributeHistorical

      public AttrHistorical attributeHistorical(AttributeDescription attrDesc)
      Return an AttributeHistorical corresponding to the attribute type and options contained in the provided mod, The attributeHistorical is:
      • either read from this EntryHistorical object if one exist,
      • or created empty.
      Parameters:
      attrDesc - the attributeType and options to retrieve/create the attribute historical
      Returns:
      the not-null attribute historical retrieved or created empty.
    • newInstanceFromEntry

      public static EntryHistorical newInstanceFromEntry(Entry entry)
      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

      public static UUID getEntryUUID(Entry entry)
      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.
    • getEntryAddDate

      public Csn getEntryAddDate()
      Returns the CSN of the operation that added this entry.
      Returns:
      the CSN of the operation that added this entry
    • getEntryModDnDate

      public Csn getEntryModDnDate()
      Returns the CSN of the operation that renamed this entry.
      Returns:
      the CSN of the operation that renamed this entry
    • getAllAttrHistorical

      public Map<AttributeDescription, AttrHistorical> getAllAttrHistorical()
      Returns the historical information for all attributes.
      Returns:
      the historical information for all attributes
    • getAttrHistorical

      public AttrHistorical getAttrHistorical(AttributeDescription attributeDescription)
      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.