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

Remove core Elasticsearch dependency #289

Merged
merged 1 commit into from
Jun 8, 2017
Merged

Conversation

sjudeng
Copy link
Contributor

@sjudeng sjudeng commented May 29, 2017

This PR removes support for the Elasticsearch Transport client and updates to manually build request objects instead of using the ES Java API. This allows for the removal of the org.elasicsearch:elasticsearch dependency and the addition of compatibility shims that resolve deprecation warnings under Elasticsearch 5.x and also restores support for Elasticsearch 1.x without requiring custom builds.

Related issue is #92.

@janusgraph-bot janusgraph-bot added the cla: yes This PR is compliant with the CLA label May 29, 2017
@mbrukman mbrukman requested review from amcp and jerryjch May 29, 2017 18:26
Copy link

@amcp amcp left a comment

Choose a reason for hiding this comment

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

minor comments, lgtm

@@ -13,7 +13,7 @@ JanusGraph.
[options="header"]
|==========================
| JanusGraph | Cassandra | HBase | Bigtable | Elasticsearch | Solr | TinkerPop
| 0.1.0 | 1.2.z, 2.0.z, 2.1.z | 0.98.z, 1.0.z, 1.1.z, 1.2.z | 0.9.z | 2.z,5.z* | 5.2.z | 3.2.z |
| 0.1.0 | 1.2.z, 2.0.z, 2.1.z | 0.98.z, 1.0.z, 1.1.z, 1.2.z | 0.9.z | 1.z*,2.z,5.z | 5.2.z | 3.2.z |
Copy link

Choose a reason for hiding this comment

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

was this an omission the first time we updated versions.txt? did we always support 1.z*?

Copy link
Contributor Author

@sjudeng sjudeng May 30, 2017

Choose a reason for hiding this comment

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

@amcp No we dropped support for 1.z with previous update (#79) and this PR restores it. But unit tests require manually starting a 1.z ES instance so it'll be tough to maintain the support for new features/updates. Should we take 1.z back out of the table?

Copy link

Choose a reason for hiding this comment

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

Version compatibility is different from ease of testing, so I think 1.z can stay in this list.

import static org.janusgraph.diskstorage.es.ElasticSearchConstants.ES_INLINE_KEY;
import static org.janusgraph.diskstorage.es.ElasticSearchConstants.ES_LANG_KEY;
import static org.janusgraph.diskstorage.es.ElasticSearchConstants.ES_SCRIPT_KEY;
import static org.janusgraph.diskstorage.es.ElasticSearchConstants.*;
Copy link

Choose a reason for hiding this comment

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

please import the individual constants, unless the above were all of them.

default:
throw new IllegalArgumentException("Unexpected relation: " + numRel);
}
} else if (value instanceof String) {
Mapping map = getStringMapping(informations.get(key));
String fieldName = key;
if (map==Mapping.TEXT && !janusgraphPredicate.toString().startsWith("CONTAINS"))
Copy link

Choose a reason for hiding this comment

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

externalize the CONTAINS constant here and everyhwere

switch (shape.getType()) {
case CIRCLE:
Geoshape.Point center = shape.getPoint();
sb = ShapeBuilder.newCircleBuilder().center(center.getLongitude(), center.getLatitude()).radius(shape.getRadius(), DistanceUnit.KILOMETERS);
geo = ImmutableMap.of(ES_TYPE_KEY, "circle",
"coordinates", ImmutableList.of(center.getLongitude(), center.getLatitude()),
Copy link

Choose a reason for hiding this comment

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

externalize coordinates constant here and everyhwere


@Override
public Map<String,Object> createKeywordMapping() {
return ImmutableMap.of(ES_TYPE_KEY, "string", ES_INDEX_KEY, "not_analyzed");
Copy link

Choose a reason for hiding this comment

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

externalize string constant

@sjudeng
Copy link
Contributor Author

sjudeng commented Jun 6, 2017

Please hold off on merging this until #233 is merged as I'd like to rebase and resolve conflicts here.

@amcp
Copy link

amcp commented Jun 7, 2017

@sjudeng ok to rebase and resolve conflicts here.

…arch:elasticsearch dependency. Remove support for Transport client. Add compatibility shims to resolve deprecation warnings under ES5 and restore support for ES1. Support testing against an external ES instance.

Signed-off-by: sjudeng <[email protected]>
@sjudeng sjudeng merged commit 59c055f into JanusGraph:master Jun 8, 2017
bwatson-rti-org pushed a commit to bwatson-rti-org/janusgraph that referenced this pull request Mar 9, 2019
Remove core Elasticsearch dependency
micpod pushed a commit to micpod/janusgraph that referenced this pull request Nov 5, 2019
Remove core Elasticsearch dependency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This PR is compliant with the CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants