giraph-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Krause ...@ckrause.org>
Subject Re: Zeros appended to BytesWritable
Date Mon, 24 Jun 2013 10:50:47 GMT
This was the problem. Here a possible work around:

  public static class MyBytes extends BytesWritable {

    public MyBytes() {
      super();
    }

    public MyBytes(byte[] data) {
      super(data);
    }

    /**
     * Set the size.
     * @param size The new size.
     */
    @Override
    public void setSize(int size) {
      boolean resize = size > getCapacity();
      super.setSize(size);
      if (resize) {
        setCapacity(size);
      }
    }
  }


2013/6/24 Christian Krause <me@ckrause.org>

> It seems this is related to this issue:
> http://stackoverflow.com/questions/15957870/why-byteswritable-setsizesize-make-the-space-of-bytes-to-1-5size
>
> But I am using the byte[] constructor, so I still don't get it...
>
> Christian
>
>
> 2013/6/24 Christian Krause <me@ckrause.org>
>
>> Hi,
>> I am using BytesWritables as messages and vertex IDs. The strange thing
>> is when I send a message or create a new vertex, a 0 is appended to my
>> original byte array. From my log I can see that I am sending the correct
>> data and in the next superstep I get my array with an appended 0. Does
>> anybody have an idea what might be causing that?
>>
>> Cheers,
>> Christian
>>
>
>

Mime
View raw message