Hello Giraph list,

I have a problem that has two steps.  Step 2 needs to start after step 1 
completes.  Step 1 is completed when all the vertices have voted to halt and 
there are no more messages. 

I know I can switch my computes using a MasterCompute, but it is unclear how I 
re-awaken all the vertices.

Has anyone else solved a problem like this?  If so, how did you do it?  Is 
there an easier way to do this?

Basically I'm thinking this:

class TwoStep {

  class TwoStepMaster extends DefaultMasterCompute {

       public final void compute() {
              //
              // switch from StepOne to StepTwo  if StepOne is done
              //
              if (this .isHalted &&  
this.getComputation().equals(StepOne.class);) {
                   setComputation(StepTwo.class());
                    // send a message to all vertices???
                    // unhalt somehow??
                    // suggestions anyone??
               }
       }
   }

   class StepOne extends BasicComputation {
        public void compute(...) {
                  // do step one stuff
                 vertex.voteToHalt();
        }
   }

   class StepTwo extends BasicComputation {
        public void compute(...) {
                  // do step two stuff
                 vertex.voteTpHalt();
        }
     }    

 }




Reply via email to