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.

Reply via email to