user3322698
user3322698

Reputation: 265

set-up our own vertex id in titan using java API

I want to set up my own id to vertex like the way mentioned below.

BaseConfiguration configuration = new BaseConfiguration();
configuration.setProperty("storage.backend", "hbase");
configuration.setProperty("storage.hostname", "slave05");
configuration.setProperty("storage.port", "2181");
configuration.setProperty("storage.tablename", "REC_GRAPH1");
TitanGraph graph = TitanFactory.open(configuration);

Vertex vertex = graph.addVertex(200);
graph.commit();

But I'm not able to.. I guess I'm missing some configuration setup.

Please help me..

Thanks, Vivek

Upvotes: 0

Views: 253

Answers (1)

stephen mallette
stephen mallette

Reputation: 46226

Titan assigns it's own identifiers. You can not assign your own. This behavior is typical of most graph databases (you will find this situation in nearly all Blueprints implementations). If you have an identifier you wish to persist that is custom to you, you should create an appropriate index for fast lookup of that value and treat it as a property on your vertex.

Upvotes: 2

Related Questions