我正在尝试批量加载到泰坦数据库。存储后端是Cassandra,索引后端是弹性搜索。
我在提交时遇到异常。 异常消息是“由于持久性期间的异常而无法提交事务”,并且堆栈跟踪如下所示:
java.lang.NullPointerException at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph$3.apply(StandardTitanGraph.java:621)
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph$3.apply(StandardTitanGraph.java:618)
at com.google.common.collect.Iterators$7.computeNext(Iterators.java:652)
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
at com.google.common.collect.Iterables.isEmpty(Iterables.java:1001)
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.commit(StandardTitanGraph.java:667)
at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx.commit(StandardTitanTx.java:1352)
at com.ncrm.LoaderImpl.loadData(LoaderImpl.java:338)
at com.ncrm.TripleLoader.execute(TripleLoader.java:52)
at com.ncrm.TripleLoader.main(TripleLoader.java:24)
当我追踪到titan源时,此行发生异常:
//3.2 Commit schema elements and their associated relations in a separate transaction if backend does not support
// transactional isolation
boolean hasSchemaElements = !Iterables.isEmpty(Iterables.filter(deletedRelations,SCHEMA_FILTER))
|| !Iterables.isEmpty(Iterables.filter(addedRelations,SCHEMA_FILTER));
此异常仅在多线程加载时发生。单线程加载没有问题。 请帮帮我~~