【发布时间】:2014-11-21 06:14:27
【问题描述】:
我正在尝试使用 Java API 在我的本地计算机中填充单节点 Titan-HBase。 当尝试在 Titan 中使用 HBase 后端构建边缘索引时,使用以下代码,
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
我正在使用 Titan 0.5.0M1 和 HBase 0.94.23。
JPS 返回结果: 14951 加载到 HBase 14674 弹性搜索 14379 H大师 17987 日/秒
我对使用 HBase 的 Titan 非常陌生,如果有人能针对此错误指出正确的方向,那就太好了。指向任何提供使用代码填充 Titan-HBase 设置的示例代码的帖子的指针也将非常有用。
【问题讨论】:
标签: java hbase titan hbasestorage