Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport: Add typless client side GetIndexRequest calls and response class #38422

Merged
merged 4 commits into from
Feb 5, 2019

Conversation

cbuescher
Copy link
Member

Backport for #37778
Relates to #35190

@cbuescher cbuescher added :Search Foundations/Mapping Index mappings, including merging and defining field types >deprecation backport v6.7.0 labels Feb 5, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features

…stic#37778)

The HLRC client currently uses `org.elasticsearch.action.admin.indices.get.GetIndexRequest`
and `org.elasticsearch.action.admin.indices.get.GetIndexResponse` in its get index
calls. Both request and response are designed for the typed APIs, including some
return types e.g. for `getMappings()` which in the maps it returns still use a
level including the type name.  In order to change this without breaking
existing users of the HLRC API, this PR introduces two new request and response
objects in the `org.elasticsearch.client.indices` client package. These are used
by the IndicesClient#get and IndicesClient#exists calls now by default and
support the type-less API. The old request and response objects are still kept
for use in similarly named, but deprecated methods.

The newly introduced client side classes are simplified versions of the server
side request/response classes since they don't need to support wire
serialization, and only the response needs fromXContent parsing (but no
xContent-serialization, since this is the responsibility of the server-side
class).  Also changing the return type of `GetIndexResponse#getMapping` to
`Map<String, MappingMetaData> getMappings()`, while it previously was returning
another map keyed by the type-name. Similar getters return simple Maps instead
of the ImmutableOpenMaps that the server side response objects return.
Copy link
Contributor

@jtibshirani jtibshirani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just a minor suggestion around a deprecation comment.

@cbuescher
Copy link
Member Author

@elasticmachine run elasticsearch-ci/1

@cbuescher cbuescher merged commit 1f2cd9f into elastic:6.x Feb 5, 2019
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Feb 6, 2019
* 6.x: (25 commits)
  Backport of types removal for Put/Get index templates (elastic#38465)
  Add support for API keys to access Elasticsearch (elastic#38291) (elastic#38399)
  Deprecate support for internal versioning for concurrency control (elastic#38451)
  Deprecate types in rollover index API (elastic#38389) (elastic#38458)
  Add typless client side GetIndexRequest calls and response class (elastic#38422)
  [ML] Report index unavailable instead of waiting for lazy node (elastic#38444)
  await fix CurtIT#testIndex until elastic#38451 is merged (elastic#38466)
  Update ilm-api.asciidoc, point to REMOVE policy (elastic#38235) (elastic#38464)
  SQL: Fix esType for DATETIME/DATE and INTERVALS (elastic#38179)
  Clean up duplicate follow config parameter code (elastic#37688) (elastic#38443)
  Deprecation check for No Master Block setting (elastic#38383)
  Bubble-up exceptions from scheduler (elastic#38441)
  Lift retention lease expiration to index shard (elastic#38391)
  Deprecate maxRetryTimeout in RestClient and increase default value (elastic#38425)
  Update Rollup Caps to allow unknown fields (elastic#38446)
  Backport of elastic#38411: `if_seq_no` and `if_primary_term` parameters aren't wired correctly in REST Client's CRUD API
  Support unknown fields in ingest pipeline map configuration (elastic#38429)
  SQL: Implement CURRENT_DATE (elastic#38175)
  Backport changes to the release notes script. (elastic#38346)
  Fix ILM explain response to allow unknown fields (elastic#38363)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport :Search Foundations/Mapping Index mappings, including merging and defining field types v6.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants