Examples of AdjacencyListVertexWriter


Examples of org.apache.giraph.lib.AdjacencyListTextVertexOutputFormat.AdjacencyListVertexWriter

    when(vertex.getVertexValue()).thenReturn(new DoubleWritable(32.2d));
    // 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();
    verify(vertex, times(0)).getEdgeValue(Matchers.<WritableComparable>any());
View Full Code Here

Examples of org.apache.giraph.lib.AdjacencyListTextVertexOutputFormat.AdjacencyListVertexWriter

    when(vertex.iterator()).thenReturn(cities.iterator());
    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);
    verify(vertex, times(1)).iterator();
View Full Code Here

Examples of org.apache.giraph.lib.AdjacencyListTextVertexOutputFormat.AdjacencyListVertexWriter

    when(vertex.iterator()).thenReturn(cities.iterator());
    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);
    verify(vertex, times(1)).iterator();
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.