Commit graph

2063 commits

Author SHA1 Message Date
Mark Vieira
0279c0a909
Add AGPLv3 as a supported license 2024-09-13 14:30:33 -07:00
Patrick Doyle
35a375329a
Move Guice to org.elasticsearch.injection.guice (#111723)
* Move files and fix imports & module exports
* Other consequences of moving Guice
2024-08-12 10:47:46 -04:00
Mark Vieira
1a05273232
Upgrade Mockito dependency (#108637) 2024-05-14 14:03:40 -07: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
Joe Gallo
d54329011f
Remove HLRC from ES codebase (#105406) 2024-02-12 11:50:01 -05:00
Ignacio Vera
a129da23f0
Remove aggregation test testing the high level rest client (#105294)
Removing those test and the actual HLRC classes. TheHLRC is not a thing any longer.
2024-02-12 10:34:25 +01:00
Armin Braun
5c8006499a
Move test-only search response x-content-parsing code to test codebase (#105308)
Loads of code here that is only used in tests and one duplicate unused
class that was only used as an indirection to parsing the
`AsyncSearchResponse`. Moved what I could easily move via automated
refactoring to `SearchResponseUtils` in tests and removed the duplicate
now unused class from the client codebase.
2024-02-09 11:56:39 +01:00
Ryan Ernst
b67f5a6b57
Make cluster feature predicate available to plugins (#105022)
A predicate to check whether the cluster supports a feature is available
to rest handlers defined in server. This commit adds that predicate to
plugins defining rest handlers as well.
2024-02-01 09:11:18 -08:00
Ignacio Vera
79f801b754
Remove unused ParsedAggregation (#104848)
This abstraction was introduced to support the high level rest client and is not needed any more.
2024-01-29 14:59:11 +01:00
David Turner
1116889819
Remove unused arg from ActionType ctor (#104650)
`ActionType` represents an action which runs on the local node, there's
no need for implementations to define a `Reader<Response>`. This commit
removes the unused constructor argument.
2024-01-25 03:28:32 -05:00
eyalkoren
6f4e293d29
Add require_data_stream feature (#101872)
Closes #97032

Adding the ability to set `require_data_stream` parameter (boolean) on bulk and indexing APIs.
For document indexing, this flag requires the indexing operation to either be pointed at a data stream, or match a template that will create a data stream.
2024-01-18 09:15:48 -07:00
Mark Vieira
66509df642
Update mockito dependency (#104494) 2024-01-18 06:58:48 -08:00
Simon Cooper
016c778321
Remove NamedWriteableRegistry from NodeClient, pass it directly through to rest actions (#103277) 2024-01-11 12:42:22 +00:00
David Turner
cd2bb08957
Set thread name used by REST client (#103160)
By default the REST client uses a thread factory which names its threads
with the generic pattern `I/O dispatcher %d`. This commit adds the
prefix `elasticsearch-rest-client-`, and a client-instance-specific ID,
to the name of these threads to make them easier to identify.
2024-01-09 08:22:41 +00:00
Armin Braun
36f08ea441
Make use of constants and utility methods to build empty SearchHits instances (#103983)
This are to be made ref-counted shortly. There's no point in having any
pooling/leak-tracking for empty instances though. To prepare for that,
lets add some short-cuts for dealing with empty instances to make the
overall change smaller and cleanup code already.
2024-01-05 17:43:06 +01:00
Armin Braun
073351bdfb
Use ref-count aware chunked-xcontent listener in most spots (#103803)
We had a lot of spots where the search response wasn't yet handled by
the ref-counting version of the listener. I figured, since all but 2
usages of the plain listener involved a ref counted (albeit noop)
transport response anyway, I might as well mostly use that one to aid
potential future refactoring.
2024-01-02 19:21:27 +01:00
Armin Braun
7fc1fcb2ee
Remove InternalSearchResponse as well as most usage of SearchResponseSections (#103583)
This indirection isn't really necessary now that its use in the high
level rest client went away. -> flattened the `SearchResponse` class to
make ref counting easier -> removed `InternalSearchResponse` whose
functionality was completely redundant now -> removed serialization and
most of the usage of `SearchResponseSections`, only keeping this for the
few search execution spots that currently use it and where removing it
won't get us anything and will be a huge changeset.

enables the last steps in #102030
2023-12-20 12:57:36 -05:00
David Turner
e8c3a72785
Extract constant for ?ignore pseudo-parameter (#102365)
Today `RestClient` interprets an `?ignore=` request parameter as an
indication that certain HTTP response codes should be considered
successful and not raise a `ResponseException`. This commit replaces the
magic literal `"ignore"` with a constant and adds a utility to specify
the ignored codes as `RestStatus` values.
2023-11-20 03:37:02 -05:00
Joe Gallo
94b58f5f94
Remove the RestHighLevelClient and some supporting classes (#102305) 2023-11-16 17:58:36 -05:00
Joe Gallo
29aa74b1ce
More miscellaneous tidying towards removing the HLRC (#102175) 2023-11-14 18:14:48 -05:00
Armin Braun
ae6d180379
Clean up some more dead code in o.e.s.aggregations (#101820)
Another iteration of mostly automatic cleanup on top of #101806.
2023-11-07 20:07:17 +01:00
Joe Gallo
b750f6e980
Remove HLRC from EQL tests (#101697) 2023-11-02 11:39:59 -04:00
Joe Gallo
3c2d8f265d
Remove HLRC from repository-old-versions test (#101696) 2023-11-02 09:34:05 -04:00
Rene Groeschke
4fa18ff42b
Make forbidden apis check cacheable and cc compatible (#101217)
* Make forbidden apis check cacheable and cc compatible
* Port CheckForbiddenApiTask to use worker api
* Simplify runtime classpath for CheckForbiddenApisTask
2023-11-01 16:24:28 +01:00
Joe Gallo
e9179ae71e
Miscellaneous tidying towards removing the HLRC (#101604) 2023-11-01 10:10:44 -04:00
Christoph Büscher
f08ae65f50
Unmute RestClientMultipleHostsIntegTests.testCancelAsyncRequests (#101592)
The underlying issue is closed, so either this test should be running
correctly now, is still failing for valid reasons or can be removed.
Either way we need to enable it to see.
2023-10-31 06:44:58 -04:00
David Turner
3ce905b754
Remove more unnecessary ActionType subclasses (#101053)
Relates #97721
2023-10-18 13:56:40 +01:00
Keith Massey
92ec9d6605
Add executed pipelines to bulk api response (#100031)
This change allows users to pass a new list_executed_pipelines parameter
to the bulk API, which results in an executed_pipelines list being returned.
2023-10-17 09:39:09 -05:00
David Turner
0a31ce64a9
Remove dangerous default executor from HandledTransportAction (#100162)
Today subclasses of `HandledTransportAction` can specify the executor on
which they run, but the executor is optional and if omitted will use
`DIRECT_EXECUTOR_SERVICE`, which means the action runs on a transport
thread. This is a dangerous default behaviour because it makes it easy
to add new transport actions which implicitly run on a network thread,
which is very hard to pick up in reviews.

This commit makes the executor explicit in all callers, and marks the
dangerous methods for removal.
2023-10-03 17:54:52 -04:00
Ryan Ernst
19257125b1
Move transport version constants to TransportVersions (#97990)
Constants for TransportVersion currently live alongeside the class
definition. This has been fine since there was only one set of
constants. However, to support serverless, some constants will need to
be defined elsewhere.

This commit moves the existing constants to a new holder class,
TransportVersions. It is almost entirely mechanical, using IntelliJ move
members. The only non mechanical part was slightly shifting how CURRENT
is found, defining a LATEST in TransportVersions that is automatically
calculated (since we already have it, no need to manually define it).
2023-09-06 15:14:41 -04:00
Rene Groeschke
b8627079b4
Update Gradle Wrapper to 8.2 (#96686)
- Convention usage has been deprecated and was fixed in our build files
- Fix test dependencies and deprecation
2023-07-04 15:35:15 +02:00
Armin Braun
63e64ae61b
Cleanup Stream usage in various spots (#97306)
Lots of spots where we did weird things around streams like redundant stream creation, redundant collecting
before adding all the collected elements to another collection or so, redundant streams for joining strings
and using less efficient `Collectors.toList` and in a few cases also incorrectly relying on the result being mutable.
2023-07-03 14:24:57 +02:00
Chris Hegarty
ccd9efb807
Update to Mockito 5.4.0 (#97285) 2023-06-30 18:27:47 +01:00
Michael Peterson
8b1cd47455
Support CCS minimize round trips in async search (#96012)
* Support CCS minimize round trips in async search

This commit makes the smallest set of changes to allow async-search based cross-cluster search
to work with the CCS minimize_round_trips feature without changing the internals/architecture of
the search action.

When ccsMinimizeRoundtrips is set to true on SubmitAsyncSearchRequest, the AsyncSearchTask on the
primary CCS coordinator sends a synchronous SearchRequest to all to clusters for a remote coordinator
to orchestrate and return the entire result set to the CCS coordinator as a single response.

This is the same functionality provided by synchronous CCS search using minimize_roundtrips.
Since this is an async search, it means that the async search coordinator has no visibility
into search progress on the remote clusters while they are running the search, thus losing one of
the key features of async search. However, this is a good first approach for improving overall search
latency for cross cluster searches that query a large number of shards on remote clusters, since
Kibana does not currently expose incremental progress of an async search to users.

Relates #73971
2023-06-01 10:34:16 -04:00
Alan Woodward
a3edf6b454
Add XContent chunking to SearchResponse (#94736)
This commit adds xcontent chunking to SearchResponse and MultiSearchResponse
by making SearchHits implement ChunkedToXContent.

Relates to #89838
2023-05-12 12:45:44 +01:00
Rory Hunter
fe1083f6c5
Upgrade spotless plugin to 6.17.0 (#94994)
Fixes #82794. Upgrade the spotless plugin, which addresses the issue
around formatting `instanceof` expressions. Formatting of statements
including lambdas seems to have improved too.
2023-04-04 10:03:32 +01:00
David Turner
343225b07b
Remove all blocking on Listenable*Future (#94411)
There are almost no places where we block a thread to wait on the result
of a `ListenableFuture` or `ListenableActionFuture`, and the few places
that do so can trivially use a `PlainActionFuture` instead. This commit
removes all blocking on `ListenableFuture` or `ListenableActionFuture`.

Relates #94386
2023-03-10 16:29:23 +00:00
Armin Braun
49898d4a60
Remove most of o.e.c.i.Requests (#94266)
We don't have the transport client anymore and this was a questionable
class to begin with. Removing the pointless constructor wrappers and
deprecating it for removal. Mostly to save hundreds of LoC and make
tests a little more homogeneous.
2023-03-02 16:14:49 +01:00
Ryan Ernst
e5a467eb52
Update mockito to 5.1.1 (#93658)
closes #93395
2023-02-14 00:13:39 -05:00
Simon Cooper
c513b2bcc6
Migrate VersionedWriteable & NamedDiff to TransportVersion take 2 (#93242)
Re-apply "Migrate VersionedWriteable & NamedDiff to TransportVersion (#93076)"

This reverts commit 48f96090dc.
2023-01-26 09:49:08 +00:00
Simon Cooper
48f96090dc Revert "Migrate VersionedWriteable & NamedDiff to TransportVersion (#93076)"
This reverts commit bef85c66e7.
2023-01-25 16:16:10 +00:00
Simon Cooper
bef85c66e7
Migrate VersionedWriteable & NamedDiff to TransportVersion (#93076)
InferenceConfig is kept on Version, as that existed before VersionedNamedWriteable came along
2023-01-25 16:03:38 +00:00
Martijn van Groningen
b11cbd43dd
Move matrix stats to aggregations module (#92435)
Running the `matrix_stats_multi_value_field.yaml` test in multi node
test cluster showed a bug, see: 88758ab577
Also removes `MatrixStats` interface, removed usage of deprecated
ValueType enum and removed unused generic usage.

Relates to #90283
2022-12-22 03:15:05 -05:00
Joe Gallo
2b8fde6890
Remove unused methods and classes from HLRC (#92030) 2022-11-30 13:34:01 -05:00
Joe Gallo
73122f01e2
Remove unused methods and classes from HLRC (#92012) 2022-11-30 11:40:06 -05:00
Joe Gallo
4798f050e8
Remove IndexerState from HLRC (#92023) 2022-11-30 11:09:52 -05:00
Martijn van Groningen
1e186bb820
Move time_series aggregation to aggregations module. (#91356)
This also drops the TimeSeries ceremonial interface.

Note that this change also moves a search cancellation test to
aggregations module. It does so by creating a base search cancallation
base class that both server and this module share.

Relates to #90283 Relates to #82273
2022-11-08 12:27:35 -05:00
Nik Everett
1474d79177
Move derivative agg to module (#91014)
This cleans up the derivative pipeline agg in a few days:
1. Moves it to the `aggregations` module ala #90283
2. Drops the ceremonial interface from the result ala #82273
3. Adds comprehensive REST layer tests for it ala #26220
4. Removes some `ESIntegTestCase tests` that duplicated those in the
   `AggregatorTestCase`.
2022-10-31 10:02:57 -04:00
Martijn van Groningen
03054d066e
Move auto date histogram to aggregations module (#90746)
This change also moves adjacency_matrix aggregation to its own package.

Note that that this PR also moves test code not related to auto date
histogram. I think this is cleaner then leaving some tests in a non
desired state between PRs. Also the test code that has been moved is
slatted for being moved to the aggregations module. I suspect that
future changes, like for example moving `terms` agg, require that other
aggregations  to be moved as well (e.g. `significant_terms`), since a
lot of code is reused as well.

Relates to #90283
2022-10-12 04:15:57 -04:00
Albert Zaharovits
ca32963371
Assert wildcards are not expanded as specified by request options (#90641)
This modifies some assertions in the authz to cater for the cases where
wildcards are not expanded because of request options.
2022-10-06 12:53:15 -04:00