Uploaded image for project: 'Giraph (Retired)'
  1. Giraph (Retired)
  2. GIRAPH-112

Use elements() properly in LongDoubleFloatDoubleVertex

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.1.0
    • 0.1.0
    • graph
    • None
    • Any

    Description

      I found a bug in LongDoubleFloatDoubleVertex.write(DataOutput out) when running a small graph algorithm. The symptom is that a vertex read from a different worker becomes junk after the RPC communication. And the source of the problem is the writing of the messages in LongDoubleFloatDoubleVertex.write(DataOutput out):

      for(double msg : messageList.elements()) {
      out.writeDouble(msg);
      }

      Here messageList.elements() will returns all the elements currently stored in the mahout DoubleArrayList, even including invalid elements between size and capacity. Therefore, the write() function will write a bunch of invalid messages, which will cause error when reading them back in readfields().

      The following is a simple solution:

      double[] elements=messageList.elements();
      for(int i=0; i<messageList.size(); i++) {
      out.writeDouble(elements[i]);
      }

      Attachments

        1. GIRAPH-112.patch
          10 kB
          Avery Ching

        Activity

          People

            aching Avery Ching
            humming80 Yuanyuan Tian
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 5m
                5m
                Remaining:
                Remaining Estimate - 5m
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified