尝试使用java api填充titan hbase组合时出现异常

x7rlezfr  于 2021-06-09  发布在  Hbase
关注(0)|答案(1)|浏览(323)

我正在尝试使用javaapi在本地计算机中填充单节点titan hbase。在尝试使用hbase后端在titan中构建边缘索引时,请使用以下代码,

public static final String ELABEL_RESOURCE_HAS_XDOC = "_EResourceHasXDoc"; 
public static final String IDX_EDGE_BY_CID_XID = "IdxEdgeByCidXid";
public static final String PROP_COLLECTION_ID = "_PCollectionID";
public static final String PROP_XDOC_ID = "_PXDocID";

m.buildEdgeIndex(m.getEdgeLabel(ELABEL_RESOURCE_HAS_XDOC), IDX_EDGE_BY_CID_XID, Direction.OUT, m.getPropertyKey(PROP_COLLECTION_ID), m.getPropertyKey(PROP_XDOC_ID));

我得到以下例外:

Exception in thread "main" 
java.lang.ExceptionInInitializerError
at test.com.infa.prototype.titan.hbase.LoadIntoHBase.main(LoadIntoHBase.java:24)
Caused by: java.lang.IllegalArgumentException: Key must have an order-preserving data type to be used as sort key: _PCollectionID
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:88)
at com.thinkaurelius.titan.graphdb.types.StandardRelationTypeMaker.checkSortKey(StandardRelationTypeMaker.java:90)
at com.thinkaurelius.titan.graphdb.types.StandardRelationTypeMaker.checkGeneralArguments(StandardRelationTypeMaker.java:80)
at com.thinkaurelius.titan.graphdb.types.StandardRelationTypeMaker.makeDefinition(StandardRelationTypeMaker.java:113)
at com.thinkaurelius.titan.graphdb.types.StandardEdgeLabelMaker.make(StandardEdgeLabelMaker.java:78)
at com.thinkaurelius.titan.graphdb.types.StandardEdgeLabelMaker.make(StandardEdgeLabelMaker.java:19)
at com.thinkaurelius.titan.graphdb.database.management.ManagementSystem.buildRelationTypeIndex(ManagementSystem.java:327)
at com.thinkaurelius.titan.graphdb.database.management.ManagementSystem.buildEdgeIndex(ManagementSystem.java:275)
at com.thinkaurelius.titan.graphdb.database.management.ManagementSystem.buildEdgeIndex(ManagementSystem.java:270)
at com.infa.prototype.titan.utils.TitanConstants.createSchema(TitanConstants.java:87)
at test.com.infa.prototype.titan.hbase.TitanConnection.<init>(TitanConnection.java:38)
at test.com.infa.prototype.titan.hbase.TitanConnection.<clinit>(TitanConnection.java:13)
... 1 more

我正在使用泰坦0.5.0m1和hbase 0.94.23。
jps返回结果:14951 loadintohbase 14674 elasticsearch 14379 hmaster 17987 jps
我是一个新的泰坦与hbase和它将是伟大的,如果有人能指出我在正确的方向,关于这个错误。一个指向任何post的指针,它提供了填充titan hbase设置的示例代码,使用代码,也会非常有用。

a1o7rhls

a1o7rhls1#

如错误消息所述:类型 _PXDocID 必须具有保序数据类型(即字符串或任何数字数据类型)。

相关问题