-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Issue 67: Update Elasticsearch and improve geoshape indexing #79
Issue 67: Update Elasticsearch and improve geoshape indexing #79
Conversation
How did you test these changes? In other words, do the tests perform better now or at least the same that they were before changing the version? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
took a look. looks good. where can i see the test results?
|
||
@Override | ||
public boolean hasNegation() { | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on why this is not supported. I think it is because when shapes intersect at their edges, part of the shapes are on the outside.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A JanusGraphPredicate can only have a negation if it can be defined directly as another JanusGraphPredicate. This isn't possible for Geo.Contains (e.g. negation is not Geo.WITHIN for example).
Note this is a separate question from whether the negation of the Contains spatial predicate exists mathematically, though I'm not sure it does because of subtleties in the definition.
https://en.wikipedia.org/wiki/DE-9IM#Spatial_predicates
http://lin-ear-th-inking.blogspot.com/2007/06/subtleties-of-ogc-covers-spatial.html
@@ -23,7 +23,7 @@ | |||
*/ | |||
public enum ParameterType { | |||
|
|||
MAPPING("mapping"), INDEX_POSITION("index-pos"), MAPPED_NAME("mapped-name"), STATUS("status"); | |||
MAPPING("mapping"), INDEX_POSITION("index-pos"), MAPPED_NAME("mapped-name"), STATUS("status"), INDEX_GEO_MAX_LEVELS("index-geo-max-levels"), INDEX_GEO_DIST_ERROR_PCT("index-geo-dist-error-pct"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one line for each enum and comment on each?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah good call. I documented the ones I added but wasn't sure about the others.
String inlineScriptsKey = "script.inline"; | ||
String inlineScriptsVal = settings.get(inlineScriptsKey); | ||
if (null != inlineScriptsVal && !"true".equals(inlineScriptsVal)) { | ||
log.warn("JanusGraph requires Elasticsearch inline scripting. Setting {} to true. " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requirement sounds like a user error. loglevel=error and fail fast?
@@ -387,12 +414,22 @@ private static String getDualMappingName(String key) { | |||
return key + STRING_MAPPING_SUFFIX; | |||
} | |||
|
|||
private static Map<Geo, ShapeRelation> spatialPredicates() { | |||
return Collections.unmodifiableMap(Stream.of( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return ImmutableMap.of(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better thanks
queryBuilder = QueryBuilders.geoBoundingBoxQuery(key).bottomRight(southwest.getLatitude(), northeast.getLongitude()).topLeft(northeast.getLatitude(), southwest.getLongitude()); | ||
} else if (shape.getType() == Geoshape.Type.POLYGON) { | ||
queryBuilder = QueryBuilders.geoPolygonQuery(key); | ||
for (int i=0; i<shape.size(); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stream.map.forEach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done but note while Geoshape has a get(int i) method it is not a Collection so doesn't support stream directly if that's what you were after.
gf.createLineString(new Coordinate[] {new Coordinate(x-1,y-1), new Coordinate(x,y)})})); | ||
}; | ||
|
||
private Function<Geoshape,Geoshape> makeMultiPolygon = place -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static final?
return Geoshape.geoshape(gf.createMultiPoint(new Coordinate[] {new Coordinate(x,y), new Coordinate(x+1,y+1)})); | ||
}; | ||
|
||
private Function<Geoshape,Geoshape> makeMultiLine = place -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static final?
return Geoshape.line(Arrays.asList(new double[][] {{x,y},{x,y+1},{x+1,y+1},{x+1,y}})); | ||
}; | ||
|
||
private Function<Geoshape,Geoshape> makeMultiPoint = place -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static final?
return Geoshape.polygon(Arrays.asList(new double[][] {{x,y},{x,y+1},{x+1,y+1},{x+1,y},{x,y},{x,y}})); | ||
}; | ||
|
||
private Function<Geoshape,Geoshape> makeLine = place -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static final?
} | ||
|
||
private Function<Geoshape,Geoshape> makePoly = place -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static final? it seems like these functions dont depend on member state, so lets make it clear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea
da289e2
to
c229ff1
Compare
@amcp Thanks for the review. All updates are there with a couple exceptions as mentioned above. All tests pass in this branch with the additional application of the fix in #76. Attached is relevant output from a test run that completed two days ago but note this was on a combined master branch which also included other open PRs (#76, #77, #78 and #81).
|
c229ff1
to
e001b59
Compare
Can we establish a 72 hour comment period on this PR? Would like to get these changes merged in. |
@@ -64,6 +64,11 @@ | |||
<artifactId>spatial4j</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>com.vividsolutions</groupId> | |||
<artifactId>jts</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a LGPL library. Are there alternatives? It looks like the code is only used in test cases. Maybe we can make it an optional, off-by-default, inclusion via a Maven build flag or profile. TinkerPop had to do something similar for Neo4j.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JTS is currently a non-optional dependency in janusgraph-solr and is distributed with JanusGraph (and previously Titan) releases.
What could be done is to mark it as optional in the poms so it's available for tests and users with requirements for relevant features (Solr, Geoshapes, etc.) can manually add it to their lib directory.
Given it's already a dependency can this be a separate issue or is it a blocker here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the longer term solution might be a new Eclipse Foundation project aiming to replace JTS.
https://github.com/locationtech/jts
https://www.locationtech.org/projects/technology.jts
https://www.locationtech.org/proposals/jts-topology-suite
It's being developed by LocationTech, who also develop Spatial4j, through-which the JTS dependency comes in to Solr/JanusGraph. I'd guess the roadmap is for a stable new-JTS release and then a Spatial4j update/release migrating to same, at which point JanusGraph could update as well (likely involving a Solr version upgrade).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha, you're right @sjudeng - had no idea that dependency was around for so long.
Good find on that new project. any indications that they are close to a release? It seems like they've been at it for a while.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see anything on a release timeline. There's recent mailing list activity but there was a gap for a few months before that. Also I don't think a full migration in JanusGraph would be possible until Spatial4j and Solr were updated to use JTS 2. The good news is the core Spatial4j developer, who I think also is a core contributor on the Solr spatial connectors, has been active on the JTS 2 mailing list so he is at least aware of the effort.
import com.spatial4j.core.shape.jts.JtsGeometry; | ||
import com.vividsolutions.jts.geom.Coordinate; | ||
import com.vividsolutions.jts.geom.Geometry; | ||
import com.vividsolutions.jts.geom.GeometryFactory; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of the little I saw in janusgraph-es, it will require some not-minor refactoring, and probably we need to add new StoreFeatures like supportsGeo. Interesting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pluradj Put another way, I think removing JTS dependency in this PR is way out of scope for this PR. Titan/JanusGraph depended on JTS up until today, so I think it is OK to upgrade these versions and then figure out a way off of current JTS. Sound OK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few specialty functions in there that use JTS. I'll need to verify/test but if it's made an optional dependency it would still compile and be used in tests but wouldn't be included in distributions (at least not through janusgraph-core). Is this acceptable? In this way users of relevant (e.g. polygon) features could manually add JTS to their JanusGraph classpath but other users would be unaffected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amcp OK, I think we're in agreement. In the current code, you can use Solr without JTS as long as you don't define a Solr schema with it, although the example schema.xml includes it. Updating the docs and making that dependency optional will be handled with #133.
@sjudeng JTS wouldn't be included in distributions -- that's what we're shooting for. Users would need to add the jar themselves to take advantage of those features, and the docs alerts them of the licensing restrictions they're agreeing to, similar to what is in the Solr wiki.
e001b59
to
2818c12
Compare
Updated to make JTS optional in janusgraph-core as discussed. When JTS is not on the path geoshape functions involving point, circle and rectangle shapes will still work as expected. User must add JTS to their classpath when use of line and polygon shapes is required, as indicated in documentation. All tests are passing.
Note during testing JTS was also marked optional in janusgraph-solr to ensure proper behavior building/running distribution as well as unit tests, but this PR does not include that update which will be handled under #133. |
@sjudeng after building the distribution zip, Elasticsearch isn't starting with |
2818c12
to
f3be16d
Compare
@pluradj Just pushed updates to resolve this issue. Are there automated integration tests that catch this or do you just test manually? When building a release this execution runs, which seems to be at least a pseudo integration test on the distribution. Maybe something similar could be added to run |
@sjudeng I tested it manually, but automation sounds like a good idea. The fix worked fine on Ubuntu, and I was able to connect through the Gremlin Server remotely with the Gremlin Console. I'm getting this error in the
It's odd that the stack trace is getting chopped. I tried manually cleaning up some of the jar conflicts, |
@pluradj The workaround for the JarHell issue was to override it in JanusGraph as described in the notes above. I think the original JarHell class is getting picked up first under OSX for whatever reason. To test would you change bin/elasticsearch.in.sh and replace the ES_CLASSPATH="`dirname $0`/../lib/janusgraph-es-0.1.0-SNAPSHOT.jar:`dirname $0`/../lib/*" If this works I'll look at getting that updated (obviously without the hard coded version). |
7a735b3
to
f4bb6a3
Compare
f4bb6a3
to
6963319
Compare
6963319
to
2660ed5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some more comments
<type>zip</type> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>*</groupId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a comment as to the meaning of these *
.travis.yml
Outdated
|
||
matrix: | ||
- MODULE='berkeleyje' | ||
- MODULE='cassandra' | ||
- MODULE='es' ARGS='-DthreadCount=1' | ||
- MODULE='es' ARGS='-DthreadCount=1 -Delasticsearch.dist.version=2.4.4' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use a variable for es version here and below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this all out into an elasticsearch2
profile, which I think resolves this.
docs/versions.txt
Outdated
@@ -13,5 +13,7 @@ JanusGraph. | |||
[options="header"] | |||
|========================== | |||
| JanusGraph | Cassandra | HBase | Elasticsearch | Solr | TinkerPop | |||
| 0.1.0 | 1.2.z, 2.0.z, 2.1.z | 0.94.z, 0.96.z, 0.98.z, 1.0.z | 1.5.z | 5.2.z | 3.0.z | |||
| 0.1.0 | 1.2.z, 2.0.z, 2.1.z | 0.98.z, 1.0.z, 1.2.z | 2.z, 5.z* | 5.2.z | 3.2.z |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this PR is about ES why are we changing HBase versions? if we forgot to do it then its ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this concern being addressed? Always nice to move away from 0.94 but should it be addressed by this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased to pick up #176 and now just updating the ES version here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more comments
docs/elasticsearch.txt
Outdated
=============================== | ||
Beginning with Elasticsearch 5.0 JanusGraph uses sandboxed https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting-painless.html[Painless scripts] for inline updates, which are enabled by default in Elasticsearch 5.x. | ||
|
||
Using JanusGraph with Elasticsearch 2.x requires enabling Groovy inline scripting by setting `script.engine.groovy.inline.update` to `true` on the Elasticsearch cluster (see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting-security.html#enable-dynamic-scripting[dynamic scripting documentation] for more information). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like we need 2.4+, update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean in terms of compatibility? All 2.x releases are supported. Test suite has been run against 2.4.4, 2.3.5, 2.2.2, 2.1.2, 2.0.2 (though see note at the top regarding limitations in versions before 2.3.0).
@@ -190,6 +189,9 @@ public ElasticSearchIndex(Configuration config) throws BackendException { | |||
maxResultsSize = config.get(INDEX_MAX_RESULT_SET_SIZE); | |||
log.debug("Configured ES query result set max size to {}", maxResultsSize); | |||
|
|||
scriptLang = client.getMajorVersion() < 5 ? "groovy" : "painless"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pull 5 out into constant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or even better into enum ESMajorVersion where it would contain TWO and FIVE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done (good idea)
@@ -194,6 +194,11 @@ public void close() throws IOException { | |||
client.close(); | |||
} | |||
|
|||
@Override | |||
public int getMajorVersion() { | |||
return 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use the MajorVersion enum described above
@@ -76,6 +82,29 @@ public void close() throws IOException { | |||
} | |||
|
|||
@Override | |||
public int getMajorVersion() { | |||
if (majorVersion == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to un-nest code lets check majorVersion != null first and return, and then do the logic to compute it
@@ -223,4 +252,19 @@ private Response performRequest(String method, String path, byte[] requestData) | |||
return response; | |||
} | |||
|
|||
@JsonIgnoreProperties(ignoreUnknown=true) | |||
private static final class ClusterInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add a comment as to why we have a map to represent versions? is this class consistent with a remote ES deployment model? thinking along the lines of AWS ES where JanusGraph may not be in control of the cluster topology with its configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version is obtained from a ES request with default path (e.g. http://localhost:9200/
). The response is expected to be of the form below and this class is used for unmarshalling to avoid nested Map
casts. But would AWS ES (or other deployment models) not return a response of this form to this request? I can look into this more.
{
"name" : "X29X896",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "ROrFjDOqSIGLBDsZhxFOcA",
"version" : {
"number" : "5.2.1",
"build_hash" : "db0d481",
"build_date" : "2017-02-09T22:05:32.386Z",
"build_snapshot" : false,
"lucene_version" : "6.4.1"
},
"tagline" : "You Know, for Search"
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amcp I confirmed that AWS ES does support requests with default path (e.g. https://search-estest-*.*.es.amazonaws.com/) and the response is formatted as expected and shown above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more comments
Map<String,Object> doc = new HashMap<>(); | ||
for (IndexEntry e : mutation.getAdditions()) { | ||
KeyInformation keyInformation = informations.get(storename).get(e.field); | ||
switch (keyInformation.getCardinality()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you only care about one value then maybe say if keyInformation.getCardinality != SINGLE continue and get rid of the switch-case-break
@@ -563,6 +569,22 @@ private String getAdditionScript(KeyInformation.IndexRetriever informations, Str | |||
return script.toString(); | |||
} | |||
|
|||
private Map<String,Object> getAdditionDoc(KeyInformation.IndexRetriever informations, String storename, IndexMutation mutation) throws PermanentBackendException { | |||
Map<String,Object> doc = new HashMap<>(); | |||
for (IndexEntry e : mutation.getAdditions()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe switch to a .stream().map().filter().collect()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did take out the switch but I wasn't able to get a clean implementation using stream API in this case. Let me know if you want me to take another crack at it.
String lang = script.get("lang"); | ||
update.setScript(new Script(inline, ScriptService.ScriptType.INLINE, lang, null)); | ||
} | ||
if (request.getSource().containsKey("doc")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
externalize doc to constant
UpdateRequestBuilder update = client.prepareUpdate(indexName, type, id); | ||
if (request.getSource().containsKey("script")) { | ||
Map<String,String> script = ((Map<String, String>) request.getSource().get("script")); | ||
String inline = script.get("inline"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
externalize inline to constant
Script script = new Script(inline, ScriptService.ScriptType.INLINE, null, null); | ||
UpdateRequestBuilder update = client.prepareUpdate(indexName, type, id).setScript(script); | ||
UpdateRequestBuilder update = client.prepareUpdate(indexName, type, id); | ||
if (request.getSource().containsKey("script")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
externalize script to constant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, externalized "script", "inline" and "doc.
if (request.getSource().containsKey("script")) { | ||
Map<String,String> script = ((Map<String, String>) request.getSource().get("script")); | ||
String inline = script.get("inline"); | ||
String lang = script.get("lang"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
externalize lang to constant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a glance and LGTM. But for full correctness it definitely need to rely on the tests since code changes are just too large.
Signed-off-by: sjudeng <[email protected]>
…ygon geometries, and support for geoIntersect, geoContains and geoDisjoint predicates. Support for indexing multi-point/line/polygon properties is implemented but untested. Signed-off-by: sjudeng <[email protected]>
… is compatible with both ES 2.x and 5.x servers because the ES 5.x REST API is backwards-compatible with 2.x. Split ES version properties out by search builder version (elasticsearch.version), REST client version (elasticsearch.rest.version), and the distribution version to use in testing and releases (elasticsearch.dist.version). Create Transport test variants for all test suites. Update Travis build matrix to include janusgraph-es test suite variants for ES 5.x and 2.x as well as REST and transport clients. Signed-off-by: sjudeng <[email protected]>
…x. Painless scripts are enabled by default and do not require custom dynamic scripting configuration to use. Added property, elasticsearch.groovy.inline, to control whether Groovy dynamic scripting is enabled on embedded ES instances. Signed-off-by: sjudeng <[email protected]>
2660ed5
to
83a1da2
Compare
…ing content. Signed-off-by: sjudeng <[email protected]>
83a1da2
to
230382c
Compare
@amcp, @jerryjch, @pluradj, @hsaputra, @twilmes, @dylanht - I think this PR has been sufficiently reviewed at this point. There were two early commits that were reviewed/approved by three other committers and the more recent commits have been approved by two other committers. All issues have been mitigated and there has been a community discussion+vote on the dev list. In particular on the issue of ES 1.x support, the 0.1 release branch will maintain the original ES v1.5.1 support. Unless there are any objections I would like to merge this PR later this week. |
+1 @sjudeng |
…e-upgrade Issue 67: Update Elasticsearch and improve geoshape indexing
…e-upgrade Issue 67: Update Elasticsearch and improve geoshape indexing
Features
Compatibility
* Pre-2.3.0 versions do not support indexing non-point geometries or contains operations and require additional dependency exclusions to satisfy dependency convergence checks
Breaking Changes
janusgraph.sh
). In all other cases Elasticsearch must already be running to use with JanusGraph. As a mitigation and convenience, an Elasticsearch distribution is packaged with JanusGraph. See the updated JanusGraph Elasticsearch documentation page for more information.org.janusgraph.hadoop.serialize.JanusGraphKryoRegistrator
is defined in the janusgraph-hadoop-core module to avoid adding an (unshaded) Kryo dependency to janusgraph-core. This serializer must be registered with Spark when indexing Geoshape properties.Dependency Updates
Dependencies were updated as shown in the following table.
Additional Elasticsearch version properties were added to allow changing the version separately for different parts of the system.
Testing
Updated project configuration to download and run a local Elasticsearch instance during testing and updated all janusgraph-es test suites to use same. A separate property,
elasticsearch.dist.version
, can be used to run the janusgraph-es test suites against both 2.x and 5.x ES distributions. Tests were updated to use REST client by default but separate Transport client subclasses were also added. This allows transport client testing when using ES 2.x but not 5.x (since transport client connections to ES 5.x are not currently supported).The following entries in the Travis build matrix show the cases required to test all supported ES major distribution and client variants. Note that
elasticsearch.groovy.inline
must be set totrue
when testing against ES 2.x distributions.All tests are passing.