Merge branch 'stable-2.15' into stable-2.16

* stable-2.15:
  Bazel: Add fixes for --incompatible_load_{java|python}_rules_from_bzl
  Bazel: Bump minimum supported version to 0.29.0
  Lucene index configuration and docs.

Change-Id: I6c597cbc89fafece83c374e9b36c4c4c0126704f
This commit is contained in:
David Pursehouse 2019-09-04 15:02:32 +09:00
commit 31c82401f0
130 changed files with 312 additions and 17 deletions

View File

@ -1,2 +1,2 @@
0.26.1
0.29.0

View File

@ -3005,6 +3005,46 @@ to disk when the process finishes.
+
Defaults to 300000 ms (5 minutes).
[[index.name.maxMergeCount]]index.name.maxMergeCount::
+
Determines the max number of simultaneous merges that are allowed. If a merge
is necessary yet we already have this many threads running, the incoming thread
(that is calling add/updateDocument) will block until a merge thread has
completed. Note that Lucene will only run the smallest maxThreadCount merges
at a time. See the
link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#setDefaultMaxMergesAndThreads(boolean)[
Lucene documentation] for further details.
+
Defaults to -1 for (auto detection).
[[index.name.maxThreadCount]]index.name.maxThreadCount::
+
Determines the max number of simultaneous Lucene merge threads that should be running at
once. This must be less than or equal to maxMergeCount. See the
link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#setDefaultMaxMergesAndThreads(boolean)[
Lucene documentation] for further details.
+
For further details on Lucene index configuration (auto detection) which
affects maxThreadCount and maxMergeCount settings.
See the
link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#AUTO_DETECT_MERGES_AND_THREADS[
Lucene documentation]
+
Defaults to -1 for (auto detection).
[[index.name.enableAutoIOThrottle]]index.name.enableAutoIOThrottle::
+
Allows the control of whether automatic IO throttling is enabled and used by
default in the lucene merge queue. Automatic dynamic IO throttling, which when
on is used to adaptively rate limit writes bytes/sec to the minimal rate necessary
so merges do not fall behind. See the
link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#enableAutoIOThrottle()[
Lucene documentation] for further details.
+
Defaults to true (throttling enabled).
Sample Lucene index configuration:
----
[index]
@ -3013,10 +3053,17 @@ Sample Lucene index configuration:
[index "changes_open"]
ramBufferSize = 60 m
maxBufferedDocs = 3000
maxThreadCount = 5
maxMergeCount = 50
[index "changes_closed"]
ramBufferSize = 20 m
maxBufferedDocs = 500
maxThreadCount = 10
maxMergeCount = 100
enableIOThrottle = false
----
[[elasticsearch]]

View File

@ -67,7 +67,19 @@ http_file(
load("@bazel_skylib//lib:versions.bzl", "versions")
versions.check(minimum_bazel_version = "0.26.1")
versions.check(minimum_bazel_version = "0.29.0")
# Rules Python
http_archive(
name = "rules_python",
sha256 = "b5bab4c47e863e0fbb77df4a40c45ca85f98f5a2826939181585644c9f31b97b",
strip_prefix = "rules_python-9d68f24659e8ce8b736590ba1e4418af06ec2552",
urls = ["https://github.com/bazelbuild/rules_python/archive/9d68f24659e8ce8b736590ba1e4418af06ec2552.tar.gz"],
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_repositories")

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//tools/bzl:genrule2.bzl", "genrule2")
genrule2(

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "gwtdebug",
srcs = glob(["src/main/java/**/*.java"]),

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//tools/bzl:gwt.bzl", "gwt_module")
load("//tools/bzl:java.bzl", "java_library2")
load("//tools/bzl:junit.bzl", "junit_tests")

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_binary")
load("//tools/bzl:java.bzl", "java_library2")
load("//tools/bzl:javadoc.bzl", "java_doc")

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_binary", "java_library")
java_binary(
name = "gerrit-main-class",
main_class = "Main",

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_binary", "java_library")
load("//tools/bzl:java.bzl", "java_library2")
load("//tools/bzl:javadoc.bzl", "java_doc")

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_binary", "java_library")
java_binary(
name = "asciidoc",
main_class = "com.google.gerrit.asciidoctor.AsciiDoctor",

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//tools/bzl:gwt.bzl", "gwt_module")
ANNOTATIONS = [

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "common-data-test-util",
testonly = True,

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "elasticsearch",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_binary", "java_library")
load("//lib/jgit:jgit.bzl", "JGIT_DOC_URL")
load("//lib:guava.bzl", "GUAVA_DOC_URL")
load("//tools/bzl:gwt.bzl", "gwt_module")

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "common-test-util",
testonly = True,

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "restapi-test-util",
testonly = True,

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
package(default_testonly = True)
java_library(

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "gpg",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "gpg-test-util",
testonly = True,

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "httpd",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "oauth",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "openid",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "init",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
QUERY_PARSE_EXCEPTION_SRCS = [
"query/QueryParseException.java",
"query/QueryRequiresAuthException.java",

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "project",
srcs = glob(["*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
# NOTE: GerritLauncher must be a single, self-contained class. Do not add any
# additional srcs or deps to this rule.
java_library(

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "lifecycle",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
QUERY_BUILDER = ["QueryBuilder.java"]
java_library(

View File

@ -21,6 +21,7 @@ import com.google.common.collect.ImmutableMap;
import com.google.gerrit.server.config.ConfigUtil;
import org.apache.lucene.analysis.CharArraySet;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.index.ConcurrentMergeScheduler;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
import org.eclipse.jgit.lib.Config;
@ -42,6 +43,21 @@ class GerritIndexWriterConfig {
new IndexWriterConfig(analyzer)
.setOpenMode(OpenMode.CREATE_OR_APPEND)
.setCommitOnClose(true);
int maxMergeCount = cfg.getInt("index", name, "maxMergeCount", -1);
int maxThreadCount = cfg.getInt("index", name, "maxThreadCount", -1);
boolean enableAutoIOThrottle = cfg.getBoolean("index", name, "enableAutoIOThrottle", true);
if (maxMergeCount != -1 || maxThreadCount != -1 || !enableAutoIOThrottle) {
ConcurrentMergeScheduler mergeScheduler = new ConcurrentMergeScheduler();
if (maxMergeCount != -1 || maxThreadCount != -1) {
mergeScheduler.setMaxMergesAndThreads(maxMergeCount, maxThreadCount);
}
if (!enableAutoIOThrottle) {
mergeScheduler.disableAutoIOThrottle();
}
luceneConfig.setMergeScheduler(mergeScheduler);
}
double m = 1 << 20;
luceneConfig.setRAMBufferSizeMB(
cfg.getLong(

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "mail",
srcs = glob(["*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "metrics",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "dropwizard",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
# TODO(davido): This indirection doesn't avoid unwanted depdencies
# in acceptance-framework and should be removed. Instead, provided_deps
# should be used, once https://github.com/bazelbuild/bazel/issues/1402

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "http",
visibility = ["//visibility:public"],

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "jetty",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "init",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "api",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "util",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//tools/bzl:gwt.bzl", "gwt_module")
gwt_module(

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_binary")
java_binary(
name = "ProtoGen",
srcs = ["ProtoGen.java"],

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//tools/bzl:gwt.bzl", "gwt_module")
package(

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//tools/bzl:javadoc.bzl", "java_doc")
CONSTANTS_SRC = [

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "api",
srcs = glob(

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "audit",
srcs = glob(

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "h2",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "mem",
srcs = glob(["*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "serialize",
srcs = glob(["*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
package(default_testonly = True)
java_library(

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "receive",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
package(default_visibility = ["//visibility:public"])
java_library(

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
package(default_visibility = ["//visibility:public"])
java_library(

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "ioutil",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "logging",
srcs = glob(

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "project-test-util",
testonly = True,

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
package(
default_visibility = ["//visibility:public"],
)

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "schema",
srcs = glob(

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "git",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "time",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "sshd",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "gerrit-test-util",
testonly = True,

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "truth",
testonly = True,

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "cli",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "http",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "ssl",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "css",
srcs = glob(["rebind/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "prolog-predicates",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "net",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//tools/bzl:genrule2.bzl", "genrule2")
load("//tools/bzl:gwt.bzl", "gwt_module")

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//javatests/com/google/gerrit/acceptance:tests.bzl", "acceptance_tests")
acceptance_tests(

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//javatests/com/google/gerrit/acceptance:tests.bzl", "acceptance_tests")
[acceptance_tests(

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//javatests/com/google/gerrit/acceptance:tests.bzl", "acceptance_tests")
acceptance_tests(

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//javatests/com/google/gerrit/acceptance:tests.bzl", "acceptance_tests")
acceptance_tests(

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//javatests/com/google/gerrit/acceptance:tests.bzl", "acceptance_tests")
acceptance_tests(

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//javatests/com/google/gerrit/acceptance:tests.bzl", "acceptance_tests")
SUBMIT_UTIL_SRCS = glob(["AbstractSubmit*.java"])

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//javatests/com/google/gerrit/acceptance:tests.bzl", "acceptance_tests")
acceptance_tests(

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//javatests/com/google/gerrit/acceptance:tests.bzl", "acceptance_tests")
DEPS = [

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//javatests/com/google/gerrit/acceptance:tests.bzl", "acceptance_tests")
java_library(

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//tools/bzl:junit.bzl", "junit_tests")
java_library(

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//tools/bzl:junit.bzl", "junit_tests")
CUSTOM_TRUTH_SUBJECTS = glob([

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//tools/bzl:junit.bzl", "junit_tests")
ABSTRACT_QUERY_TEST = ["AbstractQueryAccountsTest.java"]

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//tools/bzl:junit.bzl", "junit_tests")
ABSTRACT_QUERY_TEST = ["AbstractQueryChangesTest.java"]

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//tools/bzl:junit.bzl", "junit_tests")
ABSTRACT_QUERY_TEST = ["AbstractQueryGroupsTest.java"]

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//tools/bzl:junit.bzl", "junit_tests")
ABSTRACT_QUERY_TEST = ["AbstractQueryProjectsTest.java"]

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "testutil",
testonly = True,

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_test")
java_test(
name = "jgit_patch_tests",
srcs = glob(["**/*.java"]),

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
exports_files(glob([
"LICENSE-*",
]))

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_binary", "java_library")
package(default_visibility = ["//java/com/google/gerrit/index:__pkg__"])
[java_library(

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "asciidoctor",
data = ["//lib:LICENSE-asciidoctor"],

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library", "java_plugin")
java_plugin(
name = "auto-annotation-plugin",
processor_class = "com.google.auto.value.processor.AutoAnnotationProcessor",

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "bcprov",
data = ["//lib:LICENSE-bouncycastle"],

View File

@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_import", "java_library")
load("//lib/codemirror:cm.bzl", "pkg_cm")
# This library is only used to insert a license statement into
@ -9,3 +10,17 @@ java_library(
)
pkg_cm()
LICENSE = "//lib:LICENSE-codemirror-original"
LICENSE_MINIFIED = "//lib:LICENSE-codemirror-minified"
[java_import(
name = "codemirror" + suffix,
data = [license],
jars = [":jar%s" % suffix],
visibility = ["//visibility:public"],
) for suffix, license in [
("", LICENSE),
("_r", LICENSE_MINIFIED),
]]

View File

@ -366,10 +366,3 @@ def pkg_cm():
],
outs = ["codemirror%s.jar" % suffix],
)
native.java_import(
name = "codemirror" + suffix,
jars = [":jar%s" % suffix],
visibility = ["//visibility:public"],
data = [license],
)

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
package(default_visibility = ["//visibility:public"])
java_library(

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "dropwizard-core",
data = ["//lib:LICENSE-Apache2.0"],

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "easymock",
data = ["//lib:LICENSE-DO_NOT_DISTRIBUTE"],

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
package(default_visibility = ["//visibility:public"])
java_library(

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "api",
data = ["//lib:LICENSE-Apache2.0"],

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
package(default_visibility = ["//visibility:public"])
POST_JDK8_DEPS = [":javax-activation"]

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "guice",
data = ["//lib:LICENSE-Apache2.0"],

View File

@ -1,3 +1,5 @@
load("@rules_java//java:defs.bzl", "java_library")
[java_library(
name = n,
data = ["//lib:LICENSE-Apache2.0"],

Some files were not shown because too many files have changed in this diff Show More