Interface BatchUpdateOp

All Superinterfaces:
RepoOnlyOp
All Known Subinterfaces:
InsertChangeOp
All Known Implementing Classes:
AbandonOp, AddReviewersOp, AddToAttentionSetOp, AttentionSetUnchangedOp, ChangeInserter, DeleteChangeOp, DeleteReviewerByEmailOp, DeleteReviewerOp, DeleteVoteOp, MergedByPushOp, PatchSetInserter, PostReviewOp, PublishCommentsOp, RebaseChangeOp, RemoveFromAttentionSetOp, ResetCherryPickOp, ReviewerOp, SetCherryPickOp, SetCustomKeyedValuesOp, SetHashtagsOp, SetPrivateOp, SetTopicOp, StoreSubmitRequirementsOp, WorkInProgressOp

public interface BatchUpdateOp extends RepoOnlyOp
Interface for BatchUpdate operations that touch a change.

Each operation has updateChange(ChangeContext) called once the change is read in a transaction. Ops are associated with updates via BatchUpdate.addOp(com.google.gerrit.entities.Change.Id, BatchUpdateOp).

Usually, a single BatchUpdateOp instance is only associated with a single change, i.e. addOp is only called once with that instance. Additionally, each method in BatchUpdateOp is called at most once per BatchUpdate execution.

Taken together, these two properties mean an instance may communicate between phases by storing data in private fields, and a single instance must not be reused.

  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Override this method to modify a change.

    Methods inherited from interface com.google.gerrit.server.update.RepoOnlyOp

    postUpdate, updateRepo
  • Method Details

    • updateChange

      default boolean updateChange(ChangeContext ctx) throws Exception
      Override this method to modify a change.
      Parameters:
      ctx - context
      Returns:
      whether anything was changed that might require a write to the metadata storage.
      Throws:
      Exception