我使用 Titan 0.4.0 All,在 Ubuntu 12.04 上以共享 VM 模式运行 Rexster。
如何正确删除 Titan 中使用 Cassandra 存储后端的图表?
我已经尝试过TitanCleanup.clear(graph)
,但它不会删除所有内容。指数仍然存在。我真正的问题是我有一个我不想要的索引(它会使每个查询崩溃),但是据我了解泰坦的文档索引一旦创建就无法删除 https://github.com/thinkaurelius/titan/wiki/Titan-Limitations#unable-to-drop-key-indices.
您可以使用以下方法清除所有边/顶点:
g.V.remove()
但正如您所发现的,这不会清除先前创建的类型/索引。最干净的选择是删除 Cassandra 数据目录。
如果您通过单元测试执行删除,您可以尝试将其作为测试设置的一部分:
this.config = new BaseConfiguration(){{
addProperty("storage.backend", "berkeleyje")
addProperty("storage.directory", "/tmp/titan-schema-test")
}}
GraphDatabaseConfiguration graphconfig = new GraphDatabaseConfiguration(config)
graphconfig.getBackend().clearStorage()
g = (StandardTitanGraph) TitanFactory.open(config)
一定要打电话g.shutdown()
在你的测试拆卸方法中。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)