Make RestHighLevelClient's Request class public#26627
Conversation
Request class is currently package protected, making it difficult for the users to extend the RestHighLevelClient and to use its protected methods to execute requests. This commit makes the Request class public and changes few methods of RestHighLevelClient to be protected. closes elastic#26455
|
|
||
| public class RequestTests extends ESTestCase { | ||
|
|
||
| public void testConstructor() throws Exception { |
There was a problem hiding this comment.
can we also test the visibility of the class and its constructor by checking their modifiers?
|
Thanks all for your reviews! @javanna I just added tests for what your requested. Can you please have another look? |
| */ | ||
|
|
||
| package org.elasticsearch.client; | ||
| package org.elasticsearch.client.extension; |
There was a problem hiding this comment.
sorry I didn't notice this before, but why changing the package here? It would be nice to be able to test everything we need with reflection, rather than changing package... unless there's another reason why this was done.
There was a problem hiding this comment.
No other reason, just to make it more obvious that CustomRestClient extends the high level rest client while being located in a different package.
There was a problem hiding this comment.
Please let's not make an arbitrary (and inconsistent) change like that. We do not use "extension" packages anywhere else.
|
@javanna I updated the code and remove the |
|
elasticsearch-ci retest this please |
Request class is currently package protected, making it difficult for the users to extend the RestHighLevelClient and to use its protected methods to execute requests. This commit makes the Request class public and changes few methods of RestHighLevelClient to be protected.
Request class is currently package protected, making it difficult for the users to extend the RestHighLevelClient and to use its protected methods to execute requests. This commit makes the Request class public and changes few methods of RestHighLevelClient to be protected.
Request class is currently package protected, making it difficult for the users to extend the RestHighLevelClient and to use its protected methods to execute requests. This commit makes the Request class public and changes few methods of RestHighLevelClient to be protected.
* master: [DOCS] Added index-shared4 and index-shared5.asciidoc BulkProcessor flush runnable preserves the thread context from creation time (elastic#26718) Catch exceptions and inform handler in RemoteClusterConnection#collectNodes (elastic#26725) [Docs] Fix name of character filter in example. (elastic#26724) Remove parse field deprecations in query builders (elastic#26711) elastic#26720: Set the correct bwc version after backport to 6.0 Remove deprecated type and slop field in MatchQueryBuilder (elastic#26720) Refactoring of Gateway*** classes (elastic#26706) Make RestHighLevelClient's Request class public (elastic#26627) Deguice ActionFilter (elastic#26691) aggs: Allow aggregation sorting via nested aggregation. Build: Set bwc builds to always set snapshot (elastic#26704) File Discovery: Remove fallback with zen discovery (elastic#26667)
Requestclass is currently package protected, making it difficult forthe users to extend the
RestHighLevelClientand to use its protectedmethods to execute requests. This commit makes the
Requestclass publicand changes few methods of
RestHighLevelClientto be protected.closes #26455