Skip to content

Remove core Elasticsearch dependency - #289

Merged
sjudeng merged 1 commit into
JanusGraph:masterfrom
sjudeng:no-es
Jun 8, 2017
Merged

Remove core Elasticsearch dependency#289
sjudeng merged 1 commit into
JanusGraph:masterfrom
sjudeng:no-es

Conversation

@sjudeng

@sjudeng sjudeng commented May 29, 2017

Copy link
Copy Markdown
Contributor

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

@amcp amcp left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

minor comments, lgtm

Comment thread docs/versions.txt
|==========================
| 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
Copy Markdown

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*?

@sjudeng sjudeng May 30, 2017

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown

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
Copy Markdown

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.

} else if (value instanceof String) {
Mapping map = getStringMapping(informations.get(key));
String fieldName = key;
if (map==Mapping.TEXT && !janusgraphPredicate.toString().startsWith("CONTAINS"))

Copy link
Copy Markdown

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

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
Copy Markdown

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
Copy Markdown

Choose a reason for hiding this comment

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

externalize string constant

@sjudeng

sjudeng commented Jun 6, 2017

Copy link
Copy Markdown
Contributor Author

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

@amcp

amcp commented Jun 7, 2017

Copy link
Copy Markdown

@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 <sjudeng@users.noreply.github.com>
@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