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

Make RestHighLevelClient's Request class public #26627

Merged
merged 3 commits into from
Sep 20, 2017

Conversation

tlrx
Copy link
Member

@tlrx tlrx commented Sep 13, 2017

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 #26455

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
Copy link
Member

@cbuescher cbuescher left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM

@colings86 colings86 added v5.6.2 and removed v5.6.1 labels Sep 14, 2017
@@ -77,20 +79,42 @@

public class RequestTests extends ESTestCase {

public void testConstructor() throws Exception {
Copy link
Member

Choose a reason for hiding this comment

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

can we also test the visibility of the class and its constructor by checking their modifiers?

@tlrx
Copy link
Member Author

tlrx commented Sep 15, 2017

Thanks all for your reviews!

@javanna I just added tests for what your requested. Can you please have another look?

@@ -17,19 +17,17 @@
* under the License.
*/

package org.elasticsearch.client;
package org.elasticsearch.client.extension;
Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

No other reason, just to make it more obvious that CustomRestClient extends the high level rest client while being located in a different package.

Copy link
Member

Choose a reason for hiding this comment

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

Please let's not make an arbitrary (and inconsistent) change like that. We do not use "extension" packages anywhere else.

@tlrx
Copy link
Member Author

tlrx commented Sep 19, 2017

@javanna I updated the code and remove the extension package. Do you want to have another look?

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

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

LGTM thanks @tlrx

@tlrx
Copy link
Member Author

tlrx commented Sep 20, 2017

elasticsearch-ci retest this please

@tlrx tlrx merged commit b3819e7 into elastic:master Sep 20, 2017
tlrx added a commit that referenced this pull request Sep 20, 2017
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.
tlrx added a commit that referenced this pull request Sep 20, 2017
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.
tlrx added a commit that referenced this pull request Sep 20, 2017
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.
@tlrx tlrx deleted the rest-high-level-client-ext branch September 20, 2017 10:10
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Sep 20, 2017
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RestHighLevelClient cannot be sub classed outside of the org.elasticsearch.client package.
7 participants