Skip to content

Commit

Permalink
Merge branch 'upstream/master' into improve-FilterPathBasedFilter-per…
Browse files Browse the repository at this point in the history
…formance

* upstream/master: (153 commits)
  [ML] update truncation default & adding field output when input is truncated (elastic#79942)
  [ML] stop using isAllowedByLicense for model license checks (elastic#79908)
  [ML] Retain built-in ML roles granting Kibana privileges (elastic#80014)
  [Transform] remove old mixed cluster BWC layers, not required for 8x (elastic#79927)
  Increase test timeout for CoordinatorTests testAllSearchesExecuted
  [Transform] add rolling upgrade tests for upgrade endpoint (elastic#79721)
  [ML] Update trained model docs for truncate parameter for bert tokenization (elastic#79652)
  `CoordinatorTests` sometimes needs three term bumps (elastic#79574)
  [ML] Account for service being triggered twice in tests (elastic#80000)
  SearchContext: remove unused variable (elastic#79917)
  Revert "Deprecate resolution loss on date field (elastic#78921)" (elastic#79914)
  Re-enable GeoIpDownloaderIT#testStartWithNoDatabases() (elastic#79907)
  Fix SnapshotBasedIndexRecoveryIT#testSeqNoBasedRecoveryIsUsedAfterPrimaryFailOver (elastic#79469)
  Fix RecoverySourceHandlerTests (elastic#79546)
  SQL: stabilize SqlSearchPageTimeoutIT (elastic#79928)
  Wait 3 seconds for the server to reload trust (elastic#79778)
  Skip automatically preserved request headers when rewriting (elastic#79973)
  Check whether stdout is a real console (elastic#79882)
  Convert remote license checker to use LicensedFeature (elastic#79876)
  Miscellaneous fixes for LDAP SDK v6 upgrade (elastic#79891)
  ...

# Conflicts:
#	libs/x-content/src/main/java/org/elasticsearch/xcontent/support/filtering/FilterPath.java
#	libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/FilterPathGeneratorFilteringTests.java
#	libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/FilterPathTests.java
  • Loading branch information
weizijun committed Oct 28, 2021
2 parents 22f5abb + 375fc77 commit e2b4ae5
Show file tree
Hide file tree
Showing 10,974 changed files with 453,289 additions and 293,763 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
7 changes: 4 additions & 3 deletions .backportrc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"upstream": "elastic/elasticsearch",
"targetBranchChoices": [
{ "name": "master", "checked": true },
"master",
"8.0",
"7.16",
"7.15",
"7.14",
"6.8"
],
"targetPRLabels": ["backport"],
"branchLabelMapping": {
"^v8.0.0$": "master",
"^v(\\d+).(\\d+).\\d+$": "$1.$2"
"^v8.1.0$": "master",
"^v(\\d+).(\\d+).\\d+(?:-(?:alpha|beta|rc)\\d+)?$": "$1.$2"
}
}
1 change: 1 addition & 0 deletions .ci/bwcVersions
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ BWC_VERSION:
- "7.15.2"
- "7.16.0"
- "8.0.0"
- "8.1.0"
2 changes: 1 addition & 1 deletion .ci/java-versions-aarch64.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# are 'java' or 'openjdk' followed by the major release number.

ES_BUILD_JAVA=jdk16
ES_RUNTIME_JAVA=jdk16
ES_RUNTIME_JAVA=jdk17
8 changes: 8 additions & 0 deletions .ci/java-versions-fips.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file is used when building pull requests with FIPS enabled

# This .properties file defines the versions of Java with which to
# build and test Elasticsearch for this branch. Valid Java versions
# are 'java' or 'openjdk' followed by the major release number.

ES_BUILD_JAVA=openjdk16
ES_RUNTIME_JAVA=openjdk17
2 changes: 1 addition & 1 deletion .ci/java-versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# are 'java' or 'openjdk' followed by the major release number.

ES_BUILD_JAVA=openjdk16
ES_RUNTIME_JAVA=java11
ES_RUNTIME_JAVA=openjdk17
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
COMPOSE_HTTP_TIMEOUT=120
JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA
RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA
JAVA11_HOME=$HOME/.java/jdk11
JAVA15_HOME=$HOME/.java/jdk15
- shell: |
#!/usr/local/bin/runbld --redirect-stderr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
properties-content: |
JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA
RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA
JAVA11_HOME=$HOME/.java/java11
JAVA15_HOME=$HOME/.java/openjdk15
- shell: |
#!/usr/local/bin/runbld --redirect-stderr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
properties-content: |
JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA
RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA
JAVA11_HOME=$HOME/.java/java11
JAVA15_HOME=$HOME/.java/openjdk15
- shell: |
#!/usr/local/bin/runbld --redirect-stderr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
properties-content: |
JAVA_HOME=$USERPROFILE\\.java\\$ES_BUILD_JAVA
RUNTIME_JAVA_HOME=$USERPROFILE\\.java\\$ES_RUNTIME_JAVA
JAVA11_HOME=$USERPROFILE\\.java\\java11
JAVA15_HOME=$USERPROFILE\\.java\\openjdk15
- batch: |
del /f /s /q %USERPROFILE%\.gradle\init.d\*.*
Expand Down
1 change: 1 addition & 0 deletions .ci/jobs.t/elastic+elasticsearch+periodic+ear.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
properties-content: |
JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA
RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA
JAVA11_HOME=$HOME/.java/java11
JAVA15_HOME=$HOME/.java/openjdk15
- shell: |
#!/bin/bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
properties-content: |
JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA
RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA
JAVA11_HOME=$HOME/.java/java11
JAVA15_HOME=$HOME/.java/openjdk15
- shell: |
#!/usr/local/bin/runbld --redirect-stderr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA
- shell: |
#!/usr/local/bin/runbld --redirect-stderr
$WORKSPACE/.ci/scripts/run-gradle.sh -Dignore.tests.seed :docs:check
$WORKSPACE/.ci/scripts/run-gradle.sh -Dignore.tests.seed precommit :docs:check
5 changes: 3 additions & 2 deletions .ci/jobs.t/elastic+elasticsearch+pull-request+part-1-fips.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
- '>test-mute'
builders:
- inject:
properties-file: '.ci/java-versions.properties'
# Use FIPS-specific Java versions
properties-file: '.ci/java-versions-fips.properties'
properties-content: |
JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA
RUNTIME_JAVA_HOME=$HOME/.java/java11
RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA
JAVA15_HOME=$HOME/.java/openjdk15
- shell: |
#!/usr/local/bin/runbld --redirect-stderr
Expand Down
5 changes: 3 additions & 2 deletions .ci/jobs.t/elastic+elasticsearch+pull-request+part-2-fips.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
- '>test-mute'
builders:
- inject:
properties-file: '.ci/java-versions.properties'
# Use FIPS-specific Java versions
properties-file: '.ci/java-versions-fips.properties'
properties-content: |
JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA
RUNTIME_JAVA_HOME=$HOME/.java/java11
RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA
JAVA15_HOME=$HOME/.java/openjdk15
- shell: |
#!/usr/local/bin/runbld --redirect-stderr
Expand Down
4 changes: 1 addition & 3 deletions .ci/jobs.t/elastic+elasticsearch+pull-request+precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
github-hooks: true
status-context: elasticsearch-ci/precommit
cancel-builds-on-update: true
included-regions:
- ^docs/.*
black-list-labels:
white-list-labels:
- '>test-mute'
builders:
- inject:
Expand Down
5 changes: 0 additions & 5 deletions .ci/matrix-runtime-javas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,4 @@
# or 'openjdk' followed by the major release number.

ES_RUNTIME_JAVA:
- java11
- openjdk16
- zulu11
- corretto11
- adoptopenjdk11
- openjdk17
1 change: 1 addition & 0 deletions .ci/templates.t/generic-gradle-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
properties-content: |
JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA
RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA
JAVA11_HOME=$HOME/.java/java11
JAVA15_HOME=$HOME/.java/openjdk15
- shell: |
#!/usr/local/bin/runbld --redirect-stderr
Expand Down
1 change: 1 addition & 0 deletions .ci/templates.t/matrix-gradle-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
properties-content: |
JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA
RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA
JAVA11_HOME=$HOME/.java/java11
JAVA15_HOME=$HOME/.java/openjdk15
- shell: |
#!/usr/local/bin/runbld --redirect-stderr
Expand Down
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@

# Format aggregations and related code (server and x-pack)
d71544976608bdb53fa4d29521fb328e1033ee2f

# Reformatting of whole codebase
12ad399c488f0cc60e19b5e1b29c6d569cb4351a
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import org.elasticsearch.xcontent.NamedXContentRegistry;
import org.elasticsearch.xcontent.XContentBuilder;
import org.elasticsearch.xcontent.XContentParser;
import org.elasticsearch.xcontent.XContentParserConfiguration;
import org.elasticsearch.xcontent.XContentType;
import org.elasticsearch.xcontent.support.filtering.FilterPath;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
Expand Down Expand Up @@ -41,8 +41,7 @@ public class FetchSourcePhaseBenchmark {
private FetchSourceContext fetchContext;
private Set<String> includesSet;
private Set<String> excludesSet;
private FilterPath[] includesFilters;
private FilterPath[] excludesFilters;
private XContentParserConfiguration parserConfig;

@Param({ "tiny", "short", "one_4k_field", "one_4m_field" })
private String source;
Expand Down Expand Up @@ -76,8 +75,7 @@ public void setup() throws IOException {
);
includesSet = Set.of(fetchContext.includes());
excludesSet = Set.of(fetchContext.excludes());
includesFilters = FilterPath.compile(Set.of(fetchContext.includes()));
excludesFilters = FilterPath.compile(Set.of(fetchContext.excludes()));
parserConfig = XContentParserConfiguration.EMPTY.withFiltering(includesSet, excludesSet);
}

private BytesReference read300BytesExample() throws IOException {
Expand All @@ -102,16 +100,7 @@ public BytesReference filterObjects() throws IOException {
public BytesReference filterXContentOnParser() throws IOException {
BytesStreamOutput streamOutput = new BytesStreamOutput(Math.min(1024, sourceBytes.length()));
XContentBuilder builder = new XContentBuilder(XContentType.JSON.xContent(), streamOutput);
try (
XContentParser parser = XContentType.JSON.xContent()
.createParser(
NamedXContentRegistry.EMPTY,
DeprecationHandler.THROW_UNSUPPORTED_OPERATION,
sourceBytes.streamInput(),
includesFilters,
excludesFilters
)
) {
try (XContentParser parser = XContentType.JSON.xContent().createParser(parserConfig, sourceBytes.streamInput())) {
builder.copyCurrentStructure(parser);
return BytesReference.bytes(builder);
}
Expand Down
Loading

0 comments on commit e2b4ae5

Please sign in to comment.