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 2015/04/21 22:11:13 UTC
incubator-tinkerpop git commit: removed StarGraph.addTo(). Added
VertexWritableTest to make sure serialization of the writable preserves form.
Added some JavaDoc here and there.
Repository: incubator-tinkerpop
Updated Branches:
refs/heads/attachable_work a3381b3dd -> e6236935d
removed StarGraph.addTo(). Added VertexWritableTest to make sure serialization of the writable preserves form. Added some JavaDoc here and there.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/e6236935
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/e6236935
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/e6236935
Branch: refs/heads/attachable_work
Commit: e6236935dd8714686016a5492697bf710fa97400
Parents: a3381b3
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Apr 21 14:11:09 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Apr 21 14:11:09 2015 -0600
----------------------------------------------------------------------
.../gremlin/structure/util/Attachable.java | 20 ++--
.../gremlin/structure/util/star/StarGraph.java | 52 +++++------
.../hadoop/structure/io/VertexWritable.java | 7 +-
.../io/graphson/GraphSONRecordReader.java | 7 +-
.../structure/io/gryo/GryoRecordReader.java | 7 +-
.../hadoop/structure/io/VertexWritableTest.java | 96 ++++++++++++++++++++
.../tinkergraph/structure/TinkerGraphTest.java | 15 +--
7 files changed, 145 insertions(+), 59 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e6236935/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/Attachable.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/Attachable.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/Attachable.java
index 7ec5417..7c07687 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/Attachable.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/Attachable.java
@@ -26,19 +26,26 @@ import org.apache.tinkerpop.gremlin.structure.Property;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-import java.util.ArrayList;
import java.util.Iterator;
-import java.util.List;
import java.util.Optional;
import java.util.function.BiFunction;
/**
* An interface that provides methods for detached properties and elements to be re-attached to the {@link Graph}.
+ * There are two general ways in which they can be attached: {@link Method#GET} or {@link Method#CREATE}.
+ * A {@link Method#GET} will find the property/element at the host location and return it.
+ * A {@link Method#CREATE} will create the property/element at the host location and return it.
*
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
* @author Stephen Mallette (http://stephen.genoprime.com)
*/
public interface Attachable<T> {
+ /**
+ * Get the raw object trying to be attached.
+ *
+ * @return the raw object to attach
+ */
public T get();
public default T attach(final Vertex hostVertex, final Method method) throws IllegalStateException {
@@ -269,14 +276,9 @@ public interface Attachable<T> {
public static Vertex createVertex(final Attachable<Vertex> attachableVertex, final Graph hostGraph) {
final Vertex baseVertex = attachableVertex.get();
- final List<Object> keyValues = new ArrayList<>();
- keyValues.add(org.apache.tinkerpop.gremlin.process.traversal.T.id);
- keyValues.add(baseVertex.id());
- keyValues.add(org.apache.tinkerpop.gremlin.process.traversal.T.label);
- keyValues.add(baseVertex.label());
- final Vertex vertex = hostGraph.addVertex(keyValues.toArray());
+ final Vertex vertex = hostGraph.addVertex(org.apache.tinkerpop.gremlin.process.traversal.T.id, baseVertex.id(), org.apache.tinkerpop.gremlin.process.traversal.T.label, baseVertex.label());
baseVertex.properties().forEachRemaining(vp -> {
- final VertexProperty vertexProperty = vertex.property(VertexProperty.Cardinality.list, vp.key(), vp.value());
+ final VertexProperty vertexProperty = vertex.property(VertexProperty.Cardinality.list, vp.key(), vp.value(), org.apache.tinkerpop.gremlin.process.traversal.T.id, vp.id());
vp.properties().forEachRemaining(p -> vertexProperty.property(p.key(), p.value()));
});
return vertex;
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e6236935/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
index 57d5bb9..20141c2 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
@@ -36,9 +36,6 @@ import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.structure.util.Attachable;
import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
import java.util.ArrayList;
@@ -67,15 +64,21 @@ public final class StarGraph implements Graph {
private final Map<Object, Map<String, Object>> edgeProperties = new HashMap<>();
private final Map<Object, Map<String, Object>> metaProperties = new HashMap<>();
+ private StarGraph() {
+ }
+
public StarVertex getStarVertex() {
return this.starVertex;
}
@Override
public Vertex addVertex(final Object... keyValues) {
- return null == this.starVertex ?
- this.starVertex = new StarVertex(ElementHelper.getIdValue(keyValues).get(), ElementHelper.getLabelValue(keyValues).get()) :
- new StarAdjacentVertex(ElementHelper.getIdValue(keyValues).get());
+ if (null == this.starVertex) {
+ this.starVertex = new StarVertex(ElementHelper.getIdValue(keyValues).get(), ElementHelper.getLabelValue(keyValues).get());
+ ElementHelper.attachProperties(this.starVertex, VertexProperty.Cardinality.list, keyValues); // TODO: is this smart? I say no... cause vertex property ids are not preserved.
+ return this.starVertex;
+ } else
+ return new StarAdjacentVertex(ElementHelper.getIdValue(keyValues).get());
}
@Override
@@ -165,28 +168,23 @@ public final class StarGraph implements Graph {
public static StarGraph of(final Vertex vertex) {
final StarGraph starGraph = new StarGraph();
- StarGraph.addTo(starGraph, DetachedFactory.detach(vertex, true));
- vertex.edges(Direction.BOTH).forEachRemaining(edge -> StarGraph.addTo(starGraph, DetachedFactory.detach(edge, true)));
- return starGraph;
- }
-
- public static Vertex addTo(final StarGraph graph, final DetachedVertex detachedVertex) {
- if (null != graph.starVertex)
- return null;
- graph.addVertex(T.id, detachedVertex.id(), T.label, detachedVertex.label());
- detachedVertex.properties().forEachRemaining(detachedVertexProperty -> {
- final VertexProperty<?> starVertexProperty = graph.starVertex.property(VertexProperty.Cardinality.list, detachedVertexProperty.key(), detachedVertexProperty.value(), T.id, detachedVertexProperty.id());
- detachedVertexProperty.properties().forEachRemaining(detachedVertexPropertyProperty -> starVertexProperty.property(detachedVertexPropertyProperty.key(), detachedVertexPropertyProperty.value()));
+ final StarVertex starVertex = (StarVertex) starGraph.addVertex(T.id, vertex.id(), T.label, vertex.label());
+ vertex.properties().forEachRemaining(vp -> {
+ final VertexProperty<?> starVertexProperty = starVertex.property(VertexProperty.Cardinality.list, vp.key(), vp.value(), T.id, vp.id());
+ vp.properties().forEachRemaining(p -> starVertexProperty.property(p.key(), p.value()));
+ });
+ vertex.edges(Direction.IN).forEachRemaining(edge -> {
+ final Edge starEdge = starVertex.addInEdge(edge.label(), starGraph.addVertex(T.id, edge.outVertex().id()), T.id, edge.id());
+ edge.properties().forEachRemaining(p -> starEdge.property(p.key(), p.value()));
});
- return graph.starVertex;
- }
- public static Edge addTo(final StarGraph graph, final DetachedEdge edge) {
- final Edge starEdge = !graph.starVertex.id().equals(edge.inVertex().id()) ?
- graph.starVertex.addOutEdge(edge.label(), edge.inVertex(), T.id, edge.id()) :
- graph.starVertex.addInEdge(edge.label(), edge.outVertex(), T.id, edge.id());
- edge.properties().forEachRemaining(property -> starEdge.property(property.key(), property.value()));
- return starEdge;
+ vertex.edges(Direction.OUT).forEachRemaining(edge -> {
+ if (!ElementHelper.areEqual(starVertex, edge.inVertex())) { // only do a self loop once
+ final Edge starEdge = starVertex.addOutEdge(edge.label(), starGraph.addVertex(T.id, edge.inVertex().id()), T.id, edge.id());
+ edge.properties().forEachRemaining(p -> starEdge.property(p.key(), p.value()));
+ }
+ });
+ return starGraph;
}
protected Long generateId() {
@@ -406,7 +404,7 @@ public final class StarGraph implements Graph {
@Override
public Vertex element() {
- return starVertex;
+ return StarGraph.this.starVertex;
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e6236935/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritable.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritable.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritable.java
index fad244b..40057aa 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritable.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritable.java
@@ -20,10 +20,11 @@ package org.apache.tinkerpop.gremlin.hadoop.structure.io;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.io.WritableUtils;
-import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.util.Attachable;
import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
+import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -66,8 +67,8 @@ public final class VertexWritable implements Writable, Serializable {
final ByteArrayInputStream inputStream = new ByteArrayInputStream(WritableUtils.readCompressedByteArray(input));
final StarGraph starGraph = StarGraph.open();
return gryoReader.readVertex(inputStream, Direction.BOTH,
- detachedVertex -> StarGraph.addTo(starGraph, detachedVertex),
- detachedEdge -> StarGraph.addTo(starGraph, detachedEdge));
+ detachedVertex -> detachedVertex.attach(starGraph, Attachable.Method.CREATE),
+ detachedEdge -> detachedEdge.attach(starGraph, Attachable.Method.CREATE));
} catch (final IOException e) {
throw new IllegalStateException(e.getMessage(), e);
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e6236935/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordReader.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordReader.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordReader.java
index 87cfbb8..a46494d 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordReader.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordReader.java
@@ -25,13 +25,14 @@ import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.lib.input.LineRecordReader;
import org.apache.tinkerpop.gremlin.hadoop.Constants;
import org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritable;
-import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONReader;
+import org.apache.tinkerpop.gremlin.structure.util.Attachable;
import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge;
import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
+import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -64,8 +65,8 @@ public class GraphSONRecordReader extends RecordReader<NullWritable, VertexWrita
return false;
final StarGraph starGraph = StarGraph.open();
- final Function<DetachedVertex, Vertex> vertexMaker = detachedVertex -> StarGraph.addTo(starGraph, detachedVertex);
- final Function<DetachedEdge, Edge> edgeMaker = detachedEdge -> StarGraph.addTo(starGraph, detachedEdge);
+ final Function<DetachedVertex, Vertex> vertexMaker = detachedVertex -> detachedVertex.attach(starGraph, Attachable.Method.CREATE);
+ final Function<DetachedEdge, Edge> edgeMaker = detachedEdge -> detachedEdge.attach(starGraph, Attachable.Method.CREATE);
try (InputStream in = new ByteArrayInputStream(this.lineRecordReader.getCurrentValue().getBytes())) {
this.vertexWritable.set(this.hasEdges ?
this.graphsonReader.readVertex(in, Direction.BOTH, vertexMaker, edgeMaker) :
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e6236935/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/GryoRecordReader.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/GryoRecordReader.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/GryoRecordReader.java
index 2eb94ea..5fff9c8 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/GryoRecordReader.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/GryoRecordReader.java
@@ -29,14 +29,15 @@ import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.lib.input.FileSplit;
import org.apache.tinkerpop.gremlin.hadoop.Constants;
import org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritable;
-import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoMapper;
import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoReader;
+import org.apache.tinkerpop.gremlin.structure.util.Attachable;
import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge;
import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
+import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -130,8 +131,8 @@ public class GryoRecordReader extends RecordReader<NullWritable, VertexWritable>
if (terminatorLocation >= TERMINATOR.length) {
final StarGraph starGraph = StarGraph.open();
- final Function<DetachedVertex, Vertex> vertexMaker = detachedVertex -> StarGraph.addTo(starGraph, detachedVertex);
- final Function<DetachedEdge, Edge> edgeMaker = detachedEdge -> StarGraph.addTo(starGraph, detachedEdge);
+ final Function<DetachedVertex, Vertex> vertexMaker = detachedVertex -> detachedVertex.attach(starGraph, Attachable.Method.CREATE);
+ final Function<DetachedEdge, Edge> edgeMaker = detachedEdge -> detachedEdge.attach(starGraph, Attachable.Method.CREATE);
try (InputStream in = new ByteArrayInputStream(output.toByteArray())) {
this.vertexWritable.set(this.hasEdges ?
this.gryoReader.readVertex(in, Direction.BOTH, vertexMaker, edgeMaker) :
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e6236935/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritableTest.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritableTest.java b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritableTest.java
new file mode 100644
index 0000000..532b750
--- /dev/null
+++ b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritableTest.java
@@ -0,0 +1,96 @@
+/*
+ *
+ * * Licensed to the Apache Software Foundation (ASF) under one
+ * * or more contributor license agreements. See the NOTICE file
+ * * distributed with this work for additional information
+ * * regarding copyright ownership. The ASF licenses this file
+ * * to you under the Apache License, Version 2.0 (the
+ * * "License"); you may not use this file except in compliance
+ * * with the License. You may obtain a copy of the License at
+ * *
+ * * http://www.apache.org/licenses/LICENSE-2.0
+ * *
+ * * Unless required by applicable law or agreed to in writing,
+ * * software distributed under the License is distributed on an
+ * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * * KIND, either express or implied. See the License for the
+ * * specific language governing permissions and limitations
+ * * under the License.
+ *
+ */
+
+package org.apache.tinkerpop.gremlin.hadoop.structure.io;
+
+import org.apache.tinkerpop.gremlin.FeatureRequirementSet;
+import org.apache.tinkerpop.gremlin.process.traversal.T;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.junit.Test;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.util.HashSet;
+import java.util.Set;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public class VertexWritableTest {
+
+ private static VertexWritable byteClone(final VertexWritable vertexWritable) {
+ try {
+ final VertexWritable clone = new VertexWritable();
+ final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ vertexWritable.write(new DataOutputStream(outputStream));
+ outputStream.flush();
+ clone.readFields(new DataInputStream(new ByteArrayInputStream(outputStream.toByteArray())));
+ return clone;
+ } catch (final Exception e) {
+ throw new IllegalStateException(e.getMessage(), e);
+ }
+ }
+
+ @Test
+ public void shouldHashAndEqualCorrectly() {
+ final StarGraph graph = StarGraph.open();
+ final Vertex v = graph.addVertex(T.id, 1, T.label, Vertex.DEFAULT_LABEL);
+ final Set<VertexWritable> set = new HashSet<>();
+ for (int i = 0; i < 100; i++) {
+ set.add(new VertexWritable(v));
+ }
+ assertEquals(1, set.size());
+ }
+
+ @Test
+ public void shouldHaveEqualVertexWritableAndInternalVertex() throws Exception {
+ final StarGraph graph = StarGraph.open();
+ final Vertex v = graph.addVertex(T.id, 1, T.label, Vertex.DEFAULT_LABEL);
+ final VertexWritable vw = new VertexWritable(v);
+ assertEquals(vw, vw);
+ assertEquals(vw, byteClone(vw));
+ assertEquals(v, byteClone(vw).get());
+ }
+
+ @Test
+ @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
+ public void shouldConstructVertexWritableWithCorrectByteRepresentation() {
+ final StarGraph graph = StarGraph.open();
+ final Vertex v = graph.addVertex(T.id, 1, T.label, Vertex.DEFAULT_LABEL, "test", "123");
+ v.property(VertexProperty.Cardinality.list, "name", "marko", "acl", "private");
+ final VertexWritable vw = byteClone(new VertexWritable(v));
+
+ assertEquals(v.id(), vw.get().id());
+ assertEquals(v.label(), vw.get().label());
+ assertEquals("123", vw.get().value("test"));
+ assertEquals(2, IteratorUtils.count(vw.get().properties()));
+ assertEquals("marko", vw.get().value("name"));
+ assertEquals("private", vw.get().property("name").value("acl"));
+ // TODO: advance this
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e6236935/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
index f27787c..5c7838c 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
@@ -21,10 +21,8 @@ package org.apache.tinkerpop.gremlin.tinkergraph.structure;
import org.apache.commons.io.FileUtils;
import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
import org.apache.tinkerpop.gremlin.TestHelper;
-import org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLIo;
import org.apache.tinkerpop.gremlin.algorithm.generator.DistributionGenerator;
import org.apache.tinkerpop.gremlin.algorithm.generator.PowerLawDistribution;
-import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
import org.apache.tinkerpop.gremlin.process.traversal.T;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
@@ -34,12 +32,12 @@ import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.Operator;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.io.GraphReader;
+import org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLIo;
import org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLWriter;
import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONMapper;
import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONWriter;
import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoReader;
import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoWriter;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
@@ -144,17 +142,6 @@ public class TinkerGraphTest {
@Test
@Ignore
- public void testPlay3() throws Exception {
- TinkerGraph tg = TinkerFactory.createModern();
- StarGraph sg = StarGraph.open();
- tg.vertices().forEachRemaining(v -> StarGraph.addTo(sg, DetachedFactory.detach(v,true)));
- tg.vertices(1).next().edges(Direction.BOTH).forEachRemaining(e -> StarGraph.addTo(sg, DetachedFactory.detach(e, true)));
- sg.vertices().forEachRemaining(System.out::println);
- sg.edges().forEachRemaining(System.out::println);
- }
-
- @Test
- @Ignore
public void testPlay4() throws Exception {
Graph graph = TinkerGraph.open();
graph.io(GraphMLIo.build()).read("/Users/marko/software/tinkerpop/tinkerpop3/data/grateful-dead.xml");