Commit graph

3183 commits

Author SHA1 Message Date
Rene Groeschke
6f3adbe9a5
Update Gradle Enterprise plugin to 3.16.2 (#105871) (#105873) 2024-03-01 14:09:31 -05:00
Rene Groeschke
b984b44767
Update Gradle wrapper to 8.6 (#103796) 2024-02-13 11:13:29 -08:00
Mark Vieira
a42a940b78
Update Gradle Enterprise plugin to 3.16.1 (#104435) 2024-02-13 08:15:59 -08:00
Dmitry Cherniachenko
a50e58d99a
Use single-char variant of String.indexOf() where possible (#105205)
* Use single-char variant of String.indexOf() where possible

indexOf(char) is more efficient than searching for the same one-character String.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-02-12 14:14:32 -05:00
Dmitry Cherniachenko
e21a4874ab
Use String.replace() instead of replaceAll() for non-regexp replacements (#105127)
* Use String.replace() instead of replaceAll() for non-regexp replacements

When arguments do not make use of regexp features replace() is a more efficient option, especially the char-variant.
2024-02-12 13:11:15 -05:00
Dmitry Cherniachenko
263ea5e987
Replace generic HashSet / HashMap with more efficient EnumSet / EnumMap (#105238) 2024-02-08 13:43:14 +00:00
Ryan Ernst
e1488a0fc7
Fix compilation of example rest handler (#105101) 2024-02-03 20:48:11 -08:00
Artem Prigoda
0acff18c57
Set read timeout for fetching IMDSv2 token (#104407)
Resubmit of #104397 without setting AWS_METADATA_SERVICE_TIMEOUT randomly in the build.

```
    Use the timeout set by AWS_METADATA_SERVICE_TIMEOUT environment variable both as connect and read timeout analogous to the AWS SDK.
    See https://docs.aws.amazon.com/sdkref/latest/guide/feature-ec2-instance-metadata.html
```

Resolves #104244
2024-01-17 11:08:31 +01:00
Simon Cooper
8739f9a665
Update example plugin for API changes in #103277 (#104357) 2024-01-16 12:46:07 +00:00
Artem Prigoda
ebe71f9fe0
Revert "Set read timeout for fetching IMDSv2 token" (#104397) 2024-01-16 12:58:50 +01:00
Artem Prigoda
063313ffcf
Set read timeout for fetching IMDSv2 token (#104253)
Use the timeout set by AWS_METADATA_SERVICE_TIMEOUT environment variable both as connect and read timeout analogous to the AWS SDK.

See https://docs.aws.amazon.com/sdkref/latest/guide/feature-ec2-instance-metadata.html

Resolves #104244
2024-01-16 10:12:45 +01:00
Chris Hegarty
6e28d78364
Update IndexVersion constants for 8.13 (#103556)
This commit adds a new IndexVersion so that 8.13. can be determined over 8.12, since 8.12 is having it's IndexVersion's updated as per #103549.
2023-12-19 12:21:05 +00:00
twosom
e1cd77e687
Added Duplicate Word Check Feature to Analysis Nori (#103325)
Added Duplicate Word Check Feature to Analysis Nori

---------

Co-authored-by: Jim Ferenczi <jim.ferenczi@elastic.co>
2023-12-15 15:58:12 +00:00
Armin Braun
7a63a666e2
Dry up test code that extracts TotalHits from SearchResponse (#103269)
We have the pattern of getting a response only for its `TotalHits` in a couple of spots,
some of them still leaking the `SearchResponse`.
This PR dries up those that I could quickly identify to use the new utilty method to simplify this pattern
or just moves the code to `assertHitCount` where possible.
2023-12-11 18:25:22 +01:00
Armin Braun
1452658e35
Remove dead code from mappers codebase (#103273)
Just some random findings from investigating unrelated things.
2023-12-11 17:57:19 +01:00
Yang Wang
b9c29807ec
Extract repositories metrics into its own class (#103034)
This PR is a follow up of
https://github.com/elastic/elasticsearch/pull/102505#discussion_r1402957598
that move the repositories metrics management into its own class which
is then passed around instead of relying on the raw meterRegistry and
string metric names.
2023-12-07 18:26:17 -05:00
Rene Groeschke
ab0bb4889a
Fix :plugins:repository-hdfs:forbiddenApisJavaRestTest (#102983)
Reworking forbiddenApis check to use gradle worker api exposed a bug in
how we resolve krb5kdc keytab information. This fixes the depenendency to krb5kdc keytab configuration and
its builtBy task.

This also changes the usage of krb5kdc keytab files to be passed directly to task classpath as
they are only required at runtime and directly having them as part of javaRestTestRuntimeOnly would mean precommit
requires krb5kdc compose up which we definitely not want
2023-12-06 08:33:27 +01:00
ChrisHegarty
aeaca57900 Merge 'main' into lucene_snapshot_9_9 2023-11-30 19:57:29 +00:00
Rene Groeschke
8e9a88b63d
Update gradle wrapper to 8.5 (#102154)
Update BuildLayout references
2023-11-30 10:01:32 -05:00
ChrisHegarty
4c8f24aa11 Merge branch 'main' into lucene_snapshot_9_9 2023-11-30 09:57:55 +00:00
David Turner
824d06c8cf
Use random purpose in blob store repository tests (#102789)
Today many blob store repository tests specify that the operations they
perform have purpose `OperationPurpose#SNAPSHOT`, but most of these
tests do not care about the purpose of these operations. This commit
switches them to using a random purpose to highlight that the purpose is
unimportant to the test.
2023-11-29 20:21:07 -08:00
Luca Cavanna
7c9e8356e6 Merge branch 'main' into lucene_snapshot 2023-11-24 09:57:22 +01:00
Sanjay J
51eef046a0
Add support for configuring proxy scheme in S3 client settings and EC2 discovery plugin (#102495)
Closes #101873
2023-11-24 10:33:21 +02:00
Armin Braun
cdc83ad29b
Add shorthand for prepareIndex to test infrastructure (#101187)
Same as #101175, shorten `client().prepareIndex(index)` and
`client().prepareIndex().setIndex(index)` via a test utility.
Saves lots of code now and sets up some follow-up simplifcations.
2023-11-23 15:47:36 +01:00
Armin Braun
a9c286b25c
Collapse verbose .execute().actionGet() calls in tests (#102502)
Cleaning this up a little even though it's still quite horrible.
`.get()` in this API actually means `actionGet()` so to speak.
I think a good first step to cleaning this up is to at least reduce
the duplication though and save 1k lines.
2023-11-23 10:10:10 +01:00
Jake Landis
17a46a6e9f
upgrade bouncy castle jars (#100923)
This commit upgrades the Bouncy Castle jars. Bouncy Castle is used for 
some internal build concners as well as a comnand line application. 
Most notably Bouncy Castle is also used as the FIPs certified JCE/JSEE provider 
we use to test our ability to use a FIPs compliant crypto provider. 

The following changes here are a result of the upgraded Bouncy Castle jars:
* TLSv1.3 is now supported when running in FIPs mode 
* RSA PKCS#1 v1.5 is no longer allowed in FIPS mode
* Triple DES (3DES) is no longer allowed in FIPS mode
* Minor updates the security manager configuration used to test FIPs (to read permissions from the security provider)
* Minor adjustments to tests to accommodate the above changes. 
* Minor adjustments to the gradle build to accommodate new dependencies 

Note - update to the documentation will come in a later commit.
2023-11-21 11:14:41 -06:00
elasticsearchmachine
940df2af72 Merge remote-tracking branch 'origin/main' into lucene_snapshot 2023-11-10 11:02:31 +00:00
Ignacio Vera
b7b5518acc
Remove explicit SearchResponse references from plugins (#101277)
Remove explicit SearchResponse references from plugins.
2023-11-09 22:08:18 +01:00
Luca Cavanna
180ef285c0
Fix compile errors (#101874)
IndexDiskUsageAnalyzer and IndexDiskUsageAnalyzerTests, as well as CompletionFieldMapper, CompletionFieldMapperTests and CompletionStatsCacheTests need adjusting after apache/lucene#12741 , to refer to the latest postings format.
KuromojiTokenizerFactory needs adjusting after apache/lucene#12390
2023-11-09 14:17:07 +01:00
Armin Braun
433517ad01
Misc cleanup in o.e.search.fetch (#101939)
Just some random findings from researching other things.
Removing all kinds of dead code and fixing obvious duplication in 2 spots.
2023-11-09 13:46:00 +01:00
Mark Vieira
ee1467d4ff
Improve test avoidance (#101081) 2023-10-26 12:16:06 -07:00
Armin Braun
3945ee75d0
Use assertAcked more (#101201)
Just found that we have a lot of inconsistency and needless verbosity
here in tests. We can just use `assertAcked` in a couple spots
to save `.get`, `.actionGet` etc., especially with the signature
change I added here.
2023-10-23 19:48:10 +02:00
David Turner
1eda6ac74b
Extract ESIntegTestCase#prepareSearch (#101175)
Relates #101172
2023-10-20 06:18:58 -04:00
Ryan Ernst
8a1db8c6c3
Move index version constants to IndexVersions (#101094)
Similar to the TransportVersions holder class, IndexVersions is the new
place to contain all constants for IndexVersion. This commit moves all
existing constants to the new class. It is purely mechanical.
2023-10-19 20:44:51 -04:00
Rene Groeschke
1773d4b5d1
Fix Gradle deprecation warning in examples project (#100988) 2023-10-17 12:00:47 -04:00
Rene Groeschke
8a6df32de6
Update gradle wrapper to 8.4 (#99856)
* Remove deprecated forConfigurationTime usage
2023-10-11 17:02:27 +02:00
Armin Braun
b7eafce32c
Make some practically static methods static (#97565)
Another round of automated fixes to this, marking things that can be
made static as static. Saves some JIT cycles but also turns some lambdas
from capturing to non-capturing and makes the "utilityness" of some
classes visible.
2023-10-06 23:37:07 +02:00
Panagiotis Bailis
d32dc6dd8b
Refactoring & adding tests to rescorer in the example plugin, to account for non strictly increasing doc ids in the results. (#100189)
* Updating ExampleRescoreBuilder.ExampleRescorer#rescore to use the ordered sortedByDocId array when iterating through the leaves to fetch the NumericFieldData used or reranking. 
* Adding test to account for the above behavior, ensuring that the docs will be properly rescored when the original results are in descending _id order.

Closes #39665
2023-10-04 12:28:18 +03:00
Yang Wang
5628392fa5
Differentiate stats for the same blobstore operation with purposes (#99615)
Today blobstore stats are collected against each HTTP operation, e.g.
Get, List. This is not granular enough because the same HTTP operration
can be performed for different purposes, e.g. cluster state, indices or
translog. This PR adds a new Purpose enum to provide further breakdown
for the same HTTP operation. 

Relates: ES-6800
2023-10-02 06:37:08 -04:00
Rene Groeschke
b23e000c30
Update gradle wrapper to 8.3 (#97838)
Gradle now fully supports compiling, testing and running on Java 20. 
Among other general performance improvements this release introduces --test-dry-run command line option that allows checking if tests are filtered or not by gradle.
Required updating nebula ospackage plugin as setuid was broken in gradle 8.3.
2023-09-27 08:48:21 +02:00
Tim Vernum
d411acecbc
Suppress this-escape warning for JDK21 (#99848)
Adds @SuppressWarnings("this-escape") to all necessary places to that
Elasticsearch can compile with -Werror on JDK21

No investigation has been done to determine whether any of the cases
are a potential source of errors - we have simply suppressed all
existing occurrences.

Resolves: #99845
2023-09-25 18:30:21 +10:00
Armin Braun
6fc05a6bb1
Remove redundant fields on TextFieldMapper and KeywordFieldMapper (#99666)
These fields were also on the mapped field types, no need to waste bytes
on them.
2023-09-19 10:43:42 -04:00
Alan Woodward
4e1fb3fca5
Automatically disable ignore_malformed on datastream @timestamp fields (#99346)
Data-stream mappings require a @timestamp field to be present and configured
as a date with a specific set of parameters. The index-wide setting of
ignore_malformed can cause problems here if it is set to true, because it needs
to be false for the @timestamp field.

This commit detects if a set of mappings is configured for a datastream by checking
for the presence of a DataStreamTimestampFieldMapper metadata field, and passes
that information on during Mapper construction as part of the MapperBuilderContext.
DateFieldMapper.Builder now checks to see if it is specifically for a data stream timestamp
field, and if it is, sets ignore_malformed to false.

Relates to #96051
2023-09-13 15:02:22 +01:00
Armin Braun
574fb05946
Deduplicate org.apache.lucene.document.FieldType instances across mappers (#99361)
We mostly have a handful of `FieldType` values here across all mappers and none of them contain
attributes. There's only so many combinations here, lets deduplicate these to save some heap and set up
subsequent mapper heap savings.
2023-09-08 22:18:35 +02:00
Armin Braun
f1a376c317
Remove CopyTo.Builder (#99368)
The copyTo builder is really hard to reason about when it comes to
mapper merging, because the `reset` method would actually mutate an
existing mapper. That seems dangerous and the whole thing is quite
inefficient as well. -> this PR just removes it and uses a copy
constructor for copy on write, avoiding instance creation on mapper
merges here and there and leaving no doubt about these things being
immutable.
2023-09-08 13:24:31 -04:00
Ryan Ernst
fe31e92020
Fix example referencing TransportVersion constant (#99375)
With the recent move of constants to the TransportVersions class, the
example plugins were missed. This commit fixes the example plugins which
referenced a constant.
2023-09-08 10:23:15 -07:00
Mark Vieira
60e178eb3a
Update Gradle Enterprise plugin to 3.14.1 (#98551) 2023-09-06 08:13:46 -07:00
Francisco Fernández Castaño
f6a2b5c9ef
Add bulk delete method to BlobStore interface and implementations (#98948) 2023-08-29 12:25:03 +02:00
Simon Cooper
b67a9e1ec3
Move text references to index created version to IndexVersion (#98727) 2023-08-23 10:51:56 +01:00
Simon Cooper
041e94d2b0
More migrations of Version for index created version to IndexVersion (#98495) 2023-08-21 16:47:58 +01:00