Skip to content

Commit

Permalink
Revert "Merge branch 'master' into compat/type-index-get"
Browse files Browse the repository at this point in the history
This reverts commit ae1799f, reversing
changes made to f00f438.
  • Loading branch information
pgomulka committed Mar 16, 2020
1 parent ae1799f commit a0fce89
Show file tree
Hide file tree
Showing 684 changed files with 6,014 additions and 20,435 deletions.
1 change: 1 addition & 0 deletions .ci/matrix-runtime-javas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

ES_RUNTIME_JAVA:
- java11
- openjdk13
- openjdk14
- openjdk15
- zulu11
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ IntelliJ or Eclipse like describe above to use
Elasticsearch typically uses singular nouns rather than plurals in URLs.
For example:

/_ingest/pipeline
/_ingest/pipeline/{id}
/_ingest/pipline
/_ingest/pipline/{id}

but not:

/_ingest/pipelines
/_ingest/pipelines/{id}
/_ingest/piplines
/_ingest/piplines/{id}

You may find counterexamples, but new endpoints should use the singular
form.
Expand Down
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ subprojects {
':qa:os',
':qa:wildfly',
':x-pack:plugin:autoscaling',
':x-pack:plugin:enrich',
':x-pack:plugin:logstash'
':x-pack:plugin:enrich'
]

if (projectPathsToFormat.contains(project.path)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,24 @@ private void setupRootDownload(Project rootProject, ElasticsearchDistribution di
}

private static void addIvyRepo(Project project, String name, String url, String group) {
IvyArtifactRepository ivyRepo = project.getRepositories().ivy(repo -> {
repo.setName(name);
repo.setUrl(url);
repo.metadataSources(IvyArtifactRepository.MetadataSources::artifact);
project.getRepositories().ivy(ivyRepo -> {
ivyRepo.setName(name);
ivyRepo.setUrl(url);
ivyRepo.metadataSources(IvyArtifactRepository.MetadataSources::artifact);
// this header is not a credential but we hack the capability to send this header to avoid polluting our download stats
repo.credentials(HttpHeaderCredentials.class, creds -> {
ivyRepo.credentials(HttpHeaderCredentials.class, creds -> {
creds.setName("X-Elastic-No-KPI");
creds.setValue("1");
});
repo.getAuthentication().create("header", HttpHeaderAuthentication.class);
repo.patternLayout(layout -> layout.artifact("/downloads/elasticsearch/[module]-[revision](-[classifier]).[ext]"));
ivyRepo.getAuthentication().create("header", HttpHeaderAuthentication.class);
ivyRepo.patternLayout(layout -> layout.artifact("/downloads/elasticsearch/[module]-[revision](-[classifier]).[ext]"));
ivyRepo.content(content -> content.includeGroup(group));
});
project.getRepositories().exclusiveContent(exclusiveContentRepository -> {
exclusiveContentRepository.filter(config -> config.includeGroup(group));
exclusiveContentRepository.forRepositories(ivyRepo);
project.getRepositories().all(repo -> {
if (repo.getName().equals(name) == false) {
// all other repos should ignore the special group name
repo.content(content -> content.excludeGroup(group));
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ public void apply(Project project) {
setupRootJdkDownload(project.getRootProject(), jdk);
}
});

// all other repos should ignore the special jdk artifacts
project.getRootProject().getRepositories().all(repo -> {
if (repo.getName().startsWith(REPO_NAME_PREFIX) == false) {
repo.content(content -> {
content.excludeGroup("adoptopenjdk");
content.excludeGroup("openjdk");
});
}
});
}

@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -135,16 +145,13 @@ private static void setupRootJdkDownload(Project rootProject, Jdk jdk) {
}

// Define the repository if we haven't already
if (repositories.findByName(repoName) == null) {
IvyArtifactRepository ivyRepo = repositories.ivy(repo -> {
repo.setName(repoName);
repo.setUrl(repoUrl);
repo.metadataSources(IvyArtifactRepository.MetadataSources::artifact);
repo.patternLayout(layout -> layout.artifact(artifactPattern));
});
repositories.exclusiveContent(exclusiveContentRepository -> {
exclusiveContentRepository.filter(config -> config.includeGroup(groupName(jdk)));
exclusiveContentRepository.forRepositories(ivyRepo);
if (rootProject.getRepositories().findByName(repoName) == null) {
repositories.ivy(ivyRepo -> {
ivyRepo.setName(repoName);
ivyRepo.setUrl(repoUrl);
ivyRepo.metadataSources(IvyArtifactRepository.MetadataSources::artifact);
ivyRepo.patternLayout(layout -> layout.artifact(artifactPattern));
ivyRepo.content(content -> content.includeGroup(jdk.getVendor()));
});
}

Expand Down Expand Up @@ -254,11 +261,7 @@ private static String dependencyNotation(Jdk jdk) {
: jdk.getPlatform();
String extension = jdk.getPlatform().equals("windows") ? "zip" : "tar.gz";

return groupName(jdk) + ":" + platformDep + ":" + jdk.getBaseVersion() + "@" + extension;
}

private static String groupName(Jdk jdk) {
return jdk.getVendor() + "_" + jdk.getMajor();
return jdk.getVendor() + ":" + platformDep + ":" + jdk.getBaseVersion() + "@" + extension;
}

private static String configName(String... parts) {
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/version.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
elasticsearch = 8.0.0
lucene = 8.5.0-snapshot-7f057455901
lucene = 8.5.0-snapshot-c4475920b08

bundled_jdk_vendor = adoptopenjdk
bundled_jdk = 13.0.2+8
Expand All @@ -11,7 +11,7 @@ jts = 1.15.0
# you should also inspect that version to see if it can be advanced along with
# the com.maxmind.geoip2:geoip2 dependency
jackson = 2.8.11
jacksondatabind = 2.8.11.6
jacksondatabind = 2.8.11.4
snakeyaml = 1.17
icu4j = 62.1
supercsv = 2.4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
import org.elasticsearch.common.xcontent.ObjectParser;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentParserUtils;
import org.elasticsearch.search.aggregations.ParsedAggregation;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -86,9 +88,9 @@ public static class TopMetrics implements ToXContent {
private static final ParseField METRICS_FIELD = new ParseField("metrics");

private final List<Object> sort;
private final Map<String, Object> metrics;
private final Map<String, Double> metrics;

private TopMetrics(List<Object> sort, Map<String, Object> metrics) {
private TopMetrics(List<Object> sort, Map<String, Double> metrics) {
this.sort = sort;
this.metrics = metrics;
}
Expand All @@ -103,7 +105,7 @@ public List<Object> getSort() {
/**
* The top metric values returned by the aggregation.
*/
public Map<String, Object> getMetrics() {
public Map<String, Double> getMetrics() {
return metrics;
}

Expand All @@ -112,13 +114,13 @@ public Map<String, Object> getMetrics() {
@SuppressWarnings("unchecked")
List<Object> sort = (List<Object>) args[0];
@SuppressWarnings("unchecked")
Map<String, Object> metrics = (Map<String, Object>) args[1];
Map<String, Double> metrics = (Map<String, Double>) args[1];
return new TopMetrics(sort, metrics);
});
static {
PARSER.declareFieldArray(constructorArg(), (p, c) -> XContentParserUtils.parseFieldsValue(p),
SORT_FIELD, ObjectParser.ValueType.VALUE_ARRAY);
PARSER.declareObject(constructorArg(), (p, c) -> p.map(), METRICS_FIELD);
PARSER.declareObject(constructorArg(), (p, c) -> p.map(HashMap::new, XContentParser::doubleValue), METRICS_FIELD);
}

public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

public class ProxyModeInfo implements RemoteConnectionInfo.ModeInfo {
static final String NAME = "proxy";
static final String PROXY_ADDRESS = "proxy_address";
static final String NUM_PROXY_SOCKETS_CONNECTED = "num_proxy_sockets_connected";
static final String MAX_PROXY_SOCKET_CONNECTIONS = "max_proxy_socket_connections";
static final String ADDRESS = "address";
static final String NUM_SOCKETS_CONNECTED = "num_sockets_connected";
static final String MAX_SOCKET_CONNECTIONS = "max_socket_connections";
private final String address;
private final int maxSocketConnections;
private final int numSocketsConnected;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ public final class RemoteConnectionInfo {
PARSER.declareString(constructorArg(), new ParseField(INITIAL_CONNECT_TIMEOUT));
PARSER.declareBoolean(constructorArg(), new ParseField(SKIP_UNAVAILABLE));

PARSER.declareString(optionalConstructorArg(), new ParseField(ProxyModeInfo.PROXY_ADDRESS));
PARSER.declareInt(optionalConstructorArg(), new ParseField(ProxyModeInfo.MAX_PROXY_SOCKET_CONNECTIONS));
PARSER.declareInt(optionalConstructorArg(), new ParseField(ProxyModeInfo.NUM_PROXY_SOCKETS_CONNECTED));
PARSER.declareString(optionalConstructorArg(), new ParseField(ProxyModeInfo.ADDRESS));
PARSER.declareInt(optionalConstructorArg(), new ParseField(ProxyModeInfo.MAX_SOCKET_CONNECTIONS));
PARSER.declareInt(optionalConstructorArg(), new ParseField(ProxyModeInfo.NUM_SOCKETS_CONNECTED));

PARSER.declareStringArray(optionalConstructorArg(), new ParseField(SniffModeInfo.SEEDS));
PARSER.declareInt(optionalConstructorArg(), new ParseField(SniffModeInfo.MAX_CONNECTIONS_PER_CLUSTER));
Expand Down
Loading

0 comments on commit a0fce89

Please sign in to comment.