Skip to content

Conversation

@tlrx
Copy link
Member

@tlrx tlrx commented Jul 26, 2017

This PR adds some notes in the Java API and Reference documentation that mention the existence of the Java High Level Rest Client.

It also adds a migration page in the high level client documentation. It is definitively perfectible but that's a start.

Copy link
Member

Choose a reason for hiding this comment

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

It isn't really a Create, Read, Update, or Delete operation so maybe it should be in its own test just for naming's sake.

Copy link
Member

Choose a reason for hiding this comment

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

I'd s/always//.

Copy link
Member

Choose a reason for hiding this comment

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

It doesn't use Java serialization, right? I mean, it uses a our home grown binary serialization.

Copy link
Member Author

Choose a reason for hiding this comment

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

Absolutely... I had trouble to find the right phrase and in the end it ended with something wrong :/

Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't say it is perfect - it is acceptable, but it ties the user application quite tightly to Elasticsearch.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree - I changed perfect for acceptable. Let me know if you think the whole sentence should be reworded.

Copy link
Member

Choose a reason for hiding this comment

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

missing space.

Copy link
Member

Choose a reason for hiding this comment

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

It has more than two transitive dependencies because it has Elasticsearch's dependencies too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh right - I replaced two transitive dependencies by dependencies as I find it simpler to understand.

@tlrx
Copy link
Member Author

tlrx commented Jul 27, 2017

@nik9000 Thanks a lot for your feedback. I applied some changes, but I'd love to hear if you find this migration page useful or not or if you think something is missing here. I also think that @javanna has some ideas on it.

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.

thanks for working on this, I left some comments

Copy link
Member

Choose a reason for hiding this comment

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

which sends HTTP requests instead of using the transport layer.

Copy link
Member

Choose a reason for hiding this comment

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

Now is actually a good time to deprecate it :) Feel free to make that change already here or mention that it is deprecated in 6.0

Copy link
Member

Choose a reason for hiding this comment

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

add a link to hl client docs?

Copy link
Member

Choose a reason for hiding this comment

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

add a link to it?

Copy link
Member

Choose a reason for hiding this comment

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

s/many/various kinds of

Copy link
Member

Choose a reason for hiding this comment

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

I wonder what you mean by compatible here. There are breaking changes, and that's why we are working on this page?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I agree it's not clear. I rephrased that, I just wanted to say that you can use the client to connect to a cluster in version 5.6.0+.

Copy link
Member

Choose a reason for hiding this comment

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

s/must/can ?

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this warning is needed. Isn't this kind of implicit given that you never specify the cluster name when specifying the hosts?

Copy link
Member Author

Choose a reason for hiding this comment

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

By writing this, I wanted to "promote" what I think would be a good practice... on the other side, nothing prevent the user to configure multiple hosts from different clusters :( Let's remove this.

Copy link
Member

Choose a reason for hiding this comment

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

must be replaced is enough?

Copy link
Member

Choose a reason for hiding this comment

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

Adapting existing code ?

Copy link
Member

Choose a reason for hiding this comment

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

gut feeling: these motivations are more for a blogpost that for our docs maybe? I would rather focus on how to migrate here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know - I added this to add some context around why it's good to migrate, since it's easy to miss a blog post. But I can remove this whole section if you really feel it should not be here.

Copy link
Member

Choose a reason for hiding this comment

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

I like it. Maybe it should be in a blog post as well, but I like explaining it here as too.

Copy link
Member

Choose a reason for hiding this comment

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

ok let's keep it

@tlrx
Copy link
Member Author

tlrx commented Jul 28, 2017

Thanks @javanna for your review, it is very helpful. I tried to complete the documentation following your indications. I'm pretty sure it still need some work but it gets closer, I hope.

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.

I added a few more comments, but indeed it is getting close. Great work @tlrx thanks a lot

Copy link
Member

Choose a reason for hiding this comment

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

to replace the TransportClient (remove "the usage")

Copy link
Member

Choose a reason for hiding this comment

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

s/forces/force

Copy link
Member

Choose a reason for hiding this comment

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

This may make people think the the high level client doesn't depend on Elasticsearch, also we don't mention security and wanting to have REST a single entrypoing for a cluster. Shall we link https://www.elastic.co/blog/state-of-the-official-elasticsearch-java-clients that mentions all that and keep this explanation a bit shorter?

We could say:

The TransportClient has been part of Elasticsearch since its very first commit. It is a special client as it uses the transport protocol to communicate with Elasticsearch, which causes compatibility problems if the client is not on the same version as the Elasticsearch instances it talks to.

We released a low-level REST client in 2016, which is based on the well known Apache HTTP client and it allows to communicate with an Elasticsearch cluster in any version using HTTP. On top of that we released the high-level REST client which is based on the low-level client but takes care of request marshalling and response un-marshalling.

Have a look at (here the link) to know more about these changes.

Copy link
Member Author

@tlrx tlrx Jul 28, 2017

Choose a reason for hiding this comment

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

This may make people think the the high level client doesn't depend on Elasticsearch,

Right, this can be a bit confusing and it's hard to resume all the motivations in a single paragraph.

I just borrow your text and let's go!

Copy link
Member

Choose a reason for hiding this comment

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

we should probably more clear on whether it's fine to talk from 5.6.0 to 6.0.0. I guess it is, but new apis won't be known to the client this way. Also breaking changes to the API may cause unexpected results.

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we have to put the whole maven dependency here, especially given that it's the old one. Maybe we can just say replace the o.e.client:transport dependency with... ?

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 invert the two bullet points, leaving request builders first?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure

Copy link
Member

Choose a reason for hiding this comment

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

I would move this paragraph to the end of the page

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense. Should I also move "Checking Cluster Health using the Low-Level REST Client" down?

Copy link
Member

Choose a reason for hiding this comment

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

yes please

Copy link
Member

Choose a reason for hiding this comment

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

and can therefore be used to call the APIs that are not yet supported by the high level client.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point too

Copy link
Member

Choose a reason for hiding this comment

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

More importantly

Copy link
Member

Choose a reason for hiding this comment

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

The RestHighLevelClient supports the same request and response object as the TransportClient, but exposes slightly different methods to send the requests.

@javanna javanna changed the title [Docs] Add migration notes for the high-level rest client [Docs] Add migration notes for the high-level rest client and deprecate transport client Jul 28, 2017
@javanna javanna changed the title [Docs] Add migration notes for the high-level rest client and deprecate transport client [Docs] Add migration notes for the high-level rest client Jul 31, 2017
@tlrx
Copy link
Member Author

tlrx commented Jul 31, 2017

Thanks @javanna - changes have been merged. I'll merge this unless you have more suggestions.

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.

I left a couple of comments, but this looks great, thanks a lot

Copy link
Member

Choose a reason for hiding this comment

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

I would rephrase this:

The Java High Level Rest Client requires Java 1.8 and depends on Elasticsearch core. The client version is the same as the Elasticsearch version that the client was developed for. The High Level Client is backwards compatible but can only communicate with Elasticsearch version 5.5 and onwards. The High Level Client is forward compatible as well, meaning that it supports communicating with a later version of Elasticsearch than the one it was developed for. It is recommended to upgrade the High Level Client when upgrading the Elasticsearch cluster to a new major version, as REST API breaking changes may cause unexpected results, and newly added APIs will only be supported by the newer version of the client. The client should be updated last, once all of the nodes in the cluster have been upgraded.

I am now thinking if this should go somewhere else rather than in the migration guide.

Copy link
Member Author

Choose a reason for hiding this comment

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

Awesome. I added your text in a "Compatibility" section in the usage page. I created a link in the migration guide to this page.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds great thank you

Copy link
Member

Choose a reason for hiding this comment

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

depends

Copy link
Member

Choose a reason for hiding this comment

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

typically initialized as follows

Copy link
Member Author

Choose a reason for hiding this comment

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

oops sorry, it shouldn't have been reverted

Copy link
Member

Choose a reason for hiding this comment

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

great!!!!

Copy link
Member

Choose a reason for hiding this comment

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

objects

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.

6 participants