简体   繁体   English

如何查找有关在以Cassandra作为数据存储的Titan / Rexster图形数据库上创建的索引的信息

[英]How to find the information about index created on Titan/Rexster graph database with cassandra as datastore

I have a Rexster/Titan + Cassandra configuration. 我有Rexster / Titan + Cassandra配置。 I have created unique index over vertex properties. 我在顶点属性上创建了唯一索引。 How can I verify the index has created properly? 如何验证索引已正确创建? and also to check the other properties such as uniqueness and any other information about the created index? 并检查其他属性,例如唯一性以及有关所创建索引的任何其他信息?

As you are using Titan, you can use the TitanManagement API: 使用Titan时,可以使用TitanManagement API:

gremlin> g = TitanFactory.open('conf/titan-berkeleydb-es.properties')
==>titangraph[berkeleyje:/home/smallette/jvm/titan-0.5.4-hadoop1/conf/../db/berkeley]
gremlin> GraphOfTheGodsFactory.load(g)
==>null
gremlin> mgmt = g.getManagementSystem()
==>com.thinkaurelius.titan.graphdb.database.management.ManagementSystem@6ac756b
mgmt.getGraphIndexes(Vertex.class).collect{[it.name,it.fieldKeys.collect{it.cardinality}]}
==>[name, [SINGLE]]
==>[vertices, [SINGLE]]
gremlin> mgmt.rollback()
==>null

You can either issue the query as I did from the Gremlin Console or you should be able to simply issue the same query like that to Rexster's Gremlin Extension to get that result. 您可以像从Gremlin Console一样发出查询,也可以向Rexster的Gremlin Extension发出相同的查询,以得到结果。 Be sure to call rollback (or commit ) to close the management API transaction, especially if using Rexster (Rexster doesn't auto-manage those). 确保调用rollback (或commit )以关闭管理API事务,尤其是在使用Rexster时(Rexster不会自动管理那些事务)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM