giraph-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Panagiotis Eustratiadis <ep.pan....@gmail.com>
Subject Generating unique vertex id's for addVertexRequest
Date Tue, 29 Jul 2014 10:14:05 GMT
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