Class ChangeRebuilderImpl
- java.lang.Object
-
- com.google.gerrit.server.notedb.rebuild.ChangeRebuilder
-
- com.google.gerrit.server.notedb.rebuild.ChangeRebuilderImpl
-
public class ChangeRebuilderImpl extends ChangeRebuilder
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.gerrit.server.notedb.rebuild.ChangeRebuilder
ChangeRebuilder.NoPatchSetsException
-
-
Field Summary
Fields Modifier and Type Field Description static long
MAX_WINDOW_MS
The maximum amount of time between the ReviewDb timestamp of the first and last events batched together into a single NoteDb update.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
buildUpdates(NoteDbUpdateManager manager, ChangeBundle bundle)
NoteDbUpdateManager.Result
execute(ReviewDb db, Change.Id changeId, NoteDbUpdateManager manager)
NoteDbUpdateManager.Result
execute(ReviewDb db, Change.Id changeId, NoteDbUpdateManager manager, boolean checkReadOnly, boolean executeManager)
NoteDbUpdateManager.Result
rebuild(ReviewDb db, Change.Id changeId)
NoteDbUpdateManager.Result
rebuild(NoteDbUpdateManager manager, ChangeBundle bundle)
NoteDbUpdateManager.Result
rebuildEvenIfReadOnly(ReviewDb db, Change.Id changeId)
void
rebuildReviewDb(ReviewDb db, Project.NameKey project, Change.Id changeId)
Rebuild ReviewDb contents by copying from NoteDb.NoteDbUpdateManager
stage(ReviewDb db, Change.Id changeId)
-
Methods inherited from class com.google.gerrit.server.notedb.rebuild.ChangeRebuilder
rebuildAsync
-
-
-
-
Field Detail
-
MAX_WINDOW_MS
public static final long MAX_WINDOW_MS
The maximum amount of time between the ReviewDb timestamp of the first and last events batched together into a single NoteDb update.Used to account for the fact that different records with their own timestamps (e.g.
PatchSetApproval
andChangeMessage
) historically didn't necessarily use the same timestamp, and tended to callSystem.currentTimeMillis()
independently.
-
-
Method Detail
-
rebuild
public NoteDbUpdateManager.Result rebuild(ReviewDb db, Change.Id changeId) throws IOException, com.google.gwtorm.server.OrmException
- Specified by:
rebuild
in classChangeRebuilder
- Throws:
IOException
com.google.gwtorm.server.OrmException
-
rebuildEvenIfReadOnly
public NoteDbUpdateManager.Result rebuildEvenIfReadOnly(ReviewDb db, Change.Id changeId) throws IOException, com.google.gwtorm.server.OrmException
- Specified by:
rebuildEvenIfReadOnly
in classChangeRebuilder
- Throws:
IOException
com.google.gwtorm.server.OrmException
-
rebuild
public NoteDbUpdateManager.Result rebuild(NoteDbUpdateManager manager, ChangeBundle bundle) throws NoSuchChangeException, IOException, com.google.gwtorm.server.OrmException
- Specified by:
rebuild
in classChangeRebuilder
- Throws:
NoSuchChangeException
IOException
com.google.gwtorm.server.OrmException
-
stage
public NoteDbUpdateManager stage(ReviewDb db, Change.Id changeId) throws IOException, com.google.gwtorm.server.OrmException
- Specified by:
stage
in classChangeRebuilder
- Throws:
IOException
com.google.gwtorm.server.OrmException
-
execute
public NoteDbUpdateManager.Result execute(ReviewDb db, Change.Id changeId, NoteDbUpdateManager manager) throws com.google.gwtorm.server.OrmException, IOException
- Specified by:
execute
in classChangeRebuilder
- Throws:
com.google.gwtorm.server.OrmException
IOException
-
execute
public NoteDbUpdateManager.Result execute(ReviewDb db, Change.Id changeId, NoteDbUpdateManager manager, boolean checkReadOnly, boolean executeManager) throws com.google.gwtorm.server.OrmException, IOException
- Throws:
com.google.gwtorm.server.OrmException
IOException
-
buildUpdates
public void buildUpdates(NoteDbUpdateManager manager, ChangeBundle bundle) throws IOException, com.google.gwtorm.server.OrmException
- Specified by:
buildUpdates
in classChangeRebuilder
- Throws:
IOException
com.google.gwtorm.server.OrmException
-
rebuildReviewDb
public void rebuildReviewDb(ReviewDb db, Project.NameKey project, Change.Id changeId) throws com.google.gwtorm.server.OrmException
Description copied from class:ChangeRebuilder
Rebuild ReviewDb contents by copying from NoteDb.Requires NoteDb to be the primary storage for the change.
- Specified by:
rebuildReviewDb
in classChangeRebuilder
- Throws:
com.google.gwtorm.server.OrmException
-
-