2016-10-12 109 views
2

我想使用Cassandra和Java来设置Titan。未解决的参考设置Titan

我导入库到我的项目使用:

compile group: 'com.thinkaurelius.titan', name: 'titan-cassandra', version: '1.0.0' 

,我从复制的源例子:

https://github.com/thinkaurelius/titan/blob/master/titan-core/src/main/java/com/thinkaurelius/titan/example/GraphOfTheGodsFactory.java

但下面的东西不起作用:

import com.thinkaurelius.titan.core.TitanKey; 
import com.thinkaurelius.titan.core.attribute.Geoshape; 
import static com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.INDEX_BACKEND_KEY; 
import static com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.STORAGE_DIRECTORY_KEY; 

不存在

012因为个

及以下抛出错误,他无法解析引用:

Configuration storage = config.subset(GraphDatabaseConfiguration.STORAGE_NAME_SPACE); 
    storage.setProperty(GraphDatabaseConfiguration.STORAGE_BACKEND_KEY, "local"); 
    storage.setProperty(GraphDatabaseConfiguration.STORAGE_DIRECTORY_KEY, directory); 

    Configuration index = storage.subset(GraphDatabaseConfiguration.INDEX_NAMESPACE).subset(INDEX_NAME); 
    index.setProperty(INDEX_BACKEND_KEY, "elasticsearch"); 


    index.setProperty(STORAGE_DIRECTORY_KEY, directory + File.separator + "es"); 

回答

2

你的GraphOfTheGodsFactory.java版本不匹配。您应该参考标记1.0.0而不是master

https://github.com/thinkaurelius/titan/blob/1.0.0/titan-core/src/main/java/com/thinkaurelius/titan/example/GraphOfTheGodsFactory.java

+0

此外'master'分支可悲地过时。 GitHub上的默认分支实际上是'titan10',最新的开发是在'titan11'分支。 –

+0

哪个应该是我应该使用gradle检出的版本? Titan10已经稳定了吗? – user2524707

+0

你的gradle导入看起来很好。 'titan10'有一些超出'1.0.0'的变化。如果您使用的是“titan-1.0.0.zip”,我建议您使用'1.0.0'标签,因为这是匹配的源代码。 –