Interface CommitContext

All Known Implementing Classes:
SimpleCommitContext

public interface CommitContext
A CommitContext instance can be obtained from CommitInfo.getInfo() if it has been set before the merge call. This can then be used by CommitHook to record some metadata regarding the commit.

CommitContext state would be reset in case commit is retried from within NodeStore say when a merge exception occurs.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Name of the entry of the mutable commit attributes map in the info map in CommitInfo.getInfo()
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable Object
    get(String name)
    Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
    void
    remove(String name)
    Removes an attribute from this commit.
    void
    set(String name, Object value)
    Stores an attribute related to this commit.
  • Field Details

  • Method Details

    • set

      void set(String name, Object value)
      Stores an attribute related to this commit. Attributes are reset if the commit is retried.

      If the object passed in is null, the effect is the same as calling remove(java.lang.String).

      Parameters:
      name - a String specifying the name of the attribute
      value - the Object to be stored
    • get

      @Nullable @Nullable Object get(String name)
      Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
      Parameters:
      name - String specifying the name of the attribute
      Returns:
      an Object containing the value of the attribute, or null if the attribute does not exist
    • remove

      void remove(String name)
      Removes an attribute from this commit.
      Parameters:
      name - a String specifying the name of the attribute to remove