I am trying to create relationships in titan and trying to give an array with the properties at creation.
while (startNode.hasNext())
{
Vertex tempVertex = startNode.next();
while (endNode.hasNext())
{
tempVertex.addEdge(storage.getId(), endNode.next(), keyValue);
}
}
But it's throwing the following error on edge creation.
int i = 0;
for (Map.Entry<String, Object> entry : storage.getProperties().entrySet())
{
keyValue[i] = entry.getKey();
keyValue[i + 1] = entry.getValue();
i += 2;
}
Normally the map should have the string at every even index already.
java.lang.IllegalArgumentException: The provided key/value array must have a String or T on even array indices
at org.apache.tinkerpop.gremlin.structure.Element$Exceptions.providedKeyValuesMustHaveALegalKeyOnEvenIndices(Element.java:129)
at org.apache.tinkerpop.gremlin.structure.util.ElementHelper.legalPropertyKeyValueArray(ElementHelper.java:117)
at com.thinkaurelius.titan.graphdb.util.ElementHelper.attachProperties(ElementHelper.java:46)
at com.thinkaurelius.titan.graphdb.vertices.AbstractVertex.addEdge(AbstractVertex.java:151)
at com.thinkaurelius.titan.graphdb.vertices.AbstractVertex.addEdge(AbstractVertex.java:23)
at main.java.com.bag.server.database.TitanDatabaseAccess.applyCreate(TitanDatabaseAccess.java:469)
at main.java.com.bag.operations.CreateOperation.apply(CreateOperation.java:36)
at main.java.com.bag.server.TestServer.executeCommit(TestServer.java:190)
at main.java.com.bag.server.TestServer.appExecuteBatch(TestServer.java:138)
at bftsmart.tom.server.defaultservices.DefaultRecoverable.executeBatch(DefaultRecoverable.java:87)
at bftsmart.tom.server.defaultservices.DefaultRecoverable.executeBatch(DefaultRecoverable.java:68)
at bftsmart.tom.ServiceReplica.receiveMessages(ServiceReplica.java:432)
at bftsmart.tom.core.DeliveryThread.deliverMessages(DeliveryThread.java:293)
at bftsmart.tom.core.DeliveryThread.run(DeliveryThread.java:225)