Best way to know the assignment of vertices to workers

2014-11-28 Thread Garimella Kiran
Hi all, Is there a clean way to find out which worker a particular vertex is assigned to? From what I tried out, I found that given n workers, each node is assigned to the worker with id (vertex_id % n ). Is that a safe way to do this? I’ve had a look at previous discussions, but most of

Re: Best way to know the assignment of vertices to workers

2014-11-28 Thread Matthew Saltz
Kiran, To answer your question directly, in an AbstractComputation class (or whatever descendant you're using), you may call getWorkerContext().getMyWorkerIndex() (here https://giraph.apache.org/apidocs/org/apache/giraph/worker/WorkerContext.html). However, if each vertex has metadata associated

RE: Best way to know the assignment of vertices to workers

2014-11-28 Thread Pavan Kumar A
I wrote a diff sometime ago where you can easily do that. You can find implementation details at - https://issues.apache.org/jira/browse/GIRAPH-908 https://reviews.apache.org/r/22234/ Some options you can use are -Dgiraph.mappingStoreClass=org.apache.giraph.mapping.LongByteMappingStore

RE: Best way to know the assignment of vertices to workers

2014-11-28 Thread Pavan Kumar A
I looked at the code again does not seem like workerList is sorted, etc. so by knowing a worker number there is no consistent way to tell the actual worker details each time. Lukas was working on such a diff sometime back. Perhaps he can answer more. From: pava...@outlook.com To: