You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@giraph.apache.org by Kai Schlegel <ka...@googlemail.com> on 2015/07/22 17:20:02 UTC
Vertex data not persisted through supersteps
Hi everybody,
I encounter a strange behaviour in my Apache Giraph implementations.
In my computation I want to update a counter in my vertex data object. But in the end or even in the next superstep the counter is always zero. Do I forget something simple? Do I have to manually update the vertex value object?
Simple Example:
>> In compute:
...
MyVertextData vertexValue = vertex.getValue();
vertextvalue.increaseCounter();
…
<<
>> MyVertextData.class
…
private Integer counter = 0;
@Override
public void write(DataOutput out) throws IOException {
out.writeInt(this.counter);
}
@Override
public void readFields(DataInput in) throws IOException {
this.counter = in.readInt()
}
public void increaseCounter() {
this.counter = this.counter + 1;
}
<<
Thank you in advance!
Greetings!
_____________________________
Kai Schlegel (M.Sc.)
Chair of Distributed and Multimedia Information Systems (Prof. Kosch)
University of Passau
Innstr. 43
94032 Passau
Room 248 ITZ
Tel.: +49 851 509 3063
Fax: +49 851 509 3062
schlegel@dimis.fim.uni-passau.de
http://www.dimis.fim.uni-passau.de
https://www.xing.com/profile/Kai_Schlegel5
_____________________________
Re: Vertex data not persisted through supersteps
Posted by Namesh Kher <na...@gmail.com>.
You could try setting the incremented value for the vertex in the current
superstep to get the correct value in the next one. May be that could help.
Namesh Kher
On 22 Jul 2015 11:21, "Kai Schlegel" <ka...@googlemail.com> wrote:
> Hi everybody,
>
> I encounter a strange behaviour in my Apache Giraph implementations.
>
> In my computation I want to update a counter in my vertex data object. But
> in the end or even in the next superstep the counter is always zero. Do I
> forget something simple? Do I have to manually update the vertex value
> object?
>
> Simple Example:
>
> >> In compute:
> ...
> MyVertextData vertexValue = vertex.getValue();
> vertextvalue.increaseCounter();
> …
>
> <<
>
> >> MyVertextData.class
> …
> private Integer counter = 0;
>
> @Override
> public void write(DataOutput out) throws IOException {
> out.writeInt(this.counter);
> }
>
> @Override
> public void readFields(DataInput in) throws IOException {
> this.counter = in.readInt()
> }
>
> public void increaseCounter() {
> this.counter = this.counter + 1;
> }
> <<
>
> Thank you in advance!
>
> Greetings!
> _____________________________
> Kai Schlegel (M.Sc.)
>
> Chair of Distributed and Multimedia Information Systems (Prof. Kosch)
> University of Passau
> Innstr. 43
> 94032 Passau
>
> Room 248 ITZ
>
> Tel.: +49 851 509 3063
> Fax: +49 851 509 3062
>
> schlegel@dimis.fim.uni-passau.de
> http://www.dimis.fim.uni-passau.de
> https://www.xing.com/profile/Kai_Schlegel5
> _____________________________
>
>