You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/04/24 14:48:37 UTC

incubator-tinkerpop git commit: Reworked writeGraph for gryo and regenerated kryo files.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/refactor-io cbba981fa -> cab778d78


Reworked writeGraph for gryo and regenerated kryo files.

Format for writeGraph is now pure adjacency list which is the same as doing writeVertices.  Graph variables are not persisted under this format.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/cab778d7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/cab778d7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/cab778d7

Branch: refs/heads/refactor-io
Commit: cab778d7889b1f5cfb60d59d761f5f578f8d4ebe
Parents: cbba981
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Apr 24 08:46:59 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 24 08:46:59 2015 -0400

----------------------------------------------------------------------
 data/grateful-dead-vertices.kryo                | Bin 975214 -> 391510 bytes
 data/grateful-dead.kryo                         | Bin 493339 -> 391510 bytes
 data/tinkerpop-classic-vertices.kryo            | Bin 1179 -> 1129 bytes
 data/tinkerpop-classic.kryo                     | Bin 765 -> 1129 bytes
 data/tinkerpop-crew-vertices.kryo               | Bin 2575 -> 1949 bytes
 data/tinkerpop-crew.kryo                        | Bin 1858 -> 1949 bytes
 data/tinkerpop-modern-vertices.kryo             | Bin 1295 -> 1181 bytes
 data/tinkerpop-modern.kryo                      | Bin 825 -> 1181 bytes
 .../gremlin/structure/io/gryo/GryoReader.java   | 289 +++----------------
 .../gremlin/structure/io/gryo/GryoWriter.java   |  18 +-
 .../gremlin/structure/util/Attachable.java      |  62 ++++
 .../gremlin/util/iterator/IteratorUtils.java    |   6 +
 gremlin-server/data/sample.kryo                 | Bin 4781767 -> 2817115 bytes
 .../gremlin/AbstractGraphProvider.java          |   3 -
 .../process/traversal/step/map/MatchTest.java   |   6 +-
 .../tinkerpop/gremlin/structure/IoTest.java     |  64 ++--
 .../io/gryo/grateful-dead-vertices.kryo         | Bin 975214 -> 391510 bytes
 .../structure/io/gryo/grateful-dead.kryo        | Bin 493339 -> 391510 bytes
 .../io/gryo/tinkerpop-classic-vertices.kryo     | Bin 1179 -> 1129 bytes
 .../structure/io/gryo/tinkerpop-classic.kryo    | Bin 765 -> 1129 bytes
 .../io/gryo/tinkerpop-crew-vertices.kryo        | Bin 2575 -> 1949 bytes
 .../structure/io/gryo/tinkerpop-crew.kryo       | Bin 1858 -> 1949 bytes
 .../io/gryo/tinkerpop-modern-vertices.kryo      | Bin 1295 -> 1181 bytes
 .../structure/io/gryo/tinkerpop-modern.kryo     | Bin 825 -> 1181 bytes
 24 files changed, 132 insertions(+), 316 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/data/grateful-dead-vertices.kryo
----------------------------------------------------------------------
diff --git a/data/grateful-dead-vertices.kryo b/data/grateful-dead-vertices.kryo
index 30677c3..01b4fea 100644
Binary files a/data/grateful-dead-vertices.kryo and b/data/grateful-dead-vertices.kryo differ

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/data/grateful-dead.kryo
----------------------------------------------------------------------
diff --git a/data/grateful-dead.kryo b/data/grateful-dead.kryo
index 31a3ebd..01b4fea 100644
Binary files a/data/grateful-dead.kryo and b/data/grateful-dead.kryo differ

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/data/tinkerpop-classic-vertices.kryo
----------------------------------------------------------------------
diff --git a/data/tinkerpop-classic-vertices.kryo b/data/tinkerpop-classic-vertices.kryo
index e01dc10..aaeac55 100644
Binary files a/data/tinkerpop-classic-vertices.kryo and b/data/tinkerpop-classic-vertices.kryo differ

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/data/tinkerpop-classic.kryo
----------------------------------------------------------------------
diff --git a/data/tinkerpop-classic.kryo b/data/tinkerpop-classic.kryo
index 10e10cc..aaeac55 100644
Binary files a/data/tinkerpop-classic.kryo and b/data/tinkerpop-classic.kryo differ

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/data/tinkerpop-crew-vertices.kryo
----------------------------------------------------------------------
diff --git a/data/tinkerpop-crew-vertices.kryo b/data/tinkerpop-crew-vertices.kryo
index 8bf40c7..7ef6941 100644
Binary files a/data/tinkerpop-crew-vertices.kryo and b/data/tinkerpop-crew-vertices.kryo differ

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/data/tinkerpop-crew.kryo
----------------------------------------------------------------------
diff --git a/data/tinkerpop-crew.kryo b/data/tinkerpop-crew.kryo
index 9ac8b4c..7ef6941 100644
Binary files a/data/tinkerpop-crew.kryo and b/data/tinkerpop-crew.kryo differ

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/data/tinkerpop-modern-vertices.kryo
----------------------------------------------------------------------
diff --git a/data/tinkerpop-modern-vertices.kryo b/data/tinkerpop-modern-vertices.kryo
index 2ff096d..eef5b3e 100644
Binary files a/data/tinkerpop-modern-vertices.kryo and b/data/tinkerpop-modern-vertices.kryo differ

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/data/tinkerpop-modern.kryo
----------------------------------------------------------------------
diff --git a/data/tinkerpop-modern.kryo b/data/tinkerpop-modern.kryo
index 3feda2e..eef5b3e 100644
Binary files a/data/tinkerpop-modern.kryo and b/data/tinkerpop-modern.kryo differ

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java
index 1f261f2..f0ee1a9 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java
@@ -20,32 +20,25 @@ package org.apache.tinkerpop.gremlin.structure.io.gryo;
 
 import org.apache.tinkerpop.gremlin.structure.util.Attachable;
 import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import org.apache.tinkerpop.shaded.kryo.Kryo;
 import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.Direction;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.io.GraphReader;
 import org.apache.tinkerpop.gremlin.structure.util.batch.BatchGraph;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
 import org.apache.tinkerpop.shaded.kryo.io.Input;
-import org.apache.tinkerpop.shaded.kryo.io.Output;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.UUID;
 import java.util.function.Function;
 
 /**
@@ -65,15 +58,12 @@ public class GryoReader implements GraphReader {
     private final String vertexIdKey;
     private final String edgeIdKey;
 
-    private final File tempFile;
-
-    private GryoReader(final File tempFile, final long batchSize,
+    private GryoReader(final long batchSize,
                        final String vertexIdKey, final String edgeIdKey,
                        final GryoMapper gryoMapper) {
         this.kryo = gryoMapper.createMapper();
         this.vertexIdKey = vertexIdKey;
         this.edgeIdKey = edgeIdKey;
-        this.tempFile = tempFile;
         this.batchSize = batchSize;
     }
 
@@ -81,22 +71,31 @@ public class GryoReader implements GraphReader {
     public Iterator<Vertex> readVertices(final InputStream inputStream,
                                          final Function<Attachable<Vertex>, Vertex> vertexMaker,
                                          final Function<Attachable<Edge>, Edge> edgeMaker) throws IOException {
-        final Input input = new Input(inputStream);
-        return new Iterator<Vertex>() {
-            @Override
-            public boolean hasNext() {
-                return !input.eof();
-            }
+        return new VertexInputIterator(new Input(inputStream), vertexMaker);
+    }
+
+    private class VertexInputIterator implements Iterator<Vertex> {
+        private final Input input;
+        private final Function<Attachable<Vertex>, Vertex> vertexMaker;
 
-            @Override
-            public Vertex next() {
-                try {
-                    return readVertexInternal(vertexMaker, input);
-                } catch (Exception ex) {
-                    throw new RuntimeException(ex);
-                }
+        public VertexInputIterator(final Input input, final Function<Attachable<Vertex>, Vertex> vertexMaker) {
+            this.input = input;
+            this.vertexMaker = vertexMaker;
+        }
+
+        @Override
+        public boolean hasNext() {
+            return !input.eof();
+        }
+
+        @Override
+        public Vertex next() {
+            try {
+                return readVertexInternal(vertexMaker, input);
+            } catch (Exception ex) {
+                throw new RuntimeException(ex);
             }
-        };
+        }
     }
 
     @Override
@@ -120,90 +119,14 @@ public class GryoReader implements GraphReader {
         return readVertexInternal(vertexMaker, input);
     }
 
-    private Vertex readVertexInternal(final Function<Attachable<Vertex>, Vertex> vertexMaker, final Input input) throws IOException {
-        readHeader(input);
-        final StarGraph starGraph = kryo.readObject(input, StarGraph.class);
-
-        // read the terminator
-        kryo.readClassAndObject(input);
-
-        return vertexMaker.apply(starGraph.getStarVertex());
-    }
-
     @Override
     public void readGraph(final InputStream inputStream, final Graph graphToWriteTo) throws IOException {
-        final Input input = new Input(inputStream);
-        readHeader(input);
-
-        final BatchGraph graph;
-        try {
-            // will throw an exception if not constructed properly
-            graph = BatchGraph.build(graphToWriteTo)
-                    .vertexIdKey(vertexIdKey)
-                    .edgeIdKey(edgeIdKey)
-                    .bufferSize(batchSize).create();
-        } catch (Exception ex) {
-            throw new IOException("Could not instantiate BatchGraph wrapper", ex);
-        }
-
-        try (final Output output = new Output(new FileOutputStream(tempFile))) {
-            final boolean supportedMemory = input.readBoolean();
-            if (supportedMemory) {
-                // if the graph that serialized the data supported sideEffects then the sideEffects needs to be read
-                // to advance the reader forward.  if the graph being read into doesn't support the sideEffects
-                // then we just setting the data to sideEffects.
-                final Map<String, Object> memMap = (Map<String, Object>) kryo.readObject(input, HashMap.class);
-                if (graphToWriteTo.features().graph().variables().supportsVariables()) {
-                    final Graph.Variables variables = graphToWriteTo.variables();
-                    memMap.forEach(variables::set);
-                }
-            }
-
-            final boolean hasSomeVertices = input.readBoolean();
-            if (hasSomeVertices) {
-                final List<Object> vertexArgs = new ArrayList<>();
-                while (!input.eof()) {
-                    final DetachedVertex current = (DetachedVertex) kryo.readClassAndObject(input);
-                    appendToArgList(vertexArgs, T.id, current.id());
-                    appendToArgList(vertexArgs, T.label, current.label());
-
-                    final Vertex v = graph.addVertex(vertexArgs.toArray());
-                    vertexArgs.clear();
-                    current.properties().forEachRemaining(p -> createVertexProperty(graphToWriteTo, v, p));
-
-                    // the gio file should have been written with a direction specified
-                    final boolean hasDirectionSpecified = input.readBoolean();
-                    final Direction directionInStream = kryo.readObject(input, Direction.class);
-                    final Direction directionOfEdgeBatch = kryo.readObject(input, Direction.class);
-
-                    // graph serialization requires that a direction be specified in the stream and that the
-                    // direction of the edges be OUT
-                    if (!hasDirectionSpecified || directionInStream != Direction.OUT || directionOfEdgeBatch != Direction.OUT)
-                        throw new IllegalStateException(String.format("Stream must specify edge direction and that direction must be %s", Direction.OUT));
-
-                    // if there are edges then read them to end and write to temp, otherwise read what should be
-                    // the vertex terminator
-                    if (!input.readBoolean())
-                        kryo.readClassAndObject(input);
-                    else
-                        readToEndOfEdgesAndWriteToTemp(input, output);
-                }
-            }
-        } catch (Exception ex) {
-            throw new IOException(ex);
-        }
-        // done writing to temp
-
-        // start reading in the edges now from the temp file
-        try (final Input edgeInput = new Input(new FileInputStream(tempFile))) {
-            readFromTempEdges(edgeInput, graph);
-            graph.tx().commit();
-        } catch (Exception ex) {
-            ex.printStackTrace();
-            throw new IOException(ex);
-        } finally {
-            deleteTempFileSilently();
-        }
+        // dual pass - create all vertices and store to cache the ids.  then create edges.  as long as we don't
+        // have vertex labels in the output we can't do this single pass
+        final Map<Vertex,Vertex> cache = new HashMap<>();
+        IteratorUtils.iterate(new VertexInputIterator(new Input(inputStream), attachable ->
+                cache.put(attachable.get(), attachable.attach(graphToWriteTo, Attachable.Method.CREATE))));
+        cache.entrySet().forEach(kv -> kv.getKey().edges(Direction.OUT).forEachRemaining(e -> ((Attachable) e).attach(kv.getValue(), Attachable.Method.CREATE)));
     }
 
     @Override
@@ -211,81 +134,14 @@ public class GryoReader implements GraphReader {
         return clazz.cast(this.kryo.readClassAndObject(new Input(inputStream)));
     }
 
-    private static void createVertexProperty(final Graph graphToWriteTo, final Vertex v, final VertexProperty<Object> p) {
-        final List<Object> propertyArgs = new ArrayList<>();
-        if (graphToWriteTo.features().vertex().properties().supportsUserSuppliedIds())
-            appendToArgList(propertyArgs, T.id, p.id());
-        p.properties().forEachRemaining(it -> appendToArgList(propertyArgs, it.key(), it.value()));
-        v.property(VertexProperty.Cardinality.list, p.key(), p.value(), propertyArgs.toArray());
-    }
-
-    private static void appendToArgList(final List<Object> propertyArgs, final Object key, final Object val) {
-        propertyArgs.add(key);
-        propertyArgs.add(val);
-    }
-
-    private Vertex readVertex(final Direction directionRequested, final Function<Attachable<Vertex>, Vertex> vertexMaker,
-                              final Function<Attachable<Edge>, Edge> edgeMaker, final Input input) throws IOException {
-        if (null != directionRequested && null == edgeMaker)
-            throw new IllegalArgumentException("If a directionRequested is specified then an edgeAdder function should also be specified");
-
+    private Vertex readVertexInternal(final Function<Attachable<Vertex>, Vertex> vertexMaker, final Input input) throws IOException {
         readHeader(input);
+        final StarGraph starGraph = kryo.readObject(input, StarGraph.class);
 
-        final Vertex vertex = vertexMaker.apply((DetachedVertex) kryo.readClassAndObject(input));
-
-        final boolean streamContainsEdgesInSomeDirection = input.readBoolean();
-        if (!streamContainsEdgesInSomeDirection && directionRequested != null)
-            throw new IllegalStateException(String.format("The direction %s was requested but no attempt was made to serialize edges into this stream", directionRequested));
-
-        // if there are edges in the stream and the direction is not present then the rest of the stream is
-        // simply ignored
-        if (directionRequested != null) {
-            final Direction directionsInStream = kryo.readObject(input, Direction.class);
-            if (directionsInStream != Direction.BOTH && directionsInStream != directionRequested)
-                throw new IllegalStateException(String.format("Stream contains %s edges, but requesting %s", directionsInStream, directionRequested));
-
-            final Direction firstDirection = kryo.readObject(input, Direction.class);
-            if (firstDirection == Direction.OUT && (directionRequested == Direction.BOTH || directionRequested == Direction.OUT))
-                readEdges(input, edgeMaker);
-            else {
-                // requested direction in, but BOTH must be serialized so skip this.  the illegalstateexception
-                // prior to this IF should  have caught a problem where IN is not supported at all
-                if (firstDirection == Direction.OUT && directionRequested == Direction.IN)
-                    skipEdges(input);
-            }
-
-            if (directionRequested == Direction.BOTH || directionRequested == Direction.IN) {
-                // if the first direction was OUT then it was either read or skipped.  in that case, the marker
-                // of the stream is currently ready to read the IN direction. otherwise it's in the perfect place
-                // to start reading edges
-                if (firstDirection == Direction.OUT)
-                    kryo.readObject(input, Direction.class);
-
-                readEdges(input, edgeMaker);
-            }
-        }
-
-        return vertex;
-    }
-
-    private void readEdges(final Input input, final Function<Attachable<Edge>, Edge> edgeMaker) {
-        if (input.readBoolean()) {
-            Object next = kryo.readClassAndObject(input);
-            while (!next.equals(EdgeTerminator.INSTANCE)) {
-                edgeMaker.apply((DetachedEdge) next);
-                next = kryo.readClassAndObject(input);
-            }
-        }
-    }
+        // read the terminator
+        kryo.readClassAndObject(input);
 
-    private void skipEdges(final Input input) {
-        if (input.readBoolean()) {
-            Object next = kryo.readClassAndObject(input);
-            while (!next.equals(EdgeTerminator.INSTANCE)) {
-                // next edge to skip or the terminator
-                next = kryo.readClassAndObject(input);
-            }
-        }
+        return vertexMaker.apply(starGraph.getStarVertex());
     }
 
     private void readHeader(final Input input) throws IOException {
@@ -296,68 +152,11 @@ public class GryoReader implements GraphReader {
         input.readBytes(13);
     }
 
-
-    /**
-     * Reads through the all the edges for a vertex and writes the edges to a temp file which will be read later.
-     */
-    private void readToEndOfEdgesAndWriteToTemp(final Input input, final Output output) throws IOException {
-        Object next = kryo.readClassAndObject(input);
-        while (!next.equals(EdgeTerminator.INSTANCE)) {
-            kryo.writeClassAndObject(output, next);
-
-            // next edge or terminator
-            next = kryo.readClassAndObject(input);
-        }
-
-        // this should be the vertex terminator
-        kryo.readClassAndObject(input);
-
-        kryo.writeClassAndObject(output, EdgeTerminator.INSTANCE);
-        kryo.writeClassAndObject(output, VertexTerminator.INSTANCE);
-    }
-
-    /**
-     * Read the edges from the temp file and load them to the graph.
-     */
-    private void readFromTempEdges(final Input input, final Graph graphToWriteTo) {
-        final List<Object> edgeArgs = new ArrayList<>();
-        while (!input.eof()) {
-            // in this case the outId is the id assigned by the graph
-            Object next = kryo.readClassAndObject(input);
-            while (!next.equals(EdgeTerminator.INSTANCE)) {
-                final DetachedEdge detachedEdge = (DetachedEdge) next;
-                final Vertex vOut = graphToWriteTo.vertices(detachedEdge.outVertex().id()).next();
-                final Vertex inV = graphToWriteTo.vertices(detachedEdge.inVertex().id()).next();
-
-                detachedEdge.properties().forEachRemaining(p -> edgeArgs.addAll(Arrays.asList(p.key(), p.value())));
-
-                appendToArgList(edgeArgs, T.id, detachedEdge.id());
-
-                vOut.addEdge(detachedEdge.label(), inV, edgeArgs.toArray());
-
-                edgeArgs.clear();
-                next = kryo.readClassAndObject(input);
-            }
-
-            // vertex terminator
-            kryo.readClassAndObject(input);
-        }
-    }
-
-    @SuppressWarnings("ResultOfMethodCallIgnored")
-    private void deleteTempFileSilently() {
-        try {
-            tempFile.delete();
-        } catch (Exception ignored) {
-        }
-    }
-
     public static Builder build() {
         return new Builder();
     }
 
     public static class Builder implements ReaderBuilder<GryoReader> {
-        private File tempFile;
         private long batchSize = BatchGraph.DEFAULT_BUFFER_SIZE;
         private String vertexIdKey = T.id.getAccessor();
         private String edgeIdKey = T.id.getAccessor();
@@ -368,7 +167,6 @@ public class GryoReader implements GraphReader {
         private GryoMapper gryoMapper = GryoMapper.build().create();
 
         private Builder() {
-            this.tempFile = new File(UUID.randomUUID() + ".tmp");
         }
 
         /**
@@ -408,21 +206,8 @@ public class GryoReader implements GraphReader {
             return this;
         }
 
-        /**
-         * The reader requires a working directory to write temp files to.  If this value is not set, it will write
-         * the temp file to the local directory.
-         */
-        public Builder workingDirectory(final String workingDirectory) {
-            final File f = new File(workingDirectory);
-            if (!f.exists() || !f.isDirectory())
-                throw new IllegalArgumentException(String.format("%s is not a directory or does not exist", workingDirectory));
-
-            tempFile = new File(workingDirectory + File.separator + UUID.randomUUID() + ".tmp");
-            return this;
-        }
-
         public GryoReader create() {
-            return new GryoReader(tempFile, batchSize, this.vertexIdKey, this.edgeIdKey, this.gryoMapper);
+            return new GryoReader(batchSize, this.vertexIdKey, this.edgeIdKey, this.gryoMapper);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java
index 01189f0..b254df7 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java
@@ -54,23 +54,7 @@ public class GryoWriter implements GraphWriter {
 
     @Override
     public void writeGraph(final OutputStream outputStream, final Graph g) throws IOException {
-        final Output output = new Output(outputStream);
-        writeHeader(output);
-
-        final boolean supportsGraphVariables = g.features().graph().variables().supportsVariables();
-        output.writeBoolean(supportsGraphVariables);
-        if (supportsGraphVariables)
-            kryo.writeObject(output, new HashMap<>(g.variables().asMap()));
-
-        final Iterator<Vertex> vertices = g.vertices();
-        final boolean hasSomeVertices = vertices.hasNext();
-        output.writeBoolean(hasSomeVertices);
-        while (vertices.hasNext()) {
-            final Vertex v = vertices.next();
-            writeVertexToOutput(output, v, Direction.OUT);
-        }
-
-        output.flush();
+        writeVertices(outputStream, g.vertices(), Direction.BOTH);
     }
 
     public void writeVertices(final OutputStream outputStream, final Iterator<Vertex> vertexIterator, final Direction direction) throws IOException {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/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 5d50779..5b34f21 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
@@ -58,6 +58,68 @@ public interface Attachable<V> {
         return (V) method.apply(hostGraph).apply(this);
     }
 
+    public static class Method2 {
+        public static <V> Function<Attachable<V>, V> get(final Host hostVertexOrGraph) {
+            return (Attachable<V> attachable) -> {
+                final Object base = attachable.get();
+                if (base instanceof Vertex) {
+                    final Optional<Vertex> optional = hostVertexOrGraph instanceof Graph ?
+                            Method.getVertex((Attachable<Vertex>) attachable, (Graph) hostVertexOrGraph) :
+                            Method.getVertex((Attachable<Vertex>) attachable, (Vertex) hostVertexOrGraph);
+                    return (V) optional.orElseThrow(() -> hostVertexOrGraph instanceof Graph ?
+                            Attachable.Exceptions.canNotGetAttachableFromHostGraph(attachable, (Graph) hostVertexOrGraph) :
+                            Attachable.Exceptions.canNotGetAttachableFromHostVertex(attachable, (Vertex) hostVertexOrGraph));
+                } else if (base instanceof Edge) {
+                    final Optional<Edge> optional = hostVertexOrGraph instanceof Graph ?
+                            Method.getEdge((Attachable<Edge>) attachable, (Graph) hostVertexOrGraph) :
+                            Method.getEdge((Attachable<Edge>) attachable, (Vertex) hostVertexOrGraph);
+                    return (V) optional.orElseThrow(() -> hostVertexOrGraph instanceof Graph ?
+                            Attachable.Exceptions.canNotGetAttachableFromHostGraph(attachable, (Graph) hostVertexOrGraph) :
+                            Attachable.Exceptions.canNotGetAttachableFromHostVertex(attachable, (Vertex) hostVertexOrGraph));
+                } else if (base instanceof VertexProperty) {
+                    final Optional<VertexProperty> optional = hostVertexOrGraph instanceof Graph ?
+                            Method.getVertexProperty((Attachable<VertexProperty>) attachable, (Graph) hostVertexOrGraph) :
+                            Method.getVertexProperty((Attachable<VertexProperty>) attachable, (Vertex) hostVertexOrGraph);
+                    return (V) optional.orElseThrow(() -> hostVertexOrGraph instanceof Graph ?
+                            Attachable.Exceptions.canNotGetAttachableFromHostGraph(attachable, (Graph) hostVertexOrGraph) :
+                            Attachable.Exceptions.canNotGetAttachableFromHostVertex(attachable, (Vertex) hostVertexOrGraph));
+                } else if (base instanceof Property) {
+                    final Optional<Property> optional = hostVertexOrGraph instanceof Graph ?
+                            Method.getProperty((Attachable<Property>) attachable, (Graph) hostVertexOrGraph) :
+                            Method.getProperty((Attachable<Property>) attachable, (Vertex) hostVertexOrGraph);
+                    return (V) optional.orElseThrow(() -> hostVertexOrGraph instanceof Graph ?
+                            Attachable.Exceptions.canNotGetAttachableFromHostGraph(attachable, (Graph) hostVertexOrGraph) :
+                            Attachable.Exceptions.canNotGetAttachableFromHostVertex(attachable, (Vertex) hostVertexOrGraph));
+                } else
+                    throw Attachable.Exceptions.providedAttachableMustContainAGraphObject(attachable);
+            };
+        }
+
+        public static <V> Function<Attachable<V>, V> create(final Host hostVertexOrGraph) {
+            return (Attachable<V> attachable) -> {
+                final Object base = attachable.get();
+                if (base instanceof Vertex) {
+                    return hostVertexOrGraph instanceof Graph ?
+                            (V) Method.createVertex((Attachable<Vertex>) attachable, (Graph) hostVertexOrGraph) :
+                            (V) Method.createVertex((Attachable<Vertex>) attachable, (Vertex) hostVertexOrGraph);
+                } else if (base instanceof Edge) {
+                    return hostVertexOrGraph instanceof Graph ?
+                            (V) Method.createEdge((Attachable<Edge>) attachable, (Graph) hostVertexOrGraph) :
+                            (V) Method.createEdge((Attachable<Edge>) attachable, (Vertex) hostVertexOrGraph);
+                } else if (base instanceof VertexProperty) {
+                    return hostVertexOrGraph instanceof Graph ?
+                            (V) Method.createVertexProperty((Attachable<VertexProperty>) attachable, (Graph) hostVertexOrGraph) :
+                            (V) Method.createVertexProperty((Attachable<VertexProperty>) attachable, (Vertex) hostVertexOrGraph);
+                } else if (base instanceof Property) {
+                    return hostVertexOrGraph instanceof Graph ?
+                            (V) Method.createProperty((Attachable<Property>) attachable, (Graph) hostVertexOrGraph) :
+                            (V) Method.createProperty((Attachable<Property>) attachable, (Vertex) hostVertexOrGraph);
+                } else
+                    throw Attachable.Exceptions.providedAttachableMustContainAGraphObject(attachable);
+            };
+        }
+    }
+
     public enum Method implements Function<Host, Function<Attachable, Object>> {
         GET {
             @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java
index 769e76a..801299e 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java
@@ -61,6 +61,12 @@ public final class IteratorUtils {
         return collection;
     }
 
+    public static void iterate(final Iterator iterator) {
+        while(iterator.hasNext()) {
+            iterator.next();
+        }
+    }
+
     public static final long count(final Iterator iterator) {
         long ix = 0;
         for (; iterator.hasNext(); ++ix) iterator.next();

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/gremlin-server/data/sample.kryo
----------------------------------------------------------------------
diff --git a/gremlin-server/data/sample.kryo b/gremlin-server/data/sample.kryo
index 04bc90b..acf71a9 100644
Binary files a/gremlin-server/data/sample.kryo and b/gremlin-server/data/sample.kryo differ

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGraphProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGraphProvider.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGraphProvider.java
index 1b7a016..42471a0 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGraphProvider.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGraphProvider.java
@@ -120,10 +120,7 @@ public abstract class AbstractGraphProvider implements GraphProvider {
     }
 
     protected void readIntoGraph(final Graph g, final String path) throws IOException {
-        final File workingDirectory = TestHelper.makeTestDataPath(this.getClass(), "gryo-working-directory");
-        if (!workingDirectory.exists()) workingDirectory.mkdirs();
         final GraphReader reader = GryoReader.build()
-                .workingDirectory(workingDirectory.getAbsolutePath())
                 .mapper(g.io(GryoIo.build()).mapper().create())
                 .create();
         try (final InputStream stream = AbstractGremlinTest.class.getResourceAsStream(path)) {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchTest.java
index 3b5bcc5..3be7759 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchTest.java
@@ -295,7 +295,7 @@ public abstract class MatchTest extends AbstractGremlinProcessTest {
     @Test
     @LoadGraphWith(GRATEFUL)
     public void g_V_matchXa_hasXname_GarciaX__a_0writtenBy_b__a_0sungBy_bX() throws Exception {
-        Traversal<Vertex, Map<String, Vertex>> traversal = get_g_V_matchXa_hasXname_GarciaX__a_0writtenBy_b__a_0sungBy_bX();
+        final Traversal<Vertex, Map<String, Vertex>> traversal = get_g_V_matchXa_hasXname_GarciaX__a_0writtenBy_b__a_0sungBy_bX();
         printTraversalForm(traversal);
         assertResults(vertexToStr, traversal,
                 new Bindings<Vertex>().put("a", convertToVertex(graph, "Garcia")).put("b", convertToVertex(graph, "CREAM PUFF WAR")),
@@ -305,7 +305,7 @@ public abstract class MatchTest extends AbstractGremlinProcessTest {
     @Test
     @LoadGraphWith(GRATEFUL)
     public void g_V_matchXa_0sungBy_b__a_0sungBy_c__b_writtenBy_d__c_writtenBy_e__d_hasXname_George_HarisonX__e_hasXname_Bob_MarleyXX() throws Exception {
-        Traversal<Vertex, Map<String, Vertex>> traversal = get_g_V_matchXa_0sungBy_b__a_0sungBy_c__b_writtenBy_d__c_writtenBy_e__d_hasXname_George_HarisonX__e_hasXname_Bob_MarleyXX();
+        final Traversal<Vertex, Map<String, Vertex>> traversal = get_g_V_matchXa_0sungBy_b__a_0sungBy_c__b_writtenBy_d__c_writtenBy_e__d_hasXname_George_HarisonX__e_hasXname_Bob_MarleyXX();
         printTraversalForm(traversal);
         assertResults(vertexToStr, traversal,
                 new Bindings<Vertex>()
@@ -319,7 +319,7 @@ public abstract class MatchTest extends AbstractGremlinProcessTest {
     @Test
     @LoadGraphWith(MODERN)
     public void g_V_matchXa_created_b__b_0created_cX_whereXa_neq_cX_selectXa_c_nameX() throws Exception {
-        Traversal<Vertex, Map<String, String>> traversal = get_g_V_matchXa_created_b__b_0created_cX_whereXa_neq_cX_selectXa_c_nameX();
+        final Traversal<Vertex, Map<String, String>> traversal = get_g_V_matchXa_created_b__b_0created_cX_whereXa_neq_cX_selectXa_c_nameX();
         assertResults(Function.identity(), traversal,
                 new Bindings<String>().put("a", "marko").put("c", "josh"),
                 new Bindings<String>().put("a", "marko").put("c", "peter"),

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/IoTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/IoTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/IoTest.java
index 3445d40..3b053db 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/IoTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/IoTest.java
@@ -28,7 +28,6 @@ import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
 import com.fasterxml.jackson.databind.module.SimpleModule;
 import com.fasterxml.jackson.databind.ser.std.StdSerializer;
 import org.apache.commons.configuration.Configuration;
-import org.apache.commons.io.FileUtils;
 import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
 import org.apache.tinkerpop.gremlin.FeatureRequirement;
 import org.apache.tinkerpop.gremlin.LoadGraphWith;
@@ -106,23 +105,10 @@ public class IoTest extends AbstractGremlinTest {
     private static final String GRAPHML_RESOURCE_PATH_PREFIX = "/org/apache/tinkerpop/gremlin/structure/io/graphml/";
     private static final String GRAPHSON_RESOURCE_PATH_PREFIX = "/org/apache/tinkerpop/gremlin/structure/io/graphson/";
 
-    private static String tempPath;
-
     private Io.Builder<GraphMLIo> graphml;
     private Io.Builder<GraphSONIo> graphson;
     private Io.Builder<GryoIo> gryo;
 
-    static {
-        tempPath = TestHelper.makeTestDataPath(IoTest.class, "iotest").getPath() + File.separator;
-    }
-
-    @BeforeClass
-    public static void before() throws IOException {
-        final File tempDir = new File(tempPath);
-        FileUtils.deleteDirectory(tempDir);
-        if (!tempDir.mkdirs()) throw new IOException(String.format("Could not create %s", tempDir));
-    }
-
     @Before
     public void setupBeforeEachTest() {
         graphml = graphml();
@@ -336,7 +322,7 @@ public class IoTest extends AbstractGremlinTest {
         final GryoMapper gryo = GryoMapper.build().addCustom(CustomId.class).create();
 
         final GryoWriter writer = GryoWriter.build().mapper(gryo).create();
-        final GryoReader reader = GryoReader.build().workingDirectory(tempPath).mapper(gryo).create();
+        final GryoReader reader = GryoReader.build().mapper(gryo).create();
 
         final Configuration configuration = graphProvider.newGraphConfiguration("readGraph", this.getClass(), name.getMethodName(), null);
         graphProvider.clear(configuration);
@@ -362,7 +348,7 @@ public class IoTest extends AbstractGremlinTest {
         graphProvider.clear(configuration);
         final Graph g1 = graphProvider.openTestGraph(configuration);
 
-        final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+        final GryoReader reader = graph.io(gryo).reader().create();
         final GryoWriter writer = graph.io(gryo).writer().create();
 
         GraphMigrator.migrateGraph(graph, g1, reader, writer);
@@ -382,7 +368,7 @@ public class IoTest extends AbstractGremlinTest {
         graphProvider.clear(configuration);
         final Graph g1 = graphProvider.openTestGraph(configuration);
 
-        final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+        final GryoReader reader = graph.io(gryo).reader().create();
         final GryoWriter writer = graph.io(gryo).writer().create();
 
         GraphMigrator.migrateGraph(graph, g1, reader, writer);
@@ -408,8 +394,9 @@ public class IoTest extends AbstractGremlinTest {
             final Configuration configuration = graphProvider.newGraphConfiguration("readGraph", this.getClass(), name.getMethodName(), LoadGraphWith.GraphData.MODERN);
             graphProvider.clear(configuration);
             final Graph g1 = graphProvider.openTestGraph(configuration);
-            final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
-            try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
+            final GryoReader reader = graph.io(gryo).reader().create();
+            final byte[] x = os.toByteArray();
+            try (final ByteArrayInputStream bais = new ByteArrayInputStream(x)) {
                 reader.readGraph(bais, g1);
             }
 
@@ -463,8 +450,7 @@ public class IoTest extends AbstractGremlinTest {
             graphProvider.clear(configuration);
             final Graph g1 = graphProvider.openTestGraph(configuration);
             final GryoReader reader = GryoReader.build()
-                    .mapper(graph.io(gryo).mapper().create())
-                    .workingDirectory(tempPath).create();
+                    .mapper(graph.io(gryo).mapper().create()).create();
             try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                 reader.readGraph(bais, g1);
             }
@@ -492,7 +478,7 @@ public class IoTest extends AbstractGremlinTest {
             final Configuration configuration = graphProvider.newGraphConfiguration("readGraph", this.getClass(), name.getMethodName(), LoadGraphWith.GraphData.CLASSIC);
             graphProvider.clear(configuration);
             final Graph g1 = graphProvider.openTestGraph(configuration);
-            final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+            final GryoReader reader = graph.io(gryo).reader().create();
             try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                 reader.readGraph(bais, g1);
             }
@@ -616,7 +602,7 @@ public class IoTest extends AbstractGremlinTest {
             writer.writeEdge(os, e);
 
             final AtomicBoolean called = new AtomicBoolean(false);
-            final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+            final GryoReader reader = graph.io(gryo).reader().create();
             try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                 reader.readEdge(bais, edge -> {
                     final Edge detachedEdge = (Edge) edge;
@@ -653,7 +639,7 @@ public class IoTest extends AbstractGremlinTest {
             writer.writeEdge(os, e);
 
             final AtomicBoolean called = new AtomicBoolean(false);
-            final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+            final GryoReader reader = graph.io(gryo).reader().create();
             try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                 reader.readEdge(bais, edge -> {
                     final Edge detachedEdge = (Edge) edge;
@@ -688,7 +674,7 @@ public class IoTest extends AbstractGremlinTest {
             writer.writeEdge(os, e);
 
             final AtomicBoolean called = new AtomicBoolean(false);
-            final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+            final GryoReader reader = graph.io(gryo).reader().create();
             try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                 reader.readEdge(bais, edge -> {
                     final Edge detachedEdge = (Edge) edge;
@@ -723,7 +709,7 @@ public class IoTest extends AbstractGremlinTest {
             writer.writeEdge(os, e);
 
             final AtomicBoolean called = new AtomicBoolean(false);
-            final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+            final GryoReader reader = graph.io(gryo).reader().create();
             try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                 reader.readEdge(bais, edge -> {
                     final Edge detachedEdge = (Edge) edge;
@@ -945,7 +931,7 @@ public class IoTest extends AbstractGremlinTest {
             writer.writeEdge(os, e);
 
             final AtomicBoolean called = new AtomicBoolean(false);
-            final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+            final GryoReader reader = graph.io(gryo).reader().create();
             try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                 reader.readEdge(bais, edge -> {
                     final Edge detachedEdge = (Edge) edge;
@@ -984,7 +970,7 @@ public class IoTest extends AbstractGremlinTest {
             writer.writeVertex(os, v1);
 
             final AtomicBoolean called = new AtomicBoolean(false);
-            final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+            final GryoReader reader = graph.io(gryo).reader().create();
             try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                 reader.readVertex(bais, attachable -> {
                     final Vertex detachedVertex = attachable.get();
@@ -1016,7 +1002,7 @@ public class IoTest extends AbstractGremlinTest {
             writer.writeVertex(os, v1);
 
             final AtomicBoolean called = new AtomicBoolean(false);
-            final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+            final GryoReader reader = graph.io(gryo).reader().create();
             try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                 reader.readVertex(bais, attachable -> {
                     final Vertex detachedVertex = attachable.get();
@@ -1049,7 +1035,7 @@ public class IoTest extends AbstractGremlinTest {
             writer.writeVertex(os, dv);
 
             final AtomicBoolean called = new AtomicBoolean(false);
-            final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+            final GryoReader reader = graph.io(gryo).reader().create();
             try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                 reader.readVertex(bais, attachable -> {
                     final Vertex detachedVertex = attachable.get();
@@ -1082,7 +1068,7 @@ public class IoTest extends AbstractGremlinTest {
             writer.writeVertex(os, dv);
 
             final AtomicBoolean called = new AtomicBoolean(false);
-            final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+            final GryoReader reader = graph.io(gryo).reader().create();
             try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                 reader.readVertex(bais, attachable -> {
                     final Vertex detachedVertex = attachable.get();
@@ -1115,7 +1101,7 @@ public class IoTest extends AbstractGremlinTest {
             writer.writeVertex(os, v1);
 
             final AtomicBoolean called = new AtomicBoolean(false);
-            final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+            final GryoReader reader = graph.io(gryo).reader().create();
             try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                 reader.readVertex(bais, attachable -> {
                     final Vertex detachedVertex = attachable.get();
@@ -1284,7 +1270,7 @@ public class IoTest extends AbstractGremlinTest {
             writer.writeVertices(os, g.V().has("age", Compare.gt, 30));
 
             final AtomicInteger called = new AtomicInteger(0);
-            final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+            final GryoReader reader = graph.io(gryo).reader().create();
             try (final VertexByteArrayInputStream vbais = new VertexByteArrayInputStream(new ByteArrayInputStream(os.toByteArray()))) {
                 final byte[] y = vbais.readVertexBytes().toByteArray();
                 reader.readVertex(new ByteArrayInputStream(y),
@@ -1315,7 +1301,7 @@ public class IoTest extends AbstractGremlinTest {
             writer.writeVertices(os, g.V().has("age", Compare.gt, 30));
 
             final AtomicInteger called = new AtomicInteger(0);
-            final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+            final GryoReader reader = graph.io(gryo).reader().create();
 
             try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                 final Iterator<Vertex> itty = reader.readVertices(bais,
@@ -1381,7 +1367,7 @@ public class IoTest extends AbstractGremlinTest {
 
             final AtomicBoolean calledVertex = new AtomicBoolean(false);
             final AtomicBoolean calledEdge = new AtomicBoolean(false);
-            final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+            final GryoReader reader = graph.io(gryo).reader().create();
 
             try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                 reader.readVertex(bais, attachable -> {
@@ -1477,7 +1463,7 @@ public class IoTest extends AbstractGremlinTest {
             final AtomicBoolean calledVertex = new AtomicBoolean(false);
             final AtomicBoolean calledEdge = new AtomicBoolean(false);
 
-            final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+            final GryoReader reader = graph.io(gryo).reader().create();
             try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                 reader.readVertex(bais, attachable -> {
                     final Vertex detachedVertex = attachable.get();
@@ -1574,7 +1560,7 @@ public class IoTest extends AbstractGremlinTest {
             final AtomicBoolean calledEdge1 = new AtomicBoolean(false);
             final AtomicBoolean calledEdge2 = new AtomicBoolean(false);
 
-            final GryoReader reader = graph.io(gryo).reader().workingDirectory(tempPath).create();
+            final GryoReader reader = graph.io(gryo).reader().create();
             try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                 reader.readVertex(bais, attachable -> {
                             final Vertex detachedVertex = attachable.get();
@@ -1767,10 +1753,6 @@ public class IoTest extends AbstractGremlinTest {
         assertEquals(new Long(6), g1.traversal().V().count().next());
         assertEquals(new Long(14), g1.traversal().E().count().next());
 
-        assertEquals("marko", g1.variables().get("creator").get().toString());
-        assertEquals(2014, g1.variables().get("lastModified").get());
-        assertEquals("this graph was created to provide examples and test coverage for tinkerpop3 api advances", g1.variables().get("comment").get().toString());
-
         final Vertex v1 = (Vertex) g1.traversal().V().has("name", "marko").next();
         assertEquals("person", v1.label());
         assertEquals(2, v1.keys().size());

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/grateful-dead-vertices.kryo
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/grateful-dead-vertices.kryo b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/grateful-dead-vertices.kryo
index 30677c3..01b4fea 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/grateful-dead-vertices.kryo and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/grateful-dead-vertices.kryo differ

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/grateful-dead.kryo
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/grateful-dead.kryo b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/grateful-dead.kryo
index 31a3ebd..01b4fea 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/grateful-dead.kryo and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/grateful-dead.kryo differ

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-classic-vertices.kryo
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-classic-vertices.kryo b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-classic-vertices.kryo
index e01dc10..aaeac55 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-classic-vertices.kryo and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-classic-vertices.kryo differ

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-classic.kryo
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-classic.kryo b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-classic.kryo
index 10e10cc..aaeac55 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-classic.kryo and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-classic.kryo differ

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-crew-vertices.kryo
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-crew-vertices.kryo b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-crew-vertices.kryo
index 8bf40c7..7ef6941 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-crew-vertices.kryo and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-crew-vertices.kryo differ

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-crew.kryo
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-crew.kryo b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-crew.kryo
index 9ac8b4c..7ef6941 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-crew.kryo and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-crew.kryo differ

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-modern-vertices.kryo
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-modern-vertices.kryo b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-modern-vertices.kryo
index 2ff096d..eef5b3e 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-modern-vertices.kryo and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-modern-vertices.kryo differ

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cab778d7/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-modern.kryo
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-modern.kryo b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-modern.kryo
index 3feda2e..eef5b3e 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-modern.kryo and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-modern.kryo differ