Skip to content

Commit

Permalink
Update to TinkerPop 3.2.7
Browse files Browse the repository at this point in the history
- handle empty hasId
- removed dead code

Fixes JanusGraph#844

Signed-off-by: Robert Dale <robdale@gmail.com>
  • Loading branch information
robertdale committed Jan 25, 2018
1 parent 8dcd91c commit f47ddea
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ public void run() {
if (!Threads.waitForCompletion(processors,TIMEOUT_MS)) log.error("Processor did not terminate in time");

cleanup();
job.workerIterationEnd(metrics);
try {
job.workerIterationEnd(metrics);
} catch (IllegalArgumentException e) {
// https://github.com/JanusGraph/janusgraph/pull/891
log.warn("Exception occurred processing worker iteration end. See PR 891.", e);
}

if (interrupted) {
setException(new InterruptedException("Scanner got interrupted"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ static void foldInIds(final HasStepFolder janusgraphStep, final Traversal.Admin<
while (true) {
if (currentStep instanceof HasContainerHolder) {
final HasContainerHolder hasContainerHolder = (HasContainerHolder) currentStep;
final Set<Object> ids = new HashSet<>();
final GraphStep graphStep = (GraphStep) janusgraphStep;
// HasContainer collection that we get back is immutable so we keep track of which containers
// need to be deleted after they've been folded into the JanusGraphStep and then remove them from their
Expand All @@ -114,16 +113,6 @@ static void foldInIds(final HasStepFolder janusgraphStep, final Traversal.Admin<
stepLabels.forEach(janusgraphStep::addLabel);
// this has container is no longer needed because its ids will be folded into the JanusGraphStep
removableHasContainers.add(hasContainer);
if (!ids.isEmpty()) {
// intersect ids (shouldn't this be handled in TP GraphStep.processHasContainerIds?)
ids.stream().filter(id -> Arrays.stream(graphStep.getIds()).noneMatch(id::equals))
.collect(Collectors.toSet()).forEach(ids::remove);
if (ids.isEmpty()) {
return;
}
} else {
Arrays.stream(graphStep.getIds()).forEach(ids::add);
}
}
});
if (!removableHasContainers.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ public JanusGraphStep(final GraphStep<S, E> originalStep) {
super(originalStep.getTraversal(), originalStep.getReturnClass(), originalStep.isStartStep(), originalStep.getIds());
originalStep.getLabels().forEach(this::addLabel);
this.setIteratorSupplier(() -> {
if (this.ids != null && this.ids.length > 0) {
if (this.ids == null) {
return Collections.emptyIterator();
}
else if (this.ids.length > 0) {
final Graph graph = (Graph)traversal.asAdmin().getGraph().get();
return iteratorList((Iterator)graph.vertices(this.ids));
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<properties>
<janusgraph.compatible.versions>0.1.0,0.1.1,0.2.0</janusgraph.compatible.versions>
<titan.compatible-versions>1.0.0,1.1.0-SNAPSHOT</titan.compatible-versions>
<tinkerpop.version>3.2.6</tinkerpop.version>
<tinkerpop.version>3.2.7</tinkerpop.version>
<junit.version>4.12</junit.version>
<mrunit.version>1.1.0</mrunit.version>
<cassandra.version>2.1.18</cassandra.version>
Expand Down

0 comments on commit f47ddea

Please sign in to comment.