You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2016/02/15 20:47:46 UTC
[1/2] incubator-tinkerpop git commit: Fixed a bug where
DetachedVertexProperties lose transient reference to their Vertex and thus,
can't be attached. Without rewriting the serialization format for
DetachedVertexProperty, a simple 'don't try and attach'
Repository: incubator-tinkerpop
Updated Branches:
refs/heads/master dac0f48ac -> 2326b0405
Fixed a bug where DetachedVertexProperties lose transient reference to their Vertex and thus, can't be attached. Without rewriting the serialization format for DetachedVertexProperty, a simple 'don't try and attach' in OLAP is the solution. A future solution will be to keep the Vertex ID around in some fashion, but for tp31, this would change the binary schema of DetachedVertexProperty.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/ba0b7b74
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/ba0b7b74
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/ba0b7b74
Branch: refs/heads/master
Commit: ba0b7b74b1305cef6d30a9a551fadf711abcc99d
Parents: 94a14cc
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Feb 15 12:34:06 2016 -0700
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Feb 15 12:34:06 2016 -0700
----------------------------------------------------------------------
CHANGELOG.asciidoc | 1 +
.../process/computer/traversal/step/map/ComputerResultStep.java | 3 ++-
.../tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java | 2 +-
.../tinkerpop/gremlin/structure/util/detached/DetachedVertex.java | 2 +-
4 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ba0b7b74/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index e6b013a..3e4cea3 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/
TinkerPop 3.1.2 (NOT OFFICIALLY RELEASED YET)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* Fixed an `Property` attach bug that shows up in serialization-based `GraphComputer` implementations.
* Fixed a pom.xml bug where Gremlin Console/Server were not pulling the latest Neo4j 2.3.2.
* Fixed bug in "round robin" load balancing in `gremlin-driver` where requests were wrongly being sent to the same host.
* Prevented the spawning of unneeded reconnect tasks in `gremlin-driver` when a host goes offline.
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ba0b7b74/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/ComputerResultStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/ComputerResultStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/ComputerResultStep.java
index 012d3f6..1855c30 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/ComputerResultStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/ComputerResultStep.java
@@ -32,6 +32,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.util.ReducingBarrierS
import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
import org.apache.tinkerpop.gremlin.structure.Element;
import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Property;
import org.apache.tinkerpop.gremlin.structure.util.Attachable;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
@@ -85,7 +86,7 @@ public final class ComputerResultStep<S> extends AbstractStep<S, S> implements B
}
final Traverser.Admin<S> traverser = this.traversers.next();
- if (this.attachElements && (traverser.get() instanceof Attachable))
+ if (this.attachElements && (traverser.get() instanceof Attachable) && !(traverser.get() instanceof Property))
traverser.set((S) ((Attachable<Element>) traverser.get()).attach(Attachable.Method.get(graph)));
return traverser;
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ba0b7b74/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java
index 42ab74b..314caf1 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java
@@ -87,7 +87,7 @@ final class GryoSerializers {
@Override
public void write(final Kryo kryo, final Output output, final Property property) {
- kryo.writeClassAndObject(output, DetachedFactory.detach(property));
+ kryo.writeClassAndObject(output, property instanceof VertexProperty ? DetachedFactory.detach((VertexProperty) property, true) : DetachedFactory.detach(property));
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ba0b7b74/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java
index 1c5ee92..419003a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java
@@ -81,7 +81,7 @@ public class DetachedVertex extends DetachedElement<Vertex> implements Vertex {
this.properties = new HashMap<>();
properties.entrySet().stream().forEach(
entry -> this.properties.put(entry.getKey(), ((List<Map<String, Object>>) entry.getValue()).stream()
- .map(m -> (Property) new DetachedVertexProperty<>(m.get(ID), entry.getKey(), m.get(VALUE), (Map<String, Object>) m.getOrDefault(PROPERTIES, new HashMap<>()), this))
+ .map(m -> new DetachedVertexProperty<>(m.get(ID), entry.getKey(), m.get(VALUE), (Map<String, Object>) m.getOrDefault(PROPERTIES, new HashMap<>()), this))
.collect(Collectors.toList())));
}
}
[2/2] incubator-tinkerpop git commit: merged TINKERPOP-1105 fix.
Posted by ok...@apache.org.
merged TINKERPOP-1105 fix.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/2326b040
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/2326b040
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/2326b040
Branch: refs/heads/master
Commit: 2326b04050ddb075065668e8504cc4c7ea06dd29
Parents: dac0f48 ba0b7b7
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Feb 15 12:47:42 2016 -0700
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Feb 15 12:47:42 2016 -0700
----------------------------------------------------------------------
CHANGELOG.asciidoc | 1 +
.../process/computer/traversal/step/map/ComputerResultStep.java | 2 +-
.../tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java | 2 +-
.../tinkerpop/gremlin/structure/util/detached/DetachedVertex.java | 3 +--
4 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2326b040/CHANGELOG.asciidoc
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2326b040/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/ComputerResultStep.java
----------------------------------------------------------------------
diff --cc gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/ComputerResultStep.java
index 86dce91,1855c30..d2b1af7
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/ComputerResultStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/ComputerResultStep.java
@@@ -107,11 -129,4 +107,11 @@@ public final class ComputerResultStep<S
public Set<TraverserRequirement> getRequirements() {
return EnumSet.of(TraverserRequirement.OBJECT);
}
+
+ @Override
+ public ComputerResultStep<S> clone() {
- final ComputerResultStep<S> clone = (ComputerResultStep<S>)super.clone();
++ final ComputerResultStep<S> clone = (ComputerResultStep<S>) super.clone();
+ clone.currentIterator = EmptyIterator.instance();
+ return clone;
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2326b040/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java
----------------------------------------------------------------------
diff --cc gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java
index 1c5ee92,419003a..371c091
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java
@@@ -22,7 -22,7 +22,6 @@@ import org.apache.tinkerpop.gremlin.str
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Element;
import org.apache.tinkerpop.gremlin.structure.Graph;
--import org.apache.tinkerpop.gremlin.structure.Property;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;