Interface AccountPatchReviewStore


public interface AccountPatchReviewStore
Store for reviewed flags on changes.

A reviewed flag is a tuple of (patch set ID, file, account ID) and records whether the user has reviewed a file in a patch set. Each user can easily have thousands of reviewed flags and the number of reviewed flags is growing without bound. The store must be able handle this data volume efficiently.

For a cluster setups with multiple primary nodes the store must replicate the data between the primary servers.

  • Method Details

    • markReviewed

      boolean markReviewed(PatchSet.Id psId, Account.Id accountId, String path)
      Marks the given file in the given patch set as reviewed by the given user.
      Parameters:
      psId - patch set ID
      accountId - account ID of the user
      path - file path
      Returns:
      true if the reviewed flag was updated, false if the reviewed flag was already set
    • markReviewed

      void markReviewed(PatchSet.Id psId, Account.Id accountId, Collection<String> paths)
      Marks the given files in the given patch set as reviewed by the given user.
      Parameters:
      psId - patch set ID
      accountId - account ID of the user
      paths - file paths
    • clearReviewed

      void clearReviewed(PatchSet.Id psId, Account.Id accountId, String path)
      Clears the reviewed flag for the given file in the given patch set for the given user.
      Parameters:
      psId - patch set ID
      accountId - account ID of the user
      path - file path
    • clearReviewed

      void clearReviewed(PatchSet.Id psId)
      Clears the reviewed flags for all files in the given patch set for all users.
      Parameters:
      psId - patch set ID
    • clearReviewed

      void clearReviewed(Change.Id changeId)
      Clears the reviewed flags for all files in all patch sets in the given change for all users.
      Parameters:
      changeId - change ID
    • clearReviewedBy

      default void clearReviewedBy(Account.Id accountId)
      Clears the reviewed flags for the given user in all the relevant changes/patch-set/files.
      Parameters:
      accountId - account ID of the user
    • findReviewed

      Find the latest patch set, that is smaller or equals to the given patch set, where at least, one file has been reviewed by the given user.
      Parameters:
      psId - patch set ID
      accountId - account ID of the user
      Returns:
      optionally, all files that have been reviewed by the given user that belong to the patch set that is smaller or equals to the given patch set