giraph-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Etienne Dumoulin <etienne.dumou...@idiro.com>
Subject How to use an aggregator to halt ?
Date Sun, 22 Jul 2012 20:16:48 GMT
Hi everyone,

I implement a pagerank very similar to the one given
in the example package.

However I would like to do a halt condition with an aggregator:
I am calculating the sum of all the vertex values at each step.
I am stopping when the average of the difference is bellow a certain
point.

So I have extended a WorkerContext class. It does not look like
I can stop the process from the method postSuperStep(), so I try
to set a boolean somewhere readable by the vertex.
Where can I set it?

-I tried to do a getWorkerContext, cast into my type and then call my own
method:
if ( ((MyWorkerContext)getWorkerContext()).isEnd();
    ) {
       voteToHalt();
}else{...
}

-I tried to set a boolean into the Configuration from the WorkerContext and
get it back into the Vertex.
if ( getWorkerContext().getContext().getConfiguration().getBoolean("end",
false)
    ) {
       voteToHalt();
}else{...
}

Thanks,

Etienne

Mime
View raw message