You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@giraph.apache.org by Apostolos Koutras <ko...@gmail.com> on 2014/02/22 13:07:19 UTC

overriding vertex value

Hi to all, can you please direct be to an older post of how to override the
vertex value and implement the serializer? Iam still in the dark....

Thank you...

Re: overriding vertex value

Posted by Sebastian Schelter <ss...@apache.org>.
That's fine, just have your value class implement the Writable interface.

On 02/22/2014 04:41 PM, Apostolos Koutras wrote:
> but the vertex value is no more a single value like a Double writable but a
> Class, so there's not a match for my situation
>
>
> On Sat, Feb 22, 2014 at 5:03 PM, Sebastian Schelter <ss...@apache.org> wrote:
>
>> I think you have to implement an InputFormat that matches your vertex
>> value type.
>>
>>
>>
>>
>> On 02/22/2014 02:43 PM, Apostolos Koutras wrote:
>>
>>> The main algorithm Betweeness.java is based on
>>> SimpleShortestPaths***.java.
>>> In order to implement the new algorithm I had to override the message
>>> value
>>> as well as the vertex value.
>>>
>>> I dug up the examples, and the most compatible files where the files about
>>> bracha-something calculation.
>>>
>>> The overrided vertex value is myVertexValue.java and is based on
>>>    Bracha*Value.java and in there lies the problem I suppose, probably due
>>> to
>>> misconfigurating the serializer
>>>
>>> // Serialization functions ------------------------------
>>> -----------------
>>>
>>>     @Override
>>>     public void readFields(DataInput input) throws IOException {
>>>    //   this.distance=input.readLong();
>>>          this.sigma=input.readDouble();
>>> //      this.delta=input.readDouble();
>>>     }
>>>
>>>     @Override
>>>     public void write(DataOutput output) throws IOException {
>>>       int sz;
>>>
>>>          output.writeLong(this.distance);
>>>          output.writeDouble(this.sigma);
>>>          output.writeDouble(this.delta);
>>>
>>>    }
>>>
>>>
>>> Of course, when I try to run the example I try to use the following
>>> handler, that works for the simpleShortest paths, but now that I've
>>> overriden the vertex value???
>>>
>>> org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat
>>>
>>>
>>>    The main code of the project is on www.github.com/koutras/gb   , to get
>>> the whole idea...
>>> At the moment Iam in a stalemate.... Any ideas so that I can make even a
>>> small step are needed... Thanks..
>>>
>>>
>>> On Sat, Feb 22, 2014 at 2:32 PM, Sebastian Schelter <ss...@apache.org>
>>> wrote:
>>>
>>>   Hi Apostolous,
>>>>
>>>> can you provide a few more details on what you're exactly trying to
>>>> achieve?
>>>>
>>>> Best,
>>>> Sebastian
>>>>
>>>>
>>>> On 02/22/2014 01:07 PM, Apostolos Koutras wrote:
>>>>
>>>>   Hi to all, can you please direct be to an older post of how to override
>>>>> the
>>>>> vertex value and implement the serializer? Iam still in the dark....
>>>>>
>>>>> Thank you...
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>


Re: overriding vertex value

Posted by Apostolos Koutras <ko...@gmail.com>.
but the vertex value is no more a single value like a Double writable but a
Class, so there's not a match for my situation


On Sat, Feb 22, 2014 at 5:03 PM, Sebastian Schelter <ss...@apache.org> wrote:

> I think you have to implement an InputFormat that matches your vertex
> value type.
>
>
>
>
> On 02/22/2014 02:43 PM, Apostolos Koutras wrote:
>
>> The main algorithm Betweeness.java is based on
>> SimpleShortestPaths***.java.
>> In order to implement the new algorithm I had to override the message
>> value
>> as well as the vertex value.
>>
>> I dug up the examples, and the most compatible files where the files about
>> bracha-something calculation.
>>
>> The overrided vertex value is myVertexValue.java and is based on
>>   Bracha*Value.java and in there lies the problem I suppose, probably due
>> to
>> misconfigurating the serializer
>>
>> // Serialization functions ------------------------------
>> -----------------
>>
>>    @Override
>>    public void readFields(DataInput input) throws IOException {
>>   //   this.distance=input.readLong();
>>         this.sigma=input.readDouble();
>> //      this.delta=input.readDouble();
>>    }
>>
>>    @Override
>>    public void write(DataOutput output) throws IOException {
>>      int sz;
>>
>>         output.writeLong(this.distance);
>>         output.writeDouble(this.sigma);
>>         output.writeDouble(this.delta);
>>
>>   }
>>
>>
>> Of course, when I try to run the example I try to use the following
>> handler, that works for the simpleShortest paths, but now that I've
>> overriden the vertex value???
>>
>> org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat
>>
>>
>>   The main code of the project is on www.github.com/koutras/gb   , to get
>> the whole idea...
>> At the moment Iam in a stalemate.... Any ideas so that I can make even a
>> small step are needed... Thanks..
>>
>>
>> On Sat, Feb 22, 2014 at 2:32 PM, Sebastian Schelter <ss...@apache.org>
>> wrote:
>>
>>  Hi Apostolous,
>>>
>>> can you provide a few more details on what you're exactly trying to
>>> achieve?
>>>
>>> Best,
>>> Sebastian
>>>
>>>
>>> On 02/22/2014 01:07 PM, Apostolos Koutras wrote:
>>>
>>>  Hi to all, can you please direct be to an older post of how to override
>>>> the
>>>> vertex value and implement the serializer? Iam still in the dark....
>>>>
>>>> Thank you...
>>>>
>>>>
>>>>
>>>
>>
>

Re: overriding vertex value

Posted by Sebastian Schelter <ss...@apache.org>.
I think you have to implement an InputFormat that matches your vertex 
value type.



On 02/22/2014 02:43 PM, Apostolos Koutras wrote:
> The main algorithm Betweeness.java is based on SimpleShortestPaths***.java.
> In order to implement the new algorithm I had to override the message value
> as well as the vertex value.
>
> I dug up the examples, and the most compatible files where the files about
> bracha-something calculation.
>
> The overrided vertex value is myVertexValue.java and is based on
>   Bracha*Value.java and in there lies the problem I suppose, probably due to
> misconfigurating the serializer
>
> // Serialization functions -----------------------------------------------
>
>    @Override
>    public void readFields(DataInput input) throws IOException {
>   //   this.distance=input.readLong();
>   	this.sigma=input.readDouble();
> //	this.delta=input.readDouble();	
>    }
>
>    @Override
>    public void write(DataOutput output) throws IOException {
>      int sz;
>
> 	output.writeLong(this.distance);
> 	output.writeDouble(this.sigma);
> 	output.writeDouble(this.delta);
>
>   }
>
>
> Of course, when I try to run the example I try to use the following
> handler, that works for the simpleShortest paths, but now that I've
> overriden the vertex value???
>
> org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat
>
>
>   The main code of the project is on www.github.com/koutras/gb   , to get
> the whole idea...
> At the moment Iam in a stalemate.... Any ideas so that I can make even a
> small step are needed... Thanks..
>
>
> On Sat, Feb 22, 2014 at 2:32 PM, Sebastian Schelter <ss...@apache.org> wrote:
>
>> Hi Apostolous,
>>
>> can you provide a few more details on what you're exactly trying to
>> achieve?
>>
>> Best,
>> Sebastian
>>
>>
>> On 02/22/2014 01:07 PM, Apostolos Koutras wrote:
>>
>>> Hi to all, can you please direct be to an older post of how to override
>>> the
>>> vertex value and implement the serializer? Iam still in the dark....
>>>
>>> Thank you...
>>>
>>>
>>
>


Re: overriding vertex value

Posted by Apostolos Koutras <ko...@gmail.com>.
The main algorithm Betweeness.java is based on SimpleShortestPaths***.java.
In order to implement the new algorithm I had to override the message value
as well as the vertex value.

I dug up the examples, and the most compatible files where the files about
bracha-something calculation.

The overrided vertex value is myVertexValue.java and is based on
 Bracha*Value.java and in there lies the problem I suppose, probably due to
misconfigurating the serializer

// Serialization functions -----------------------------------------------

  @Override
  public void readFields(DataInput input) throws IOException {
 //   this.distance=input.readLong();
 	this.sigma=input.readDouble();
//	this.delta=input.readDouble();	
  }

  @Override
  public void write(DataOutput output) throws IOException {
    int sz;

	output.writeLong(this.distance);
	output.writeDouble(this.sigma);
	output.writeDouble(this.delta);

 }


Of course, when I try to run the example I try to use the following
handler, that works for the simpleShortest paths, but now that I've
overriden the vertex value???

org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat


 The main code of the project is on www.github.com/koutras/gb   , to get
the whole idea...
At the moment Iam in a stalemate.... Any ideas so that I can make even a
small step are needed... Thanks..


On Sat, Feb 22, 2014 at 2:32 PM, Sebastian Schelter <ss...@apache.org> wrote:

> Hi Apostolous,
>
> can you provide a few more details on what you're exactly trying to
> achieve?
>
> Best,
> Sebastian
>
>
> On 02/22/2014 01:07 PM, Apostolos Koutras wrote:
>
>> Hi to all, can you please direct be to an older post of how to override
>> the
>> vertex value and implement the serializer? Iam still in the dark....
>>
>> Thank you...
>>
>>
>

Re: overriding vertex value

Posted by Sebastian Schelter <ss...@apache.org>.
Hi Apostolous,

can you provide a few more details on what you're exactly trying to achieve?

Best,
Sebastian

On 02/22/2014 01:07 PM, Apostolos Koutras wrote:
> Hi to all, can you please direct be to an older post of how to override the
> vertex value and implement the serializer? Iam still in the dark....
>
> Thank you...
>