Skip to content

Commit

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

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/pipline
/_ingest/pipline/{id}
/_ingest/pipeline
/_ingest/pipeline/{id}

but not:

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

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

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

private static void addIvyRepo(Project project, String name, String url, String group) {
project.getRepositories().ivy(ivyRepo -> {
ivyRepo.setName(name);
ivyRepo.setUrl(url);
ivyRepo.metadataSources(IvyArtifactRepository.MetadataSources::artifact);
IvyArtifactRepository ivyRepo = project.getRepositories().ivy(repo -> {
repo.setName(name);
repo.setUrl(url);
repo.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
ivyRepo.credentials(HttpHeaderCredentials.class, creds -> {
repo.credentials(HttpHeaderCredentials.class, creds -> {
creds.setName("X-Elastic-No-KPI");
creds.setValue("1");
});
ivyRepo.getAuthentication().create("header", HttpHeaderAuthentication.class);
ivyRepo.patternLayout(layout -> layout.artifact("/downloads/elasticsearch/[module]-[revision](-[classifier]).[ext]"));
ivyRepo.content(content -> content.includeGroup(group));
repo.getAuthentication().create("header", HttpHeaderAuthentication.class);
repo.patternLayout(layout -> layout.artifact("/downloads/elasticsearch/[module]-[revision](-[classifier]).[ext]"));
});
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));
}
project.getRepositories().exclusiveContent(exclusiveContentRepository -> {
exclusiveContentRepository.filter(config -> config.includeGroup(group));
exclusiveContentRepository.forRepositories(ivyRepo);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,6 @@ 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 @@ -145,13 +135,16 @@ private static void setupRootJdkDownload(Project rootProject, Jdk jdk) {
}

// Define the repository if we haven't already
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()));
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);
});
}

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

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

private static String groupName(Jdk jdk) {
return jdk.getVendor() + "_" + jdk.getMajor();
}

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-c4475920b08
lucene = 8.5.0-snapshot-7f057455901

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.4
jacksondatabind = 2.8.11.6
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,12 +24,10 @@
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 @@ -88,9 +86,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, Double> metrics;
private final Map<String, Object> metrics;

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

Expand All @@ -114,13 +112,13 @@ public Map<String, Double> getMetrics() {
@SuppressWarnings("unchecked")
List<Object> sort = (List<Object>) args[0];
@SuppressWarnings("unchecked")
Map<String, Double> metrics = (Map<String, Double>) args[1];
Map<String, Object> metrics = (Map<String, Object>) 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(HashMap::new, XContentParser::doubleValue), METRICS_FIELD);
PARSER.declareObject(constructorArg(), (p, c) -> p.map(), 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 ADDRESS = "address";
static final String NUM_SOCKETS_CONNECTED = "num_sockets_connected";
static final String MAX_SOCKET_CONNECTIONS = "max_socket_connections";
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";
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.ADDRESS));
PARSER.declareInt(optionalConstructorArg(), new ParseField(ProxyModeInfo.MAX_SOCKET_CONNECTIONS));
PARSER.declareInt(optionalConstructorArg(), new ParseField(ProxyModeInfo.NUM_SOCKETS_CONNECTED));
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.declareStringArray(optionalConstructorArg(), new ParseField(SniffModeInfo.SEEDS));
PARSER.declareInt(optionalConstructorArg(), new ParseField(SniffModeInfo.MAX_CONNECTIONS_PER_CLUSTER));
Expand Down
Loading

0 comments on commit ae1799f

Please sign in to comment.