jackofblades
jackofblades

Reputation: 305

Exception while trying to use Java API to populate Titan-HBase combination

I am trying to populate single node Titan-HBase in my local machine using the Java API. When trying to build Edge Indices in Titan with HBase backend, using the following code,

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));

I am getting the following exception:

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

I am using Titan 0.5.0M1 with HBase 0.94.23.

Result for JPS returns: 14951 LoadIntoHBase 14674 Elasticsearch 14379 HMaster 17987 Jps

I am pretty new to Titan with HBase and it would be great if someone could point me in the right direction regarding this error. A pointer to any post which provides sample code for populating Titan-HBase set-up, using code, would also be very useful.

Upvotes: 0

Views: 160

Answers (1)

Daniel Kuppitz
Daniel Kuppitz

Reputation: 10904

As the error message states: The type _PXDocID must have an order-preserving data type (that is either a String or any numerical data type).

Upvotes: 0

Related Questions