Package org.apache.giraph.lib.AdjacencyListTextVertexOutputFormat

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


    // Create empty iterator == no edges
    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();
View Full Code Here


    mockEdgeValue(vertex, "Los Angeles", 347.16);
    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);
View Full Code Here

    mockEdgeValue(vertex, "Los Angeles", 347.16);
    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);
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.