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
diff --git a/Documentation/pgm-init.txt b/Documentation/pgm-init.txt
index f6c3c85..9f592486 100644
--- a/Documentation/pgm-init.txt
+++ b/Documentation/pgm-init.txt
@@ -99,6 +99,9 @@
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 0653d8d..b74829d 100644
--- a/Documentation/pgm-reindex.txt
+++ b/Documentation/pgm-reindex.txt
@@ -36,9 +36,8 @@
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 4c7b47b..2a746b8 100644
--- a/java/com/google/gerrit/pgm/Init.java
+++ b/java/com/google/gerrit/pgm/Init.java
@@ -95,6 +95,9 @@
@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 @@
indicesToReindex.add(schemaDef.getName());
}
}
- reindex(indicesToReindex, run.flags.isNew);
+ reindex(indicesToReindex);
}
start(run);
}
@@ -280,7 +283,7 @@
}
}
- 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 @@
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 c4e185d..7ee799f 100644
--- a/java/com/google/gerrit/pgm/Reindex.java
+++ b/java/com/google/gerrit/pgm/Reindex.java
@@ -86,12 +86,8 @@
@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 @@
try {
boolean ok = list ? list() : reindex();
- if (!disableCacheStats) {
+ if (showCacheStats) {
printCacheStats();
}
return ok ? 0 : 1;