Factor out batch indexing logic into a ChangeBatchIndexer
Change-Id: Ief166fadc61f76a5f4ffdb879322e9883040bdd6
This commit is contained in:
@@ -245,11 +245,10 @@ public class LuceneChangeIndex implements ChangeIndex {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markReady() throws IOException {
|
||||
public void markReady(boolean ready) throws IOException {
|
||||
try {
|
||||
FileBasedConfig cfg = LuceneVersionManager.loadGerritIndexConfig(sitePaths);
|
||||
cfg.setBoolean("index", Integer.toString(schema.getVersion()), "ready",
|
||||
true);
|
||||
LuceneVersionManager.setReady(cfg, schema.getVersion(), ready);
|
||||
cfg.save();
|
||||
} catch (ConfigInvalidException e) {
|
||||
throw new IOException(e);
|
||||
|
||||
@@ -78,12 +78,12 @@ class LuceneVersionManager implements LifecycleListener {
|
||||
return cfg;
|
||||
}
|
||||
|
||||
private static boolean getReady(Config cfg, int version) {
|
||||
return cfg.getBoolean("index", Integer.toString(version), "ready", false);
|
||||
static void setReady(Config cfg, int version, boolean ready) {
|
||||
cfg.setBoolean("index", Integer.toString(version), "ready", ready);
|
||||
}
|
||||
|
||||
private static void setReady(Config cfg, int version, boolean ready) {
|
||||
cfg.setBoolean("index", Integer.toString(version), "ready", ready);
|
||||
private static boolean getReady(Config cfg, int version) {
|
||||
return cfg.getBoolean("index", Integer.toString(version), "ready", false);
|
||||
}
|
||||
|
||||
private final SitePaths sitePaths;
|
||||
|
||||
Reference in New Issue
Block a user