Package org.apache.hama.examples

Examples of org.apache.hama.examples.ShortestPathVertexArrayWritable


            + line);
      }
      v[i - 1] = new ShortestPathVertex(Integer.parseInt(weightSplit[1]),
          weightSplit[0]);
    }
    ShortestPathVertexArrayWritable value = new ShortestPathVertexArrayWritable();
    value.set(v);
    return new KeyValuePair(key, value);
  }
View Full Code Here


  private void verifyOutput() throws IOException {
    SequenceFile.Reader reader = new SequenceFile.Reader(fs,
        new Path(SEQ_INPUT), conf);
    ShortestPathVertex vertex = new ShortestPathVertex();
    ShortestPathVertexArrayWritable vertexArray = new ShortestPathVertexArrayWritable();

    int lines = 0;
    while (reader.next(vertex, vertexArray)) {
      int count = 0;
      assertEquals(vertex.getName(), lines + "");
      assertEquals(vertex.getWeight(), 0);
      Writable[] writables = vertexArray.get();
      assertEquals(writables.length, 5);
      for (int i = 0; i < 5; i++) {
        assertEquals(((ShortestPathVertex) writables[i]).getName(), count + "");
        assertEquals(((ShortestPathVertex) writables[i]).getWeight(), lines);
        count++;
View Full Code Here

TOP

Related Classes of org.apache.hama.examples.ShortestPathVertexArrayWritable

Copyright © 2018 www.massapicom. 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.