public interface AccountPatchReviewStore
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 multi-master setup the store must replicate the data between the masters.
Modifier and Type | Interface and Description |
---|---|
static class |
AccountPatchReviewStore.PatchSetWithReviewedFiles
Represents patch set id with reviewed files.
|
Modifier and Type | Method and Description |
---|---|
void |
clearReviewed(PatchSet.Id psId)
Clears the reviewed flags for all files in the given patch set for all users.
|
void |
clearReviewed(PatchSet.Id psId,
Account.Id accountId,
java.lang.String path)
Clears the reviewed flag for the given file in the given patch set for the given user.
|
java.util.Optional<AccountPatchReviewStore.PatchSetWithReviewedFiles> |
findReviewed(PatchSet.Id psId,
Account.Id accountId)
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.
|
void |
markReviewed(PatchSet.Id psId,
Account.Id accountId,
java.util.Collection<java.lang.String> paths)
Marks the given files in the given patch set as reviewed by the given user.
|
boolean |
markReviewed(PatchSet.Id psId,
Account.Id accountId,
java.lang.String path)
Marks the given file in the given patch set as reviewed by the given user.
|
boolean markReviewed(PatchSet.Id psId, Account.Id accountId, java.lang.String path) throws com.google.gwtorm.server.OrmException
psId
- patch set IDaccountId
- account ID of the userpath
- file pathtrue
if the reviewed flag was updated, false
if the reviewed flag was
already setcom.google.gwtorm.server.OrmException
- thrown if updating the reviewed flag failedvoid markReviewed(PatchSet.Id psId, Account.Id accountId, java.util.Collection<java.lang.String> paths) throws com.google.gwtorm.server.OrmException
psId
- patch set IDaccountId
- account ID of the userpaths
- file pathscom.google.gwtorm.server.OrmException
- thrown if updating the reviewed flag failedvoid clearReviewed(PatchSet.Id psId, Account.Id accountId, java.lang.String path) throws com.google.gwtorm.server.OrmException
psId
- patch set IDaccountId
- account ID of the userpath
- file pathcom.google.gwtorm.server.OrmException
- thrown if clearing the reviewed flag failedvoid clearReviewed(PatchSet.Id psId) throws com.google.gwtorm.server.OrmException
psId
- patch set IDcom.google.gwtorm.server.OrmException
- thrown if clearing the reviewed flags failedjava.util.Optional<AccountPatchReviewStore.PatchSetWithReviewedFiles> findReviewed(PatchSet.Id psId, Account.Id accountId) throws com.google.gwtorm.server.OrmException
psId
- patch set IDaccountId
- account ID of the usercom.google.gwtorm.server.OrmException
- thrown if accessing the reviewed flags failed