Class GryoWriter
- java.lang.Object
- 
- org.apache.tinkerpop.gremlin.structure.io.gryo.GryoWriter
 
- 
- All Implemented Interfaces:
- GraphWriter
 
 public final class GryoWriter extends Object implements GraphWriter TheGraphWriterfor the Gremlin Structure serialization format based on Kryo. The format is meant to be non-lossy in terms of Gremlin Structure to Gremlin Structure migrations (assuming both structure implementations support the same graph features). This implementation is not thread-safe. Have oneGraphWriterinstance per thread.- Author:
- Stephen Mallette (http://stephen.genoprime.com)
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classGryoWriter.Builder- 
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.io.GraphWriterGraphWriter.WriterBuilder<T extends GraphWriter>
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GryoWriter.Builderbuild()voidwriteEdge(OutputStream outputStream, Edge e)Write an edge to a stream.voidwriteGraph(OutputStream outputStream, Graph g)Write the entire graph to a stream.voidwriteObject(OutputStream outputStream, Object object)Writes an arbitrary object to the stream.voidwriteProperty(OutputStream outputStream, Property p)Write a property to a stream.voidwriteVertex(OutputStream outputStream, Vertex v)Write a vertex to a stream without writing its edges.voidwriteVertex(OutputStream outputStream, Vertex v, Direction direction)Write a vertex to a stream with its associated edges.voidwriteVertexProperty(OutputStream outputStream, VertexProperty vp)Write a vertex property to a stream.voidwriteVertices(OutputStream outputStream, Iterator<Vertex> vertexIterator)Write a vertex to a stream without writing its edges.voidwriteVertices(OutputStream outputStream, Iterator<Vertex> vertexIterator, Direction direction)Write a list of vertices from aTraversalto a stream with its associated edges.
 
- 
- 
- 
Method Detail- 
writeGraphpublic void writeGraph(OutputStream outputStream, Graph g) throws IOException Write the entire graph to a stream.- Specified by:
- writeGraphin interface- GraphWriter
- Parameters:
- outputStream- the stream to write to.
- g- the graph to write to stream.
- Throws:
- IOException
 
 - 
writeVerticespublic void writeVertices(OutputStream outputStream, Iterator<Vertex> vertexIterator, Direction direction) throws IOException Write a list of vertices from aTraversalto a stream with its associated edges. Only write edges as defined by the requested direction.- Specified by:
- writeVerticesin interface- GraphWriter
- Parameters:
- outputStream- the stream to write to.
- vertexIterator- a traversal that returns a list of vertices.
- direction- the direction of edges to write or null if no edges are to be written.
- Throws:
- IOException
 
 - 
writeVerticespublic void writeVertices(OutputStream outputStream, Iterator<Vertex> vertexIterator) throws IOException Write a vertex to a stream without writing its edges.- Specified by:
- writeVerticesin interface- GraphWriter
- Parameters:
- outputStream- the stream to write to.
- vertexIterator- a iterator that returns a list of vertices.
- Throws:
- IOException
 
 - 
writeVertexpublic void writeVertex(OutputStream outputStream, Vertex v, Direction direction) throws IOException Write a vertex to a stream with its associated edges. Only write edges as defined by the requested direction.- Specified by:
- writeVertexin interface- GraphWriter
- Parameters:
- outputStream- the stream to write to.
- v- the vertex to write.
- direction- the direction of edges to write or null if no edges are to be written.
- Throws:
- IOException
 
 - 
writeVertexpublic void writeVertex(OutputStream outputStream, Vertex v) throws IOException Write a vertex to a stream without writing its edges.- Specified by:
- writeVertexin interface- GraphWriter
- Parameters:
- outputStream- the stream to write to.
- v- the vertex to write.
- Throws:
- IOException
 
 - 
writeEdgepublic void writeEdge(OutputStream outputStream, Edge e) throws IOException Write an edge to a stream.- Specified by:
- writeEdgein interface- GraphWriter
- Parameters:
- outputStream- the stream to write to.
- e- the edge to write.
- Throws:
- IOException
 
 - 
writeVertexPropertypublic void writeVertexProperty(OutputStream outputStream, VertexProperty vp) throws IOException Write a vertex property to a stream.- Specified by:
- writeVertexPropertyin interface- GraphWriter
- Parameters:
- outputStream- the stream to write to.
- vp- the vertex property to write.
- Throws:
- IOException
 
 - 
writePropertypublic void writeProperty(OutputStream outputStream, Property p) throws IOException Write a property to a stream.- Specified by:
- writePropertyin interface- GraphWriter
- Parameters:
- outputStream- the stream to write to.
- p- the property to write.
- Throws:
- IOException
 
 - 
writeObjectpublic void writeObject(OutputStream outputStream, Object object) Writes an arbitrary object to the stream.- Specified by:
- writeObjectin interface- GraphWriter
- Parameters:
- outputStream- the stream to write to.
- object- the object to write which will use the standard serializer set.
 
 - 
buildpublic static GryoWriter.Builder build() 
 
- 
 
-