giraph-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Krause ...@ckrause.org>
Subject Re: Generating unique vertex id's for addVertexRequest
Date Tue, 29 Jul 2014 11:28:32 GMT
Hi Panagiotis,

you could use Java UUIDs. But you would need two longs for this. Otherwise
you could also define your own application specific logic to generate
universal IDs.

Cheers,
Christian


2014-07-29 12:14 GMT+02:00 Panagiotis Eustratiadis <ep.pan.dit@gmail.com>:

> Hello everyone,
>
> I'm looking for a way to generate unique id's (of type Long) for the
> addVertexRequest. For example, a very silly implementation that works for
> graphs with less than 100 vertices would look like this:
>
> public void compute(Iterable<NullWritable> messages) {
> ...
>     long generatedId = generateId(long getId().get());
>     addVertexRequest(new LongWritable(generatedId), new DoubleWritable(0));
> ...
> }
>
> private long generateId(long seed) {
>     return seed + 100;
> }
>
> But as I said, this is just silly. How can I modify the generateId so that
> I know the vertex id is unique regardless of the graph size?
>
> Panagiotis Eustratiadis.
>

Mime
View raw message