
Supported versions are encapsulated in a new enum, ElasticVersion, that provides a method to translate from the version string returned by the Elasticsearch server. Translation of the version works on prefix matching, with granularity at the X.Y level. For example the version strings "2.4.0" and "2.4.6" will both resolve to the V2_4 enum value. This assumes that Elasticsearch has backwards compatibility between all minor versions in the X.Y series, i.e. "2.4.0" and "2.4.6" should both be equally compatible. If this turns out to not be the case, further support can be added later. ElasticVersionManager is renamed to ElasticIndexVersionManager to avoid confusion with the ElasticVersion enum. Change-Id: I4dfe443f0e5d26652433334cef6be8c2727e9317
72 lines
1.9 KiB
Python
72 lines
1.9 KiB
Python
java_library(
|
|
name = "elasticsearch",
|
|
srcs = glob(
|
|
["src/main/java/**/*.java"],
|
|
exclude = ["**/testing/**"],
|
|
),
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//gerrit-antlr:query_exception",
|
|
"//gerrit-extension-api:api",
|
|
"//gerrit-reviewdb:server",
|
|
"//gerrit-server:server",
|
|
"//lib:gson",
|
|
"//lib:guava",
|
|
"//lib:gwtorm",
|
|
"//lib/commons:codec",
|
|
"//lib/elasticsearch-rest-client",
|
|
"//lib/guice",
|
|
"//lib/guice:guice-assistedinject",
|
|
"//lib/httpcomponents:httpasyncclient",
|
|
"//lib/httpcomponents:httpclient",
|
|
"//lib/httpcomponents:httpcore",
|
|
"//lib/httpcomponents:httpcore-nio",
|
|
"//lib/jackson:jackson-core",
|
|
"//lib/jgit/org.eclipse.jgit:jgit",
|
|
"//lib/log:api",
|
|
],
|
|
)
|
|
|
|
load("//tools/bzl:junit.bzl", "junit_tests")
|
|
|
|
java_library(
|
|
name = "elasticsearch_test_utils",
|
|
testonly = 1,
|
|
srcs = glob(["src/main/java/com/google/gerrit/elasticsearch/testing/*.java"]),
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":elasticsearch",
|
|
"//gerrit-reviewdb:client",
|
|
"//gerrit-server:server",
|
|
"//lib:gson",
|
|
"//lib:truth",
|
|
"//lib/guice",
|
|
"//lib/httpcomponents:httpcore",
|
|
"//lib/jgit/org.eclipse.jgit:jgit",
|
|
"//lib/testcontainers",
|
|
],
|
|
)
|
|
|
|
junit_tests(
|
|
name = "elasticsearch_tests",
|
|
size = "large",
|
|
srcs = glob(["src/test/java/**/*Test.java"]),
|
|
tags = [
|
|
"docker",
|
|
"elastic",
|
|
],
|
|
deps = [
|
|
":elasticsearch",
|
|
":elasticsearch_test_utils",
|
|
"//gerrit-server:query_tests_code",
|
|
"//gerrit-server:server",
|
|
"//gerrit-server:testutil",
|
|
"//lib:truth",
|
|
"//lib/guice",
|
|
"//lib/httpcomponents:httpcore",
|
|
"//lib/jgit/org.eclipse.jgit:jgit",
|
|
"//lib/jgit/org.eclipse.jgit.junit:junit",
|
|
"//lib/testcontainers",
|
|
],
|
|
)
|