Fix the support of RestClient Node Sniffer for OpenSearch 2.x, and update unit tests for OpenSearch.
The current code contains the logic to be compatible with Elasticsearch 2.x version, which is conflict with OpenSearch 2.x, so removed that part of legacy code.
* Update the script create_test_nodes_info.bash to dump the response of Nodes Info API GET _nodes/http for OpenSearch 1.0 and 2.0 version, which used for unit test.
* Remove the support of Elasticsearch version 2.x for the Sniffer
* Update unit test to validate the Sniffer compatible with OpenSearch 1.x and 2.x
* Update the API response parser to meet the array notation (in ES 6.1 and above) for the node attributes setting. It will result the value of `node.attr` setting will not be parsed as array in the Sniffer, when using the Sniffer on cluster in Elasticsearch 6.0 and above.
* Replace "master" node role with "cluster_manager" in unit test
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Use set to make shell scripts more strict
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
* Change -o pipefail to -e
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
* Set scripts to standard rule
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Refactors XContentType.fromMediaTypeOrFormat to fromMediaType so Accept headers
and Content-Type headers can be parsed separately. This helps in reusing the
same parse logic in for REST Versioning API support.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* Replace internal usages of 'master' term in 'client' directory
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Add a uni test for NodeSelector to test deprecated master role
Signed-off-by: Tianli Feng <ftianli@amazon.com>
OpenSearch 2.0.0 no longer needs HLRC compatibility with legacy clients. This
commit removes all logic to spoof the version as a legacy cluster.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Adds a new multi_term aggregation. The current implementation focuses
on adding new type aggregates. Performance (latency) is suboptimal in this
iteration, mainly because of brute force encoding/decoding a list of values
into bucket keys. A performance improvement change will be made as a
follow on.
Signed-off-by: Peng Huo <penghuo@gmail.com>
The REST API request parameter "master_timeout" will be deprecated in server version 3.0, and removed in 4.0. The alternative parameter "cluster_manager_timeout" is added in server 2.0 .
With the change in this commit, High-Level-Rest-Client will not be compatible with OpenSearch server 1.x (and below).
- Use parameter `cluster_manager_timeout` instead of `master_timeout` in High-Level-Rest-Client `RequestConverters` class for building REST requests
- Modify corresponding unit tests
- Change lots of "master timeout" in internal method and class names.
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Upgrade to Apache Commons Logging 1.2
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
* Clarify that Apache HTTP/commons-* dependencies are not just for tests
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
Add a new node role `cluster_manager`, as the replacement for `master` role, that used in setting `node.roles: [ master ]`.
They have got the same functionality, but can NOT be assigned to `node.roles` together.
* Add `CLUSTER_MANAGER_ROLE` in `DiscoveryNodeRole` class, and deprecate `MASTER_ROLE`
* Remove `MASTER_ROLE` from the `DiscoveryNodeRole.BUILT_IN_ROLES`, and temporarily load the role by the existing method `DiscoveryNode.setAdditionalRoles`
* Add a method `validateRole()` in `DiscoveryNodeRole` class, it's used to validate a specific role is compatible with the other roles to be assigned to a node together.
* Add deprecation message when assigning `master` role in setting `node.roles`
* Replace most `MASTER_ROLE` with `CLUSTER_MANAGER_ROLE` in current unit and integration tests
* Add new unit and integration tests to validate `CLUSTER_MANAGER_ROLE` and `MASTER_ROLE` can be treated as the same.
More explanation:
* New node will have "cluster_manager", "data", and "ingest" roles by default. Which means the default value of setting "node.roles" will be `["cluster_manager","data","ingest"]`, instead of `["master","data","ingest"]`
* "cluster_manager" role will be treated as "master" role in the OpenSearch node of previous versions.
* "cluster_manager” role and "master" role have got the same abbreviation name: "m"
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* [Upgrade] Lucene 9.1.0-snapshot-ea989fe8f30
Upgrades from Lucene 9.0.0 to 9.1.0-snapshot-ea989fe8f30 in preparation for
9.1.0 GA.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* Add spanishplural token filter
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* fix KNOWN_TOKENIZERS
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Removes multi-type support from IndexTemplateMetadata so that instead of holding
a map of multiple types to mappings, it only returns a single mapping for a
single type. Also removes type from documentMapper() method to avoid any
accidental NullPointerExceptions in the internal mapping retrieval.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Removes include_type_name from the high level reset client along with relevant
deprecated methods in IndicesClient. All tests are updated to remove the
parameter from the rest requests along with various toXContent methods that are
no longer required.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* Add setting reindex.remote.allowlist, and deprecate setting reindex.remote.whitelist
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Add unit test for renaming the setting reindex.remote.allowlist
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Remove system.out.println()
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Adjust format by spotlessApply task
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Replace REMOTE_CLUSTER_WHITELIST with REMOTE_CLUSTER_ALLOWLIST
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Add a unit test to test final setting value when both settings have got a value
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Rename the unit test class name
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Remove the Access modifiers public from the constant REMOTE_CLUSTER_WHITELIST
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Initialize ReindexPlugin without using the @Before method
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Rename 'unwhitelisted' to 'unallowlisted' in a yml file used for REST api testing.
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Replace the exclusionary word whitelist with allowlist, and blacklist with denylist, in code commet and internal variable/method/class/package name.
Signed-off-by: Andreas <apre@gmx.at>
Removes the deprecated types based get, getMapping, getAsync, and
getMappingAsync methods from IndicesClient. It also removes extra nesting of
mappings belong the deprecated type named object and removes the types based
methods from the affected request classes.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Removes type support from DocWrite Request and Response, all derived classes,
and all places used.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* [Remove] types from SearchHit and Explain API
Removes type support from SearchHit and Explain API.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* fix failing tests
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* move TYPES_DEPRECATION_MESSAGE from RestExplainAction to FullClusterRestartIT
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* fix FullClusterRestartIT
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* fix failing tests
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* fix testSoftDelete
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Removes type support from the get and mget transport and rest actions along
with removal from ShardGetService.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
With types deprecation the type support is removed from internal search API
(SearchRequest and QueryShardContext).
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* Bump com.diffplug.spotless from 5.6.1 to 6.2.0
Bumps com.diffplug.spotless from 5.6.1 to 6.2.0.
---
updated-dependencies:
- dependency-name: com.diffplug.spotless
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
* spotlessApply
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nicholas Walter Knize <nknize@apache.org>
* Remove doc type specific indexing APIs and relevant changes
Signed-off-by: Suraj Singh <surajrider@gmail.com>
* Remove type param from yml and integ test files
Signed-off-by: Suraj Singh <surajrider@gmail.com>
* Adding support for JDK17 and removing JDK8
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
* Merge overlaping PR, bumping min java version to 11
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
* Removing references to JDK8 from dev guide
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
Remove the deprecated sync flush API which was replaced by sequence
number and retention lease mechanisms and no longer used in 2.0.0.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* Changes made by adding the Task indicator and the IllegalArgs.
Signed-off-by: meghasaik <kavmegha@amazon.com>
* Changes made by changing the String message for uncancellable task.
Signed-off-by: meghasaik <kavmegha@amazon.com>
This PR removes LegacyESVersion.V_6_0_* constants including all pre-release
versions and bug fixes.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* Added more detailed logging for SSLHandshakeException
Signed-off-by: Ryan Bogan <rbogan@amazon.com>
* Fixed spotless errors for logging change
Signed-off-by: Ryan Bogan <rbogan@amazon.com>
* Changed message to include original error and limited to specific instance
Signed-off-by: Ryan Bogan <rbogan@amazon.com>
* Applied troubleshooting message to all instances of SSlHandshakeException
Signed-off-by: Ryan Bogan <rbogan@amazon.com>