I am using OrientDB 2.1.4 and blueprints-core-2.6.0.
I have a requirement to update values on an existing Vertex or creating a new Vertex if not present. (expected 30k vertices every 45 seconds)
My vertex class is : Device(Name, Type, ActiveSessionCount) - "Name" for each Device is a unique entity.
Need to update ActiveSessionCount on device if device exists, else create a new Device vertex.
if (graph.getVertices(keyName, key).iterator().hasNext()) {
vertex = (OrientVertex) graph.getVertices(keyName, key).iterator().next();
} else {
vertex = graph.addVertex(className, attributeName, key);
}
I am trying to check if a vertex exists, if a vertex already exists, I have fetched the Vertex object for further update, else created a new Vertex Object.
Although, this works, it is taking a couple of minutes to execute for 30k records, while I need to achieve the same in 45 seconds.