Jyoti - I recently did a similar= thing. In fact=2C my approach was exactly what Maja suggested. =3BHowever=2C there is a caveat. You can switch computation class for workers= in mastercompute's compute method but that requires the messages sent by c= omputation class active before switching and messages received by computati= on class after switching to be the same.

For insta= nce =3B

Superstep 1 - Compute-A (M1)
Superstep 2 - Compute-A (M1)
Superstep 3 - Compute-B(receive M1= =2C outgoing is M2) -->=3B you can achieve this using =3BAbstractComp= utation=2C instead of =3BBasicComputation.
However=2C if Comp= ute-B needs to be used in superstep-4 as well i.e.
Superstep 4 - = Compute-B [it receives M2 but that conflicts with its definition]

So in this case the trick is
Superstep 1 - Comput= e-A (M1)
Superstep 2 - Compute-A (M1)
time to switch
Superstep 3 - NoOpMessageSink extends =3BAbstractComputation<=3BI=2CV=2CE=2CM1=2CM2>=3B whose compu= te() =3D { translate M1->=3B M2}
make the switch
Superstep 4 - Compute-B (M2)
Superstep 5 - Compute-B (M2)

and so on.

If your compute fu= nctions change alternatively then u can extend AbstractComputation like
Superstep 1 - Compute-A (extends AbstractComputation <=3BM1=2C M2&= gt=3B)
Superstep 2 - Compute-B (extends AbstractComputation = <=3BM2=2C M1>=3B)
Superstep 3 - Compute-A (extends Abstr= actComputation <=3BM1=2C M2>=3B)
Superstep 4 - Com= pute-B (extends AbstractComputation <=3BM2=2C M1>=3B)
<= br>

<= /div>
Thanks.

From: ma= jakabiljo@fb.com
To: user@giraph.apache.org
Subject: Re: Running one = compute function after another..
Date: Sat=2C 11 Jan 2014 19:01:08 +0000=

=0A= =0A= =0A= =0A= =0A=
Hi Jyoti=2C
=0A=

=0A=
=0A=
A cleaner way to do this is to switch Computation class which is used = in the moment your condition is satisfied. So you can have an aggregator to= check whether the condition is met=2C and then in your MasterCompute you c= all setComputation(SecondComputationClass.class)=0A= when needed.
=0A=

=0A=
=0A=
Regards=2C
=0A=
Maja
=0A=

=0A=
=0A= =0A=
=0A= Date: Saturday=2C January 11=2C = 2014 10:48 AM
=0A= To: "user@giraph.apache.org" <=3Buser@giraph.apache.org>=3B
=0A= Subject: Re: Running one compute= function after another..
=0A=
=0A=

=0A=
=0A=
=0A=
=0A=
=0A=
=0A=
Hi ????? ??=F0???????...
=0A=
=0A= I will go by this..
=0A=
=0A= Thanks...
=0A=
=0A=

=0A=
=0A=
On Sat=2C Jan 11=2C 2014 at 10:52 PM=2C ?????= ??=F0??????? =0A= <=3Bikapoura@cs= d.auth.gr>=3B wrote:
=0A=
=0A= Hey=2C
=0A=
=0A= You can have a boolean variable initially set to true(or false=2C whatever)= . Then you divide your code based on the value of that variable with an if-= else statement. For my example=2C if the value is true then it goes through= the first 'if'. When the condition=0A= you want is fullfilled=2C change the value of the variable to false (at al= l nodes) and then the second part will be executed.
=0A=
=0A= Ilias
=0A=
=0A= ???? 11/1/2014 6:18 ??=2C ?/? Jyoti Yadav ??????:=0A=
=0A=

=0A=
=0A= Hi folks..
=0A=
=0A=
=0A= In my algorithm=2Call vertices execute one compute function upto certain co= ndition=2C when that condition is fulfilled=2Ci want that all vertices now = execute another compute function.Is it possible??
=0A=
=0A= Any ideas are highly appreciated..
=0A=
=0A= Thanks
=0A= Jyoti
=0A=
=0A=
=0A=
=0A=
=0A=
=0A=
=0A=
=0A=
=0A=
=0A=
=0A=
= --_62d6c00f-af20-4854-8730-2370b230774a_--