NoteDb: Auto-rebuild when either reads or writes are enabled

We plan to switch from write-only to read-write in a running server
after doing a batch rebuild. For that to work, we need to assume that
changes that are being written consistently will stay up-to-date in
NoteDb.

Previously, auto-rebuilding only happened when reads were enabled;
after this change, it will happen when either reads or writes are
enabled.

Change-Id: I265ef862df84d81e6917400309193e0681dd56db
This commit is contained in:
Dave Borowitz
2016-05-05 16:56:58 -04:00
parent 31cee3af70
commit ce13052c53
3 changed files with 31 additions and 17 deletions

View File

@@ -52,7 +52,6 @@ public class DraftCommentNotes extends AbstractChangeNotes<DraftCommentNotes> {
private final Change change;
private final Account.Id author;
private final boolean autoRebuild;
private ImmutableListMultimap<RevId, PatchLineComment> comments;
private RevisionNoteMap revisionNoteMap;
@@ -70,10 +69,9 @@ public class DraftCommentNotes extends AbstractChangeNotes<DraftCommentNotes> {
Args args,
@Assisted Change.Id changeId,
@Assisted Account.Id author) {
super(args, changeId);
super(args, changeId, true);
this.change = null;
this.author = author;
this.autoRebuild = true;
}
DraftCommentNotes(
@@ -81,10 +79,9 @@ public class DraftCommentNotes extends AbstractChangeNotes<DraftCommentNotes> {
Change change,
Account.Id author,
boolean autoRebuild) {
super(args, change.getId());
super(args, change.getId(), autoRebuild);
this.change = change;
this.author = author;
this.autoRebuild = autoRebuild;
}
RevisionNoteMap getRevisionNoteMap() {