diff options
author | Kaushik Lingarkar <kaushik.lingarkar@linaro.org> | 2022-11-23 14:25:45 -0800 |
---|---|---|
committer | Kaushik Lingarkar <kaushik.lingarkar@linaro.org> | 2022-11-23 14:28:26 -0800 |
commit | 7b034ee217efd8e8fe11630548ac097cedbe08db (patch) | |
tree | b0da96085b9267dfb07a22f6f573d93e4d077c5b | |
parent | ded2248742abc4c406ce9a8315193615519368fd (diff) | |
parent | b8374f77a19e8e3271331d7e2ff75fcaf62796a2 (diff) |
Merge branch 'stable-3.4' into stable-3.5
* stable-3.4:
Disable printing cache stats by default on Init/Reindex
Remove eTag from RevisionResource, subject to experiment
Release-Notes: skip
Change-Id: Id414935c46b1e59b8586778b5ef8ac89ed508634
-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, 15 insertions, 14 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 4c7b47b866..2a746b8556 100644 --- a/java/com/google/gerrit/pgm/Init.java +++ b/java/com/google/gerrit/pgm/Init.java @@ -95,6 +95,9 @@ public class Init extends BaseInit { @Option(name = "--reindex-threads", usage = "Number of threads to use for reindex after init") private int reindexThreads = 1; + @Option(name = "--show-cache-stats", usage = "Show cache statistics at the end") + private boolean showCacheStats; + @Inject Browser browser; private GerritIndexStatus indexStatus; @@ -167,7 +170,7 @@ public class Init extends BaseInit { indicesToReindex.add(schemaDef.getName()); } } - reindex(indicesToReindex, run.flags.isNew); + reindex(indicesToReindex); } start(run); } @@ -280,7 +283,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; } @@ -291,8 +294,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 c4e185d856..7ee799f406 100644 --- a/java/com/google/gerrit/pgm/Reindex.java +++ b/java/com/google/gerrit/pgm/Reindex.java @@ -86,12 +86,8 @@ public class Reindex extends SiteProgram { @Option(name = "--index", usage = "Only reindex specified indices") 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; + @Option(name = "--show-cache-stats", usage = "Show cache statistics at the end.") + private boolean showCacheStats; private Injector dbInjector; private Injector sysInjector; @@ -123,7 +119,7 @@ public class Reindex extends SiteProgram { try { boolean ok = list ? list() : reindex(); - if (!disableCacheStats) { + if (showCacheStats) { printCacheStats(); } return ok ? 0 : 1; |