Create RebuildNoteDb to migrate data from ReviewDb to notedb

RebuildNotedb is responsible for the migration of pre-existing changes in
the ReviewDb to the notedb. It asynchronously rebuilds every change in
the ReviewDb and all of the related pieces of metadata that can be
stored in the notedb (i.e. PatchSets and PatchSetApprovals). As we add
the ability to store more data in the notedb, this can be updated to
migrate that data as well.

Change-Id: If0fb123630a08ef514611944e7bd0ab1d9e48f80
This commit is contained in:
Dave Borowitz
2014-05-12 13:52:23 -07:00
parent a2397154ef
commit 3f4a1748b2
4 changed files with 416 additions and 3 deletions

View File

@@ -14,7 +14,6 @@
package com.google.gerrit.server.notedb;
import com.google.common.annotations.VisibleForTesting;
import com.google.gerrit.server.config.GerritServerConfig;
import com.google.inject.Inject;
import com.google.inject.Singleton;
@@ -30,8 +29,7 @@ import org.eclipse.jgit.lib.Config;
*/
@Singleton
public class NotesMigration {
@VisibleForTesting
static NotesMigration allEnabled() {
public static NotesMigration allEnabled() {
Config cfg = new Config();
cfg.setBoolean("notedb", null, "write", true);
cfg.setBoolean("notedb", "patchSetApprovals", "read", true);