Class GryoIo
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo
-
- All Implemented Interfaces:
Io<GryoReader.Builder,GryoWriter.Builder,GryoMapper.Builder>
public final class GryoIo extends Object implements Io<GryoReader.Builder,GryoWriter.Builder,GryoMapper.Builder>
Constructs Gryo IO implementations given aGraph
andIoRegistry
. Implementers of theGraph
interfaces should see theGryoMapper
for information on the expectations for theIoRegistry
.- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GryoIo.Builder
-
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.io.Io
Io.Exceptions
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Io.Builder<GryoIo>
build()
Create a new builder using the default version of Gryo - v3.static Io.Builder<GryoIo>
build(GryoVersion version)
Create a new builder using the specified version of Gryo.GryoMapper.Builder
mapper()
Constructs aMapper.Builder
which is responsible for constructing the abstraction over different serialization methods.GryoReader.Builder
reader()
Creates aGraphReader.ReaderBuilder
implementation .void
readGraph(String file)
Read aGraph
from file using the default configuration of theIo.reader()
and its suppliedIo.mapper()
.void
writeGraph(String file)
Write aGraph
to file using the default configuration of theIo.writer()
and its suppliedIo.mapper()
.GryoWriter.Builder
writer()
Creates aGraphWriter.WriterBuilder
implementation .
-
-
-
Method Detail
-
reader
public GryoReader.Builder reader()
Creates aGraphReader.ReaderBuilder
implementation . Implementers should call theIo.mapper()
function to feed its result to the builder. In this way, custom class serializers registered to theMapper.Builder
byGraph
implementations will end up being used for the serialization process.- Specified by:
reader
in interfaceIo<GryoReader.Builder,GryoWriter.Builder,GryoMapper.Builder>
-
writer
public GryoWriter.Builder writer()
Creates aGraphWriter.WriterBuilder
implementation . Implementers should call theIo.mapper()
function to feed its result to the builder. In this way, custom class serializers registered to theMapper.Builder
byGraph
implementations will end up being used for the serialization process.- Specified by:
writer
in interfaceIo<GryoReader.Builder,GryoWriter.Builder,GryoMapper.Builder>
-
mapper
public GryoMapper.Builder mapper()
Constructs aMapper.Builder
which is responsible for constructing the abstraction over different serialization methods. Implementations should set defaults as required, but most importantly need to make the appropriate call toMapper.Builder.addRegistry(IoRegistry)
which will provide the builder with any required custom serializers of theGraph
.- Specified by:
mapper
in interfaceIo<GryoReader.Builder,GryoWriter.Builder,GryoMapper.Builder>
-
writeGraph
public void writeGraph(String file) throws IOException
Write aGraph
to file using the default configuration of theIo.writer()
and its suppliedIo.mapper()
.- Specified by:
writeGraph
in interfaceIo<GryoReader.Builder,GryoWriter.Builder,GryoMapper.Builder>
- Throws:
IOException
-
readGraph
public void readGraph(String file) throws IOException
Read aGraph
from file using the default configuration of theIo.reader()
and its suppliedIo.mapper()
.- Specified by:
readGraph
in interfaceIo<GryoReader.Builder,GryoWriter.Builder,GryoMapper.Builder>
- Throws:
IOException
-
build
public static Io.Builder<GryoIo> build()
Create a new builder using the default version of Gryo - v3.
-
build
public static Io.Builder<GryoIo> build(GryoVersion version)
Create a new builder using the specified version of Gryo.
-
-