diff --git a/Documentation/pgm-reindex.txt b/Documentation/pgm-reindex.txt index e1d8e8b04d..a583d16b02 100644 --- a/Documentation/pgm-reindex.txt +++ b/Documentation/pgm-reindex.txt @@ -18,9 +18,6 @@ Rebuilds the secondary index. --schema-version:: Schema version to reindex; default is most recent version. ---output:: - Prefix for output; path for local disk index, or prefix for remote index. - --verbose:: Output debug information for each change. diff --git a/gerrit-acceptance-framework/src/test/java/com/google/gerrit/acceptance/GerritServer.java b/gerrit-acceptance-framework/src/test/java/com/google/gerrit/acceptance/GerritServer.java index 74cea20132..6622286b7a 100644 --- a/gerrit-acceptance-framework/src/test/java/com/google/gerrit/acceptance/GerritServer.java +++ b/gerrit-acceptance-framework/src/test/java/com/google/gerrit/acceptance/GerritServer.java @@ -143,7 +143,7 @@ public class GerritServer { cfg.setString("gitweb", null, "cgi", ""); daemon.setEnableHttpd(desc.httpd()); daemon.setLuceneModule(new LuceneIndexModule( - ChangeSchemas.getLatest().getVersion(), 0, null)); + ChangeSchemas.getLatest().getVersion(), 0)); daemon.setDatabaseForTesting(ImmutableList.of( new InMemoryTestingDatabaseModule(cfg))); daemon.start(); diff --git a/gerrit-lucene/src/main/java/com/google/gerrit/lucene/LuceneChangeIndex.java b/gerrit-lucene/src/main/java/com/google/gerrit/lucene/LuceneChangeIndex.java index 93d7a510c8..5178b8fc14 100644 --- a/gerrit-lucene/src/main/java/com/google/gerrit/lucene/LuceneChangeIndex.java +++ b/gerrit-lucene/src/main/java/com/google/gerrit/lucene/LuceneChangeIndex.java @@ -32,7 +32,6 @@ import com.google.common.collect.Sets; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; -import com.google.gerrit.common.Nullable; import com.google.gerrit.reviewdb.client.Account; import com.google.gerrit.reviewdb.client.Change; import com.google.gerrit.reviewdb.client.PatchSet; @@ -101,7 +100,6 @@ import org.slf4j.LoggerFactory; import java.io.IOException; import java.nio.file.Path; -import java.nio.file.Paths; import java.sql.Timestamp; import java.util.ArrayList; import java.util.Collections; @@ -159,7 +157,7 @@ public class LuceneChangeIndex implements ChangeIndex { } static interface Factory { - LuceneChangeIndex create(Schema schema, String base); + LuceneChangeIndex create(Schema schema); } static class GerritIndexWriterConfig { @@ -216,8 +214,7 @@ public class LuceneChangeIndex implements ChangeIndex { Provider db, ChangeData.Factory changeDataFactory, FillArgs fillArgs, - @Assisted Schema schema, - @Assisted @Nullable String base) throws IOException { + @Assisted Schema schema) throws IOException { this.sitePaths = sitePaths; this.fillArgs = fillArgs; this.executor = executor; @@ -245,8 +242,7 @@ public class LuceneChangeIndex implements ChangeIndex { closedIndex = new SubIndex(new RAMDirectory(), "ramClosed", closedConfig, searcherFactory); } else { - Path dir = base != null ? Paths.get(base) - : LuceneVersionManager.getDir(sitePaths, schema); + Path dir = LuceneVersionManager.getDir(sitePaths, schema); openIndex = new SubIndex(dir.resolve(CHANGES_OPEN), openConfig, searcherFactory); closedIndex = new SubIndex(dir.resolve(CHANGES_CLOSED), closedConfig, diff --git a/gerrit-lucene/src/main/java/com/google/gerrit/lucene/LuceneIndexModule.java b/gerrit-lucene/src/main/java/com/google/gerrit/lucene/LuceneIndexModule.java index 360053bce5..ea11535fe9 100644 --- a/gerrit-lucene/src/main/java/com/google/gerrit/lucene/LuceneIndexModule.java +++ b/gerrit-lucene/src/main/java/com/google/gerrit/lucene/LuceneIndexModule.java @@ -32,17 +32,14 @@ import org.eclipse.jgit.lib.Config; public class LuceneIndexModule extends LifecycleModule { private final Integer singleVersion; private final int threads; - private final String base; public LuceneIndexModule() { - this(null, 0, null); + this(null, 0); } - public LuceneIndexModule(Integer singleVersion, int threads, - String base) { + public LuceneIndexModule(Integer singleVersion, int threads) { this.singleVersion = singleVersion; this.threads = threads; - this.base = base; } @Override @@ -50,7 +47,7 @@ public class LuceneIndexModule extends LifecycleModule { factory(LuceneChangeIndex.Factory.class); factory(OnlineReindexer.Factory.class); install(new IndexModule(threads)); - if (singleVersion == null && base == null) { + if (singleVersion == null) { install(new MultiVersionModule()); } else { install(new SingleVersionModule()); @@ -82,7 +79,7 @@ public class LuceneIndexModule extends LifecycleModule { Schema schema = singleVersion != null ? ChangeSchemas.get(singleVersion) : ChangeSchemas.getLatest(); - return factory.create(schema, base); + return factory.create(schema); } } diff --git a/gerrit-lucene/src/main/java/com/google/gerrit/lucene/LuceneVersionManager.java b/gerrit-lucene/src/main/java/com/google/gerrit/lucene/LuceneVersionManager.java index d15f933734..801b0eaef1 100644 --- a/gerrit-lucene/src/main/java/com/google/gerrit/lucene/LuceneVersionManager.java +++ b/gerrit-lucene/src/main/java/com/google/gerrit/lucene/LuceneVersionManager.java @@ -157,12 +157,12 @@ public class LuceneVersionManager implements LifecycleListener { } markNotReady(cfg, versions.values(), write); - LuceneChangeIndex searchIndex = indexFactory.create(search.schema, null); + LuceneChangeIndex searchIndex = indexFactory.create(search.schema); indexes.setSearchIndex(searchIndex); for (Version v : write) { if (v.schema != null) { if (v.version != search.version) { - indexes.addWriteIndex(indexFactory.create(v.schema, null)); + indexes.addWriteIndex(indexFactory.create(v.schema)); } else { indexes.addWriteIndex(searchIndex); } diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Reindex.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Reindex.java index 30204600b2..06e6003c2f 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Reindex.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Reindex.java @@ -59,9 +59,6 @@ public class Reindex extends SiteProgram { usage = "Schema version to reindex; default is most recent version") private Integer version; - @Option(name = "--output", usage = "Prefix for output; path for local disk index, or prefix for remote index") - private String outputBase; - @Option(name = "--verbose", usage = "Output debug information for each change") private boolean verbose; @@ -127,7 +124,7 @@ public class Reindex extends SiteProgram { Module changeIndexModule; switch (IndexModule.getIndexType(dbInjector)) { case LUCENE: - changeIndexModule = new LuceneIndexModule(version, threads, outputBase); + changeIndexModule = new LuceneIndexModule(version, threads); break; default: throw new IllegalStateException("unsupported index.type"); diff --git a/gerrit-server/src/test/java/com/google/gerrit/testutil/InMemoryModule.java b/gerrit-server/src/test/java/com/google/gerrit/testutil/InMemoryModule.java index eda5562cc1..d4f098ec70 100644 --- a/gerrit-server/src/test/java/com/google/gerrit/testutil/InMemoryModule.java +++ b/gerrit-server/src/test/java/com/google/gerrit/testutil/InMemoryModule.java @@ -239,9 +239,8 @@ public class InMemoryModule extends FactoryModule { "invalid index.lucene.testVersion %s", version); Class clazz = Class.forName("com.google.gerrit.lucene.LuceneIndexModule"); - Constructor c = - clazz.getConstructor(Integer.class, int.class, String.class); - return (Module) c.newInstance(version, 0, null); + Constructor c = clazz.getConstructor(Integer.class, int.class); + return (Module) c.newInstance(version, 0); } catch (ClassNotFoundException | SecurityException | NoSuchMethodException | IllegalArgumentException | InstantiationException | IllegalAccessException | InvocationTargetException e) {