hama-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anastasis Andronidis (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HAMA-831) Support for multi Vertex/Edge pairs input
Date Fri, 20 Dec 2013 22:20:09 GMT

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

Anastasis Andronidis edited comment on HAMA-831 at 12/20/13 10:18 PM:
----------------------------------------------------------------------

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)



was (Author: andronat):
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, (and you have an empty line) 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)

Mime
View raw message