public static class GraphSONWriter.Builder extends Object implements GraphWriter.WriterBuilder<GraphSONWriter>
Modifier and Type | Method and Description |
---|---|
GraphSONWriter |
create()
Creates the
GraphWriter implementation given options provided to the GraphWriter.WriterBuilder
implementation. |
GraphSONWriter.Builder |
mapper(Mapper<ObjectMapper> mapper)
Override all of the builder options with this mapper.
|
GraphSONWriter.Builder |
wrapAdjacencyList(boolean wrapAdjacencyListInObject)
Wraps the output of
GraphWriter.writeGraph(OutputStream, Graph) , GraphWriter.writeVertices(OutputStream, Iterator)
and GraphWriter.writeVertices(OutputStream, Iterator, Direction) in a JSON object. |
public GraphSONWriter.Builder mapper(Mapper<ObjectMapper> mapper)
public GraphSONWriter.Builder wrapAdjacencyList(boolean wrapAdjacencyListInObject)
GraphWriter.writeGraph(OutputStream, Graph)
, GraphWriter.writeVertices(OutputStream, Iterator)
and GraphWriter.writeVertices(OutputStream, Iterator, Direction)
in a JSON object. By default, this value
is false
which means that the output is such that there is one JSON object (vertex) per line.
When true
the line breaks are not written and instead a valid JSON object is formed where the
vertices are part of a JSON array in a key called "vertices".
By setting this value to true
, the generated JSON is no longer "splittable" by line and thus not
suitable for OLAP processing. Furthermore, reading this format of the JSON with
GraphSONReader.readGraph(InputStream, Graph)
or
GraphSONReader.readVertices(InputStream, Function, Function, Direction)
requires that the
entire JSON object be read into memory, so it is best saved for "small" graphs.public GraphSONWriter create()
GraphWriter.WriterBuilder
GraphWriter
implementation given options provided to the GraphWriter.WriterBuilder
implementation.create
in interface GraphWriter.WriterBuilder<GraphSONWriter>
Copyright © 2013–2020 Apache Software Foundation. All rights reserved.