Jest (Rest) based ElasticSearch implementation#67
Jest (Rest) based ElasticSearch implementation#67LosD wants to merge 16 commits intoapache:masterfrom LosD:master
Conversation
Nowhere close to being done
ElasticSearchDataContext compiles now (no guaranteed, of course), the directly supporting cast as well.
All querying seems to work now, except for group by. However, that works if standalone, or only run with the other query tests, so I'm pretty sure that is because a failure in the drop/create/update/etf tests leaves the ES in a bad state.
I'm a bit unsure about the workaround for LazilyParsedNumber. What about BitDecimal and BigInteger?
Avoids confusion by prefixing all Jest-based classes with Jest. Also makes Jest ES available in DataContextFactory.
Makes system more independent from ES version
|
I gave this one a quick scan through, and for me it's looking quite OK. I have some remarks:
I hope this is useful feedback. A lot of code to review - and a very big contribution, so thanks! |
|
Had to lock the HTTP port. I chose 9292 as that is pretty high in normal ES range, so improbable to be used already.
|
Okay, I think I fixed the Travis error (we'll see soon), and I made the wrapper for the Exception. There's still the ES dependency issue remaining, though |
|
D'oh. License. |
|
Fixed. Also found another silly mistake: I had used |
There was a problem hiding this comment.
'logger' is never used
|
Looks like very solid work. One general thought I have is to not prefix the classes with "Jest" though, but rather with "Rest". That way we don't tie it too much with the underlying library used, but rather with the protocol towards ElasticSearch. It will probably be more recognizable to ES users and it will also allow us to switch library and so on without changing class names. |
|
Please be aware that I raised another topic regarding this PR (and #68) in the mailing list under subject "[DISCUSS] ElasticSearch and MongoDB granularity" |
|
I called it "ElasticSearchRestDataContext", and changed the package name to "org.apache.metamodel.elasticsearch.rest". I left the other class names as-is, since they are very much tied to Jest, and aren't part of the API. |
|
👍 |
|
I would suggest to make the module restructure [1] already in this PR since it involves a bunch of code reuse. Or do you want to do that separately? What do you think? [1] discussed in mail thread "[DISCUSS] ElasticSearch and MongoDB granularity" on dev@metamodel |
|
Merging them now would be fine. |
|
Reading it again, that was pretty unclear. With "merging", I meant making a common module now. |
This adds a new package with common methods for both the native- and rest-based clients. I'm actually not super fond with the solution, but without completely restructuring the code (encapsulating all communication into objects with common interfaces), I think this is close to the best we can do.
|
Whoops, forgot to comment that I added a new commit (it would be wonderful if Github pinged subscribers on new commits): The Travis failure seems unrelated, it's Excel going crazy in Java 8 for some reason. |
|
LGTM! |
|
Yeah, I'm not exactly sure what happened with that folder. Fixed! |
There was a problem hiding this comment.
Unused imports now ;)
|
OK I think it's time to merge this ... Would you like to do the honors? I think maybe a squash first would be nice so that we have less commits on the master :-) |
|
HI Everyone I am implementing Jest client for Amazon client client connection.But iam getting this following error: Caused by: java.lang.ClassNotFoundException: org.apache.http.ssl.SSLContexts But when i R&D on this i had come to know that |
|
Hi @balubollam When does this happen? During initialization of the MetaModel context, or when querying it? |

After looking at updating ElasticSearch 2.0, I got a bit fed up with the compatibility issues marring our current ElasticSearch implementation.
Here is a suggestion for a REST-based ElasticSearch DataContext using Jest. It is still dependent on ElasticSearch, as it uses SearchSourceBuilder for generating the queries. This also means that we're not completely independent from ES version, but the problem is much more limited now, and run time replacement of the Jest library version should be possible. Until a working version of Jest 2.0.0 (The current SNAPSHOT seems to have some problems with HTTPClient and AsyncHttpClient compatibility), we can't really verify that, though.
Over time, we should be able to get rid of SearchSourceBuilder by generating the JSON manually.
Testing is still directly dependent on the ES version, as it is using the ES node client.
I didn't find a simple way to get the HTTP port from the node client, 9201 is currently assumed.
A worry is the workaround in JestElasticSearchUtils.getDataFromColumnType(). I'd love to find a better way. The issue is that GSON uses LazilyParsedNumber for all numbers, which is not recognized as a Number (by either Jest or GSON) when feeding back into Jest for updates.