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 <[email protected]>: > 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. >
