Examples of writeVertex()


Examples of com.tinkerpop.gremlin.structure.io.kryo.KryoWriter.writeVertex()

        v2.addEdge("friends", v1, "weight", 0.5d);
        final Edge e2 = v1.addEdge("friends", v2, "weight", 1.0d);

        try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) {
            final KryoWriter writer = KryoWriter.build().custom(graphProvider.createConfiguredGremlinKryo()).create();
            writer.writeVertex(os, v1, Direction.BOTH);

            final AtomicBoolean vertexCalled = new AtomicBoolean(false);
            final AtomicBoolean edgeCalled = new AtomicBoolean(false);

            final KryoReader reader = KryoReader.build()
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.io.kryo.KryoWriter.writeVertex()

        final Vertex v2 = g.addVertex();
        v1.addEdge("friends", v2, "weight", 0.5d);

        try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) {
            final KryoWriter writer = KryoWriter.build().custom(graphProvider.createConfiguredGremlinKryo()).create();
            writer.writeVertex(os, v1, Direction.OUT);

            final KryoReader reader = KryoReader.build()
                    .custom(graphProvider.createConfiguredGremlinKryo())
                    .workingDirectory(File.separator + "tmp").create();
            try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.io.kryo.KryoWriter.writeVertex()

        final Vertex v2 = g.addVertex();
        v2.addEdge("friends", v1, "weight", 0.5d);

        try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) {
            final KryoWriter writer = KryoWriter.build().custom(graphProvider.createConfiguredGremlinKryo()).create();
            writer.writeVertex(os, v1, Direction.IN);

            final KryoReader reader = KryoReader.build()
                    .custom(graphProvider.createConfiguredGremlinKryo())
                    .workingDirectory(File.separator + "tmp").create();
            try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.io.kryo.KryoWriter.writeVertex()

        final Vertex v2 = g.addVertex();
        v2.addEdge("friends", v1, "weight", 0.5d);

        try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) {
            final KryoWriter writer = KryoWriter.build().custom(graphProvider.createConfiguredGremlinKryo()).create();
            writer.writeVertex(os, v1, Direction.IN);

            final KryoReader reader = KryoReader.build()
                    .custom(graphProvider.createConfiguredGremlinKryo())
                    .workingDirectory(File.separator + "tmp").create();
            try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.io.kryo.KryoWriter.writeVertex()

        final Vertex v2 = g.addVertex();
        v1.addEdge("friends", v2, "weight", 0.5d);

        try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) {
            final KryoWriter writer = KryoWriter.build().custom(graphProvider.createConfiguredGremlinKryo()).create();
            writer.writeVertex(os, v1, Direction.IN);

            final KryoReader reader = KryoReader.build()
                    .custom(graphProvider.createConfiguredGremlinKryo())
                    .workingDirectory(File.separator + "tmp").create();
            try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
View Full Code Here

Examples of org.apache.giraph.lib.AdjacencyListTextVertexOutputFormat.AdjacencyListVertexWriter.writeVertex()

    when(vertex.iterator()).thenReturn(new ArrayList<Text>().iterator());

    RecordWriter<Text, Text> tw = mock(RecordWriter.class);
    AdjacencyListVertexWriter writer = new AdjacencyListVertexWriter(tw);
    writer.initialize(tac);
    writer.writeVertex(vertex);

    Text expected = new Text("The Beautiful South\t32.2");
    verify(tw).write(expected, null);
    verify(vertex, times(1)).iterator();
    verify(vertex, times(0)).getEdgeValue(Matchers.<WritableComparable>any());
View Full Code Here

Examples of org.apache.giraph.lib.AdjacencyListTextVertexOutputFormat.AdjacencyListVertexWriter.writeVertex()

    mockEdgeValue(vertex, "Phoenix", 652.48);

    RecordWriter<Text,Text> tw = mock(RecordWriter.class);
    AdjacencyListVertexWriter writer = new AdjacencyListVertexWriter(tw);
    writer.initialize(tac);
    writer.writeVertex(vertex);

    Text expected = new Text("San Francisco\t0.0\tLos Angeles\t347.16\t" +
            "Phoenix\t652.48");
    verify(tw).write(expected, null);
    verify(vertex, times(1)).iterator();
View Full Code Here

Examples of org.apache.giraph.lib.AdjacencyListTextVertexOutputFormat.AdjacencyListVertexWriter.writeVertex()

    mockEdgeValue(vertex, "Phoenix", 652.48);

    RecordWriter<Text,Text> tw = mock(RecordWriter.class);
    AdjacencyListVertexWriter writer = new AdjacencyListVertexWriter(tw);
    writer.initialize(tac);
    writer.writeVertex(vertex);

    Text expected = new Text("San Francisco:::0.0:::Los Angeles:::347.16:::" +
            "Phoenix:::652.48");
    verify(tw).write(expected, null);
    verify(vertex, times(1)).iterator();
View Full Code Here

Examples of org.apache.giraph.lib.IdWithValueTextOutputFormat.IdWithValueVertexWriter.writeVertex()

    when(vertex.iterator()).thenReturn(new ArrayList<Text>().iterator());

    RecordWriter<Text, Text> tw = mock(RecordWriter.class);
    IdWithValueVertexWriter writer = new IdWithValueVertexWriter(tw);
    writer.initialize(tac);
    writer.writeVertex(vertex);

    verify(tw).write(expected, null);
    verify(vertex, times(0)).iterator();
    verify(vertex, times(0)).getEdgeValue(Matchers.<WritableComparable>any());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.