Merge branch 'stable-2.16'
* stable-2.16: Set version to 2.16.1-SNAPSHOT Set version to 2.15.8-SNAPSHOT ElasticTestUtils: Factor common code out of ElasticReindexIT/ElasticIndexIT Add support for Elasticsearch 6.5.0 Add Marco Miller as a developer in pom.xml files Fix: Invalid operation for forward only resultset : first Set version to 2.16 Set version to 2.14.17 Change-Id: I8065c31911125fa414452f75fc83290f80cd705e
This commit is contained in:
@@ -1016,8 +1016,8 @@ maven_jar(
|
||||
# and httpasyncclient as necessary.
|
||||
maven_jar(
|
||||
name = "elasticsearch-rest-client",
|
||||
artifact = "org.elasticsearch.client:elasticsearch-rest-client:6.4.3",
|
||||
sha1 = "5c24325430971ba2fa4769eb446f026b7680d5e7",
|
||||
artifact = "org.elasticsearch.client:elasticsearch-rest-client:6.5.0",
|
||||
sha1 = "241436d27cf65b84d17126dc7b6b947e8e2c173c",
|
||||
)
|
||||
|
||||
JACKSON_VERSION = "2.9.7"
|
||||
|
@@ -40,6 +40,7 @@ public class ElasticQueryAdapter {
|
||||
case V6_2:
|
||||
case V6_3:
|
||||
case V6_4:
|
||||
case V6_5:
|
||||
this.searchFilteringName = "_source";
|
||||
this.indicesExistParam = "?allow_no_indices=false";
|
||||
this.exactFieldType = "keyword";
|
||||
|
@@ -22,7 +22,8 @@ public enum ElasticVersion {
|
||||
V5_6("5.6.*"),
|
||||
V6_2("6.2.*"),
|
||||
V6_3("6.3.*"),
|
||||
V6_4("6.4.*");
|
||||
V6_4("6.4.*"),
|
||||
V6_5("6.5.*");
|
||||
|
||||
private final String version;
|
||||
private final Pattern pattern;
|
||||
|
@@ -60,7 +60,7 @@ public class Schema_151 extends ReviewDbSchemaVersion {
|
||||
PreparedStatement addedOnRetrieval, AccountGroup.Id groupId) throws SQLException {
|
||||
addedOnRetrieval.setInt(1, groupId.get());
|
||||
try (ResultSet resultSet = addedOnRetrieval.executeQuery()) {
|
||||
if (resultSet.first()) {
|
||||
if (resultSet.next()) {
|
||||
return Optional.of(resultSet.getTimestamp(1));
|
||||
}
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ public class Schema_87 extends ReviewDbSchemaVersion {
|
||||
PreparedStatement uuidRetrieval, AccountGroup.Id id) throws SQLException {
|
||||
uuidRetrieval.setInt(1, id.get());
|
||||
try (ResultSet uuidResults = uuidRetrieval.executeQuery()) {
|
||||
if (uuidResults.first()) {
|
||||
if (uuidResults.next()) {
|
||||
Optional.of(new AccountGroup.UUID(uuidResults.getString(1)));
|
||||
}
|
||||
}
|
||||
|
@@ -14,28 +14,17 @@
|
||||
|
||||
package com.google.gerrit.acceptance.pgm;
|
||||
|
||||
import com.google.gerrit.elasticsearch.ElasticContainer;
|
||||
import com.google.gerrit.elasticsearch.ElasticTestUtils;
|
||||
import com.google.gerrit.elasticsearch.ElasticTestUtils.ElasticNodeInfo;
|
||||
import static com.google.gerrit.elasticsearch.ElasticTestUtils.createAllIndexes;
|
||||
import static com.google.gerrit.elasticsearch.ElasticTestUtils.getConfig;
|
||||
|
||||
import com.google.gerrit.elasticsearch.ElasticVersion;
|
||||
import com.google.gerrit.testing.ConfigSuite;
|
||||
import com.google.inject.Injector;
|
||||
import java.util.UUID;
|
||||
import org.eclipse.jgit.lib.Config;
|
||||
import org.junit.Before;
|
||||
|
||||
public class ElasticReindexIT extends AbstractReindexTests {
|
||||
|
||||
private static Config getConfig(ElasticVersion version) {
|
||||
ElasticNodeInfo elasticNodeInfo;
|
||||
ElasticContainer<?> container = ElasticContainer.createAndStart(version);
|
||||
elasticNodeInfo = new ElasticNodeInfo(container.getHttpHost().getPort());
|
||||
String indicesPrefix = UUID.randomUUID().toString();
|
||||
Config cfg = new Config();
|
||||
ElasticTestUtils.configure(cfg, elasticNodeInfo.port, indicesPrefix, version);
|
||||
return cfg;
|
||||
}
|
||||
|
||||
@ConfigSuite.Default
|
||||
public static Config elasticsearchV2() {
|
||||
return getConfig(ElasticVersion.V2_4);
|
||||
@@ -48,12 +37,12 @@ public class ElasticReindexIT extends AbstractReindexTests {
|
||||
|
||||
@ConfigSuite.Config
|
||||
public static Config elasticsearchV6() {
|
||||
return getConfig(ElasticVersion.V6_4);
|
||||
return getConfig(ElasticVersion.V6_5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureIndex(Injector injector) throws Exception {
|
||||
ElasticTestUtils.createAllIndexes(injector);
|
||||
createAllIndexes(injector);
|
||||
}
|
||||
|
||||
@Before
|
||||
|
@@ -14,27 +14,16 @@
|
||||
|
||||
package com.google.gerrit.acceptance.ssh;
|
||||
|
||||
import com.google.gerrit.elasticsearch.ElasticContainer;
|
||||
import com.google.gerrit.elasticsearch.ElasticTestUtils;
|
||||
import com.google.gerrit.elasticsearch.ElasticTestUtils.ElasticNodeInfo;
|
||||
import static com.google.gerrit.elasticsearch.ElasticTestUtils.createAllIndexes;
|
||||
import static com.google.gerrit.elasticsearch.ElasticTestUtils.getConfig;
|
||||
|
||||
import com.google.gerrit.elasticsearch.ElasticVersion;
|
||||
import com.google.gerrit.testing.ConfigSuite;
|
||||
import com.google.inject.Injector;
|
||||
import java.util.UUID;
|
||||
import org.eclipse.jgit.lib.Config;
|
||||
|
||||
public class ElasticIndexIT extends AbstractIndexTests {
|
||||
|
||||
private static Config getConfig(ElasticVersion version) {
|
||||
ElasticNodeInfo elasticNodeInfo;
|
||||
ElasticContainer<?> container = ElasticContainer.createAndStart(version);
|
||||
elasticNodeInfo = new ElasticNodeInfo(container.getHttpHost().getPort());
|
||||
String indicesPrefix = UUID.randomUUID().toString();
|
||||
Config cfg = new Config();
|
||||
ElasticTestUtils.configure(cfg, elasticNodeInfo.port, indicesPrefix, version);
|
||||
return cfg;
|
||||
}
|
||||
|
||||
@ConfigSuite.Default
|
||||
public static Config elasticsearchV2() {
|
||||
return getConfig(ElasticVersion.V2_4);
|
||||
@@ -47,11 +36,11 @@ public class ElasticIndexIT extends AbstractIndexTests {
|
||||
|
||||
@ConfigSuite.Config
|
||||
public static Config elasticsearchV6() {
|
||||
return getConfig(ElasticVersion.V6_4);
|
||||
return getConfig(ElasticVersion.V6_5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureIndex(Injector injector) throws Exception {
|
||||
ElasticTestUtils.createAllIndexes(injector);
|
||||
createAllIndexes(injector);
|
||||
}
|
||||
}
|
||||
|
@@ -52,6 +52,8 @@ public class ElasticContainer<SELF extends ElasticContainer<SELF>> extends Gener
|
||||
return "docker.elastic.co/elasticsearch/elasticsearch-oss:6.3.2";
|
||||
case V6_4:
|
||||
return "docker.elastic.co/elasticsearch/elasticsearch-oss:6.4.3";
|
||||
case V6_5:
|
||||
return "docker.elastic.co/elasticsearch/elasticsearch-oss:6.5.0";
|
||||
}
|
||||
throw new IllegalStateException("No tests for version: " + version.name());
|
||||
}
|
||||
|
@@ -21,6 +21,7 @@ import com.google.inject.Key;
|
||||
import com.google.inject.TypeLiteral;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.UUID;
|
||||
import org.eclipse.jgit.lib.Config;
|
||||
|
||||
public final class ElasticTestUtils {
|
||||
@@ -55,6 +56,16 @@ public final class ElasticTestUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static Config getConfig(ElasticVersion version) {
|
||||
ElasticNodeInfo elasticNodeInfo;
|
||||
ElasticContainer<?> container = ElasticContainer.createAndStart(version);
|
||||
elasticNodeInfo = new ElasticNodeInfo(container.getHttpHost().getPort());
|
||||
String indicesPrefix = UUID.randomUUID().toString();
|
||||
Config cfg = new Config();
|
||||
configure(cfg, elasticNodeInfo.port, indicesPrefix, version);
|
||||
return cfg;
|
||||
}
|
||||
|
||||
private ElasticTestUtils() {
|
||||
// hide default constructor
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ public class ElasticV6QueryAccountsTest extends AbstractQueryAccountsTest {
|
||||
return;
|
||||
}
|
||||
|
||||
container = ElasticContainer.createAndStart(ElasticVersion.V6_4);
|
||||
container = ElasticContainer.createAndStart(ElasticVersion.V6_5);
|
||||
nodeInfo = new ElasticNodeInfo(container.getHttpHost().getPort());
|
||||
}
|
||||
|
||||
|
@@ -41,7 +41,7 @@ public class ElasticV6QueryChangesTest extends AbstractQueryChangesTest {
|
||||
return;
|
||||
}
|
||||
|
||||
container = ElasticContainer.createAndStart(ElasticVersion.V6_4);
|
||||
container = ElasticContainer.createAndStart(ElasticVersion.V6_5);
|
||||
nodeInfo = new ElasticNodeInfo(container.getHttpHost().getPort());
|
||||
}
|
||||
|
||||
|
@@ -41,7 +41,7 @@ public class ElasticV6QueryGroupsTest extends AbstractQueryGroupsTest {
|
||||
return;
|
||||
}
|
||||
|
||||
container = ElasticContainer.createAndStart(ElasticVersion.V6_4);
|
||||
container = ElasticContainer.createAndStart(ElasticVersion.V6_5);
|
||||
nodeInfo = new ElasticNodeInfo(container.getHttpHost().getPort());
|
||||
}
|
||||
|
||||
|
@@ -55,6 +55,9 @@
|
||||
<developer>
|
||||
<name>Luca Milanesio</name>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Marco Miller</name>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Martin Fick</name>
|
||||
</developer>
|
||||
|
@@ -55,6 +55,9 @@
|
||||
<developer>
|
||||
<name>Luca Milanesio</name>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Marco Miller</name>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Martin Fick</name>
|
||||
</developer>
|
||||
|
@@ -55,6 +55,9 @@
|
||||
<developer>
|
||||
<name>Luca Milanesio</name>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Marco Miller</name>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Martin Fick</name>
|
||||
</developer>
|
||||
|
@@ -55,6 +55,9 @@
|
||||
<developer>
|
||||
<name>Luca Milanesio</name>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Marco Miller</name>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Martin Fick</name>
|
||||
</developer>
|
||||
|
Reference in New Issue
Block a user