Hi Ravi

you can do one thing. You can create a RDD with the edges  and then do
zipWithIndex

Let a = sc.parallelize(['9:8','1:2','1:2','3,5'])

a.zipWithIndex().collect()

gives

 [('9:8', 0), ('1:2', 1), ('1:2', 2), ('3,5', 3)]

Let me know if you  have any other queries

On Thu, Jun 25, 2015 at 10:55 PM, Ravikant Dindokar <[email protected]
> wrote:

> I have a file containing one line for each edge in the graph with two
> vertex ids (source & sink).
> sample:
> 1    2 (here 1 is source and 2 is sink node for the edge)
> 1    5
> 2    3
> 4    2
> 4    3
> I want to assign a unique Id (Long value )to each edge i.e for each line
> of the file.
>
> How to ensure assignment of unique value in distributed RDD processing?
>
> Thanks
> Ravikant
>

Reply via email to