diff options
author | Kaushik Lingarkar <kaushikl@codeaurora.org> | 2022-11-23 09:55:45 -0800 |
---|---|---|
committer | Kaushik Lingarkar <kaushik.lingarkar@linaro.org> | 2022-11-23 09:57:51 -0800 |
commit | 020759fbebe157873ff6f63f3a80ec1907cc273f (patch) | |
tree | 57940dd5071bfc4974cc8680e1e3ce3f7b7ebbd0 | |
parent | 7d36ad58a3883f4c2baba14660d8a24d6c9473ff (diff) | |
parent | 65b09a66ae14eb2c2b43f01be8c1a45231657c80 (diff) |
Merge branch 'stable-3.2' into stable-3.3
* stable-3.2:
Disable printing cache stats by default on Init/Reindex
Release-Notes: skip
Change-Id: Ia8356e393bd8cd8601e4805a0a7106b7a047b593
-rw-r--r-- | Documentation/pgm-init.txt | 3 | ||||
-rw-r--r-- | Documentation/pgm-reindex.txt | 5 | ||||
-rw-r--r-- | java/com/google/gerrit/pgm/Init.java | 11 | ||||
-rw-r--r-- | java/com/google/gerrit/pgm/Reindex.java | 10 |
4 files changed, 16 insertions, 13 deletions
diff --git a/Documentation/pgm-init.txt b/Documentation/pgm-init.txt index f6c3c85d3e..9f5924864e 100644 --- a/Documentation/pgm-init.txt +++ b/Documentation/pgm-init.txt @@ -99,6 +99,9 @@ objects these SQL statements must be executed manually. The administrator must manually install the required library in the `lib/` folder. +--show-cache-stats:: + Show cache statistics at the end of program. + == CONTEXT This command can only be run on a server which has direct local access to the managed Git repositories. diff --git a/Documentation/pgm-reindex.txt b/Documentation/pgm-reindex.txt index 0653d8d87f..b74829dbde 100644 --- a/Documentation/pgm-reindex.txt +++ b/Documentation/pgm-reindex.txt @@ -36,9 +36,8 @@ Rebuilds the secondary index. Reindex only index with given name. This option can be supplied more than once to reindex multiple indices. ---disable-cache-stats:: - Disables printing cache statistics at the end of program to reduce - noise. Defaulted when reindex is run from init on a new site. +--show-cache-stats:: + Show cache statistics at the end of program. == CONTEXT The secondary index must be enabled. See diff --git a/java/com/google/gerrit/pgm/Init.java b/java/com/google/gerrit/pgm/Init.java index 19d19d4b98..0deb1958a5 100644 --- a/java/com/google/gerrit/pgm/Init.java +++ b/java/com/google/gerrit/pgm/Init.java @@ -92,6 +92,9 @@ public class Init extends BaseInit { @Option(name = "--skip-download", usage = "Don't download given library") private List<String> skippedDownloads; + @Option(name = "--show-cache-stats", usage = "Show cache statistics at the end") + private boolean showCacheStats; + @Inject Browser browser; private GerritIndexStatus indexStatus; @@ -164,7 +167,7 @@ public class Init extends BaseInit { indicesToReindex.add(schemaDef.getName()); } } - reindex(indicesToReindex, run.flags.isNew); + reindex(indicesToReindex); } start(run); } @@ -277,7 +280,7 @@ public class Init extends BaseInit { } } - private void reindex(List<String> indices, boolean isNewSite) throws Exception { + private void reindex(List<String> indices) throws Exception { if (indices.isEmpty()) { return; } @@ -288,8 +291,8 @@ public class Init extends BaseInit { reindexArgs.add("--index"); reindexArgs.add(index); } - if (isNewSite) { - reindexArgs.add("--disable-cache-stats"); + if (showCacheStats) { + reindexArgs.add("--show-cache-stats"); } getConsoleUI() diff --git a/java/com/google/gerrit/pgm/Reindex.java b/java/com/google/gerrit/pgm/Reindex.java index 701c94b352..03f66ebefc 100644 --- a/java/com/google/gerrit/pgm/Reindex.java +++ b/java/com/google/gerrit/pgm/Reindex.java @@ -84,11 +84,9 @@ public class Reindex extends SiteProgram { private List<String> indices = new ArrayList<>(); @Option( - name = "--disable-cache-stats", - usage = - "Disables printing the cache statistics." - + "Defaults to true when reindex is run from init on a new site, false otherwise") - private boolean disableCacheStats; + name = "--show-cache-stats", + usage = "Show cache statistics at the end.") + private boolean showCacheStats; private Injector dbInjector; private Injector sysInjector; @@ -120,7 +118,7 @@ public class Reindex extends SiteProgram { try { boolean ok = list ? list() : reindex(); - if (!disableCacheStats) { + if (showCacheStats) { printCacheStats(); } return ok ? 0 : 1; |