You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hama.apache.org by "Anastasis Andronidis (JIRA)" <ji...@apache.org> on 2013/12/20 23:10:10 UTC

[jira] [Commented] (HAMA-831) Support for multi Vertex/Edge pairs input

    [ https://issues.apache.org/jira/browse/HAMA-831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13854612#comment-13854612 ] 

Anastasis Andronidis commented on HAMA-831:
-------------------------------------------

Hello,

I am a little bit concern about these lines:

{code}
      if (vertex.getVertexID() == null) {
        vertex = currentVertex;
      } else {
{code}

If there is an empty line the vertex will be assigned to an invalid vertex instance. If you are in the very last loop, you will add a vertex that will have no ID. (e.g. if the input file have an empty line in the end or it has a strange format)

I believe that if you just skip null values will be better, for input files that accidentally have empty lines:
{code}
        if (vertex.getVertexID().equals(currentVertex.getVertexID()) && vertex.getVertexID()!=null) {
          for (Edge<V, E> edge : currentVertex.getEdges()) {
            vertex.addEdge(edge);
          }
        } else {
          vertex.setRunner(this);
          vertex.setup(conf);

          if (selfReference) {
            vertex.addEdge(new Edge<V, E>(vertex.getVertexID(), null));
          }

          vertices.addVertex(vertex);
          vertex = currentVertex;
        }
{code}

(skip the outer if)


> Support for multi Vertex/Edge pairs input
> -----------------------------------------
>
>                 Key: HAMA-831
>                 URL: https://issues.apache.org/jira/browse/HAMA-831
>             Project: Hama
>          Issue Type: Bug
>          Components: graph
>    Affects Versions: 0.6.3
>            Reporter: Edward J. Yoon
>            Assignee: Edward J. Yoon
>             Fix For: 0.7.0
>
>         Attachments: HAMA-831.patch
>
>
> See https://issues.apache.org/jira/browse/HAMA-790?focusedCommentId=13773722&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13773722



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)