Hi All,
I am a new Titan user and my use-case is to update a graph in map reduce. Following is the pseudo-code for my Map class, where I am getting an exception.
Class Map
{
configure()
{
open titan db;
}
map()
{
Compute some value from the graph for the current user;
Set the computed value as a property for that user;
}
close()
{
graph.commit();
graph.shutdown();
}
}
With the above map class, for one of the map tasks, I am getting the following exception:
com.thinkaurelius.titan.core.TitanException: Could not commit transaction due to exception during persistence
at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx.commit(StandardTitanTx.java:848)
at com.thinkaurelius.titan.graphdb.blueprints.TitanBlueprintsGraph.commit(TitanBlueprintsGraph.java:64)
at adsorption.parallel.Parallel$SumCommonItemsMap.map(Parallel.java:337)
at adsorption.parallel.Parallel$SumCommonItemsMap.map(Parallel.java:1)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:436)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:372)
at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121)
at org.apache.hadoop.mapred.Child.main(Child.java:249)
Caused by: com.thinkaurelius.titan.core.TitanException: Permanent exception during backend operation
at com.thinkaurelius.titan.diskstorage.util.BackendOperation.execute(BackendOperation.java:64)
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.save(StandardTitanGraph.java:277)
at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx.commit(StandardTitanTx.java:839)
... 11 more
Caused by: com.thinkaurelius.titan.diskstorage.locking.PermanentLockingException: Updated state: lock acquired but value has changed since read [LockClaim [backer=com.thinkaurelius.titan.diskstorage.locking.consistentkey.ConsistentKeyLockStore@1473ec7, key=0x1-100-105-115-116-83-117-237, col=0x132, expectedValue=null]]
at com.thinkaurelius.titan.diskstorage.locking.consistentkey.ConsistentKeyLockTransaction.verifyAllLockClaims(ConsistentKeyLockTransaction.java:427)
at com.thinkaurelius.titan.diskstorage.locking.consistentkey.ConsistentKeyLockStore.mutate(ConsistentKeyLockStore.java:118)
at com.thinkaurelius.titan.diskstorage.BackendTransaction.mutateVertexIndex(BackendTransaction.java:111)
at com.thinkaurelius.titan.graphdb.database.IndexSerializer.addProperty(IndexSerializer.java:83)
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.persist(StandardTitanGraph.java:306)
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.access$000(StandardTitanGraph.java:45)
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph$2.call(StandardTitanGraph.java:262)
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph$2.call(StandardTitanGraph.java:203)
at com.thinkaurelius.titan.diskstorage.util.BackendOperation.execute(BackendOperation.java:61)
... 13 more
When I ran it another time, I got the same exception with a different stack trace:
Caused by: com.thinkaurelius.titan.diskstorage.locking.PermanentLockingException: Lock could not be acquired because it is held by a remote transaction [LockClaim [backer=com.thinkaurelius.titan.diskstorage.locking.consistentkey.ConsistentKeyLockStore@32f71, key=0x1-100-105-115-116-83-117-237, col=0x132, expectedValue=null]]
at com.thinkaurelius.titan.diskstorage.locking.consistentkey.ConsistentKeyLockTransaction.verifyAllLockClaims(ConsistentKeyLockTransaction.java:396)
at com.thinkaurelius.titan.diskstorage.locking.consistentkey.ConsistentKeyLockStore.mutate(ConsistentKeyLockStore.java:118)
at com.thinkaurelius.titan.diskstorage.BackendTransaction.mutateVertexIndex(BackendTransaction.java:111)
at com.thinkaurelius.titan.graphdb.database.IndexSerializer.addProperty(IndexSerializer.java:83)
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.persist(StandardTitanGraph.java:306)
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.access$000(StandardTitanGraph.java:45)
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph$2.call(StandardTitanGraph.java:262)
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph$2.call(StandardTitanGraph.java:203)
at com.thinkaurelius.titan.diskstorage.util.BackendOperation.execute(BackendOperation.java:61)
... 12 more
I am just wondering if I am using the commit correctly or if I have to commit after I update each user. Also, is it possible to update the same vertex in two different mappers (by update I meant adding edges to that vertex). Is there any documentation for updating the graph in a distributed environment? I am using HBase as backend.
Any help is much appreciated.
Thanks,
Rohit